From 7823466a7d9b2bf9ceb949444b96f6525fb4ccd2 Mon Sep 17 00:00:00 2001
From: iscai-msft <43154838+iscai-msft@users.noreply.github.com>
Date: Wed, 29 Jul 2020 14:48:16 -0400
Subject: [PATCH 1/7] [text analytics] generate multiapi client, made
v3.1-preview.1 default version (#12720)
---
.../azure-ai-textanalytics/CHANGELOG.md | 2 +
.../azure/ai/textanalytics/__init__.py | 2 +-
.../azure/ai/textanalytics/_base_client.py | 14 +-
.../ai/textanalytics/_generated/__init__.py | 19 +-
.../_generated/_configuration.py | 66 +++++
.../_generated/_operations_mixin.py | 270 ++++++++++++++++++
.../_generated/_text_analytics_client.py | 103 +++++++
.../ai/textanalytics/_generated/_version.py | 8 +
.../textanalytics/_generated/aio/__init__.py | 10 +
.../_generated/aio/_configuration_async.py | 64 +++++
.../_generated/aio/_operations_mixin_async.py | 266 +++++++++++++++++
.../aio/_text_analytics_client_async.py | 103 +++++++
.../ai/textanalytics/_generated/models.py | 7 +
.../ai/textanalytics/_generated/py.typed | 1 +
.../_generated/v3_0/_metadata.json | 117 ++++++++
.../_generated/v3_0/models/_models.py | 5 +-
.../_generated/v3_0/models/_models_py3.py | 5 +-
.../_generated/v3_1_preview_1/_metadata.json | 129 +++++++++
.../v3_1_preview_1/models/_models.py | 10 +-
.../v3_1_preview_1/models/_models_py3.py | 12 +-
.../azure/ai/textanalytics/_multiapi.py | 46 ---
.../textanalytics/aio/_base_client_async.py | 6 +-
...ment.test_all_successful_passing_dict.yaml | 8 +-
...uccessful_passing_text_document_input.yaml | 8 +-
...nalyze_sentiment.test_bad_credentials.yaml | 4 +-
...entiment.test_bad_model_version_error.yaml | 8 +-
..._sentiment.test_batch_size_over_limit.yaml | 8 +-
...ment.test_batch_size_over_limit_error.yaml | 8 +-
...t_client_passed_default_language_hint.yaml | 24 +-
...t_attribute_error_no_result_attribute.yaml | 8 +-
...attribute_error_nonexistent_attribute.yaml | 8 +-
...nalyze_sentiment.test_document_errors.yaml | 10 +-
...lyze_sentiment.test_document_warnings.yaml | 8 +-
...ze_sentiment.test_duplicate_ids_error.yaml | 8 +-
...sentiment.test_empty_credential_class.yaml | 4 +-
..._sentiment.test_input_with_all_errors.yaml | 12 +-
...sentiment.test_input_with_some_errors.yaml | 12 +-
...iment.test_invalid_language_hint_docs.yaml | 10 +-
...ent.test_invalid_language_hint_method.yaml | 10 +-
...sentiment.test_language_kwarg_spanish.yaml | 8 +-
...alyze_sentiment.test_out_of_order_ids.yaml | 8 +-
...iment.test_output_same_order_as_input.yaml | 8 +-
.../test_analyze_sentiment.test_pass_cls.yaml | 8 +-
...ze_sentiment.test_passing_only_string.yaml | 8 +-
....test_per_item_dont_use_language_hint.yaml | 8 +-
...entiment.test_rotate_subscription_key.yaml | 20 +-
...ent.test_show_stats_and_model_version.yaml | 6 +-
...yze_sentiment.test_too_many_documents.yaml | 8 +-
...est_analyze_sentiment.test_user_agent.yaml | 8 +-
...st_whole_batch_dont_use_language_hint.yaml | 8 +-
...timent.test_whole_batch_language_hint.yaml | 6 +-
...le_batch_language_hint_and_dict_input.yaml | 8 +-
...language_hint_and_dict_per_item_hints.yaml | 8 +-
...ole_batch_language_hint_and_obj_input.yaml | 8 +-
..._language_hint_and_obj_per_item_hints.yaml | 8 +-
...sync.test_all_successful_passing_dict.yaml | 10 +-
...uccessful_passing_text_document_input.yaml | 10 +-
..._sentiment_async.test_bad_credentials.yaml | 6 +-
...nt_async.test_bad_model_version_error.yaml | 10 +-
...ment_async.test_batch_size_over_limit.yaml | 10 +-
...sync.test_batch_size_over_limit_error.yaml | 10 +-
...t_client_passed_default_language_hint.yaml | 30 +-
...t_attribute_error_no_result_attribute.yaml | 10 +-
...attribute_error_nonexistent_attribute.yaml | 10 +-
..._sentiment_async.test_document_errors.yaml | 14 +-
...entiment_async.test_document_warnings.yaml | 10 +-
...timent_async.test_duplicate_ids_error.yaml | 10 +-
...ent_async.test_empty_credential_class.yaml | 6 +-
...ment_async.test_input_with_all_errors.yaml | 14 +-
...ent_async.test_input_with_some_errors.yaml | 14 +-
...async.test_invalid_language_hint_docs.yaml | 14 +-
...ync.test_invalid_language_hint_method.yaml | 12 +-
...ent_async.test_language_kwarg_spanish.yaml | 10 +-
...sentiment_async.test_out_of_order_ids.yaml | 10 +-
...async.test_output_same_order_as_input.yaml | 10 +-
...analyze_sentiment_async.test_pass_cls.yaml | 10 +-
...timent_async.test_passing_only_string.yaml | 10 +-
....test_per_item_dont_use_language_hint.yaml | 10 +-
...nt_async.test_rotate_subscription_key.yaml | 26 +-
...ync.test_show_stats_and_model_version.yaml | 10 +-
...ntiment_async.test_too_many_documents.yaml | 10 +-
...alyze_sentiment_async.test_user_agent.yaml | 10 +-
...st_whole_batch_dont_use_language_hint.yaml | 10 +-
..._async.test_whole_batch_language_hint.yaml | 10 +-
...le_batch_language_hint_and_dict_input.yaml | 10 +-
...language_hint_and_dict_per_item_hints.yaml | 10 +-
...ole_batch_language_hint_and_obj_input.yaml | 10 +-
..._language_hint_and_obj_per_item_hints.yaml | 10 +-
...uage.test_all_successful_passing_dict.yaml | 8 +-
...uccessful_passing_text_document_input.yaml | 8 +-
..._detect_language.test_bad_credentials.yaml | 4 +-
...language.test_bad_model_version_error.yaml | 6 +-
...t_language.test_batch_size_over_limit.yaml | 8 +-
...uage.test_batch_size_over_limit_error.yaml | 8 +-
...st_client_passed_default_country_hint.yaml | 22 +-
...tect_language.test_country_hint_kwarg.yaml | 8 +-
...etect_language.test_country_hint_none.yaml | 32 +--
...t_attribute_error_no_result_attribute.yaml | 8 +-
...attribute_error_nonexistent_attribute.yaml | 8 +-
..._detect_language.test_document_errors.yaml | 6 +-
...etect_language.test_document_warnings.yaml | 8 +-
...ect_language.test_duplicate_ids_error.yaml | 8 +-
..._language.test_empty_credential_class.yaml | 4 +-
...t_language.test_input_with_all_errors.yaml | 8 +-
..._language.test_input_with_some_errors.yaml | 8 +-
...nguage.test_invalid_country_hint_docs.yaml | 6 +-
...uage.test_invalid_country_hint_method.yaml | 8 +-
...detect_language.test_out_of_order_ids.yaml | 8 +-
...guage.test_output_same_order_as_input.yaml | 6 +-
.../test_detect_language.test_pass_cls.yaml | 8 +-
...ect_language.test_passing_only_string.yaml | 6 +-
...e.test_per_item_dont_use_country_hint.yaml | 8 +-
...language.test_rotate_subscription_key.yaml | 20 +-
...age.test_show_stats_and_model_version.yaml | 6 +-
.../test_detect_language.test_user_agent.yaml | 8 +-
...anguage.test_whole_batch_country_hint.yaml | 8 +-
...ole_batch_country_hint_and_dict_input.yaml | 8 +-
..._country_hint_and_dict_per_item_hints.yaml | 8 +-
...hole_batch_country_hint_and_obj_input.yaml | 8 +-
...h_country_hint_and_obj_per_item_hints.yaml | 8 +-
...est_whole_batch_dont_use_country_hint.yaml | 8 +-
...sync.test_all_successful_passing_dict.yaml | 10 +-
...uccessful_passing_text_document_input.yaml | 10 +-
...t_language_async.test_bad_credentials.yaml | 6 +-
...ge_async.test_bad_model_version_error.yaml | 8 +-
...uage_async.test_batch_size_over_limit.yaml | 8 +-
...sync.test_batch_size_over_limit_error.yaml | 8 +-
...st_client_passed_default_country_hint.yaml | 26 +-
...anguage_async.test_country_hint_kwarg.yaml | 10 +-
...language_async.test_country_hint_none.yaml | 38 +--
...t_attribute_error_no_result_attribute.yaml | 8 +-
...attribute_error_nonexistent_attribute.yaml | 10 +-
...t_language_async.test_document_errors.yaml | 10 +-
...language_async.test_document_warnings.yaml | 10 +-
...nguage_async.test_duplicate_ids_error.yaml | 10 +-
...age_async.test_empty_credential_class.yaml | 6 +-
...uage_async.test_input_with_all_errors.yaml | 8 +-
...age_async.test_input_with_some_errors.yaml | 10 +-
..._async.test_invalid_country_hint_docs.yaml | 10 +-
...sync.test_invalid_country_hint_method.yaml | 10 +-
..._language_async.test_out_of_order_ids.yaml | 10 +-
...async.test_output_same_order_as_input.yaml | 8 +-
...t_detect_language_async.test_pass_cls.yaml | 10 +-
...nguage_async.test_passing_only_string.yaml | 10 +-
...c.test_per_item_dont_use_country_hint.yaml | 10 +-
...ge_async.test_rotate_subscription_key.yaml | 26 +-
...ync.test_show_stats_and_model_version.yaml | 10 +-
...detect_language_async.test_user_agent.yaml | 10 +-
...e_async.test_whole_batch_country_hint.yaml | 10 +-
...ole_batch_country_hint_and_dict_input.yaml | 10 +-
..._country_hint_and_dict_per_item_hints.yaml | 10 +-
...hole_batch_country_hint_and_obj_input.yaml | 8 +-
...h_country_hint_and_obj_per_item_hints.yaml | 8 +-
...est_whole_batch_dont_use_country_hint.yaml | 8 +-
...ases.test_all_successful_passing_dict.yaml | 8 +-
...uccessful_passing_text_document_input.yaml | 8 +-
...ract_key_phrases.test_bad_credentials.yaml | 4 +-
..._phrases.test_bad_model_version_error.yaml | 8 +-
...ey_phrases.test_batch_size_over_limit.yaml | 8 +-
...ases.test_batch_size_over_limit_error.yaml | 8 +-
...t_client_passed_default_language_hint.yaml | 24 +-
...t_attribute_error_no_result_attribute.yaml | 6 +-
...attribute_error_nonexistent_attribute.yaml | 6 +-
...ract_key_phrases.test_document_errors.yaml | 12 +-
...ct_key_phrases.test_document_warnings.yaml | 6 +-
..._key_phrases.test_duplicate_ids_error.yaml | 8 +-
...y_phrases.test_empty_credential_class.yaml | 4 +-
...ey_phrases.test_input_with_all_errors.yaml | 12 +-
...y_phrases.test_input_with_some_errors.yaml | 12 +-
...rases.test_invalid_language_hint_docs.yaml | 10 +-
...ses.test_invalid_language_hint_method.yaml | 12 +-
...y_phrases.test_language_kwarg_spanish.yaml | 8 +-
...act_key_phrases.test_out_of_order_ids.yaml | 6 +-
...rases.test_output_same_order_as_input.yaml | 8 +-
...est_extract_key_phrases.test_pass_cls.yaml | 8 +-
..._key_phrases.test_passing_only_string.yaml | 8 +-
....test_per_item_dont_use_language_hint.yaml | 8 +-
..._phrases.test_rotate_subscription_key.yaml | 20 +-
...ses.test_show_stats_and_model_version.yaml | 8 +-
...t_key_phrases.test_too_many_documents.yaml | 8 +-
...t_extract_key_phrases.test_user_agent.yaml | 8 +-
...st_whole_batch_dont_use_language_hint.yaml | 6 +-
...hrases.test_whole_batch_language_hint.yaml | 8 +-
...language_hint_and_dict_per_item_hints.yaml | 8 +-
...ole_batch_language_hint_and_obj_input.yaml | 8 +-
..._language_hint_and_obj_per_item_hints.yaml | 8 +-
...sync.test_all_successful_passing_dict.yaml | 10 +-
...uccessful_passing_text_document_input.yaml | 10 +-
...ey_phrases_async.test_bad_credentials.yaml | 6 +-
...es_async.test_bad_model_version_error.yaml | 10 +-
...ases_async.test_batch_size_over_limit.yaml | 10 +-
...sync.test_batch_size_over_limit_error.yaml | 10 +-
...t_client_passed_default_language_hint.yaml | 30 +-
...t_attribute_error_no_result_attribute.yaml | 8 +-
...attribute_error_nonexistent_attribute.yaml | 8 +-
...ey_phrases_async.test_document_errors.yaml | 14 +-
..._phrases_async.test_document_warnings.yaml | 10 +-
...hrases_async.test_duplicate_ids_error.yaml | 10 +-
...ses_async.test_empty_credential_class.yaml | 6 +-
...ases_async.test_input_with_all_errors.yaml | 14 +-
...ses_async.test_input_with_some_errors.yaml | 14 +-
...async.test_invalid_language_hint_docs.yaml | 12 +-
...ync.test_invalid_language_hint_method.yaml | 14 +-
...ses_async.test_language_kwarg_spanish.yaml | 10 +-
...y_phrases_async.test_out_of_order_ids.yaml | 10 +-
...async.test_output_same_order_as_input.yaml | 10 +-
...tract_key_phrases_async.test_pass_cls.yaml | 8 +-
...hrases_async.test_passing_only_string.yaml | 10 +-
....test_per_item_dont_use_language_hint.yaml | 10 +-
...es_async.test_rotate_subscription_key.yaml | 24 +-
...ync.test_show_stats_and_model_version.yaml | 10 +-
...phrases_async.test_too_many_documents.yaml | 10 +-
...act_key_phrases_async.test_user_agent.yaml | 10 +-
...st_whole_batch_dont_use_language_hint.yaml | 10 +-
..._async.test_whole_batch_language_hint.yaml | 10 +-
...language_hint_and_dict_per_item_hints.yaml | 10 +-
...ole_batch_language_hint_and_obj_input.yaml | 10 +-
..._language_hint_and_obj_per_item_hints.yaml | 10 +-
...ties.test_all_successful_passing_dict.yaml | 8 +-
...uccessful_passing_text_document_input.yaml | 8 +-
...cognize_entities.test_bad_credentials.yaml | 4 +-
...entities.test_bad_model_version_error.yaml | 8 +-
...e_entities.test_batch_size_over_limit.yaml | 8 +-
...ties.test_batch_size_over_limit_error.yaml | 8 +-
...t_client_passed_default_language_hint.yaml | 32 ++-
...t_attribute_error_no_result_attribute.yaml | 6 +-
...attribute_error_nonexistent_attribute.yaml | 6 +-
...cognize_entities.test_document_errors.yaml | 10 +-
...gnize_entities.test_document_warnings.yaml | 8 +-
...ize_entities.test_duplicate_ids_error.yaml | 6 +-
..._entities.test_empty_credential_class.yaml | 4 +-
...e_entities.test_input_with_all_errors.yaml | 12 +-
..._entities.test_input_with_some_errors.yaml | 12 +-
...ities.test_invalid_language_hint_docs.yaml | 10 +-
...ies.test_invalid_language_hint_method.yaml | 12 +-
..._entities.test_language_kwarg_spanish.yaml | 10 +-
...ognize_entities.test_out_of_order_ids.yaml | 8 +-
...ities.test_output_same_order_as_input.yaml | 8 +-
...test_recognize_entities.test_pass_cls.yaml | 10 +-
...ize_entities.test_passing_only_string.yaml | 8 +-
....test_per_item_dont_use_language_hint.yaml | 8 +-
...entities.test_rotate_subscription_key.yaml | 20 +-
...ies.test_show_stats_and_model_version.yaml | 8 +-
...nize_entities.test_too_many_documents.yaml | 8 +-
...st_recognize_entities.test_user_agent.yaml | 8 +-
...st_whole_batch_dont_use_language_hint.yaml | 8 +-
...tities.test_whole_batch_language_hint.yaml | 8 +-
...language_hint_and_dict_per_item_hints.yaml | 11 +-
...ole_batch_language_hint_and_obj_input.yaml | 8 +-
..._language_hint_and_obj_per_item_hints.yaml | 16 +-
...sync.test_all_successful_passing_dict.yaml | 10 +-
...uccessful_passing_text_document_input.yaml | 10 +-
...e_entities_async.test_bad_credentials.yaml | 6 +-
...es_async.test_bad_model_version_error.yaml | 8 +-
...ties_async.test_batch_size_over_limit.yaml | 10 +-
...sync.test_batch_size_over_limit_error.yaml | 10 +-
...t_client_passed_default_language_hint.yaml | 38 +--
...t_attribute_error_no_result_attribute.yaml | 8 +-
...attribute_error_nonexistent_attribute.yaml | 10 +-
...e_entities_async.test_document_errors.yaml | 12 +-
...entities_async.test_document_warnings.yaml | 10 +-
...tities_async.test_duplicate_ids_error.yaml | 10 +-
...ies_async.test_empty_credential_class.yaml | 6 +-
...ties_async.test_input_with_all_errors.yaml | 12 +-
...ies_async.test_input_with_some_errors.yaml | 14 +-
...async.test_invalid_language_hint_docs.yaml | 14 +-
...ync.test_invalid_language_hint_method.yaml | 14 +-
...ies_async.test_language_kwarg_spanish.yaml | 12 +-
..._entities_async.test_out_of_order_ids.yaml | 10 +-
...async.test_output_same_order_as_input.yaml | 10 +-
...ecognize_entities_async.test_pass_cls.yaml | 12 +-
...tities_async.test_passing_only_string.yaml | 10 +-
....test_per_item_dont_use_language_hint.yaml | 10 +-
...es_async.test_rotate_subscription_key.yaml | 26 +-
...ync.test_show_stats_and_model_version.yaml | 10 +-
...ntities_async.test_too_many_documents.yaml | 10 +-
...ognize_entities_async.test_user_agent.yaml | 10 +-
...st_whole_batch_dont_use_language_hint.yaml | 10 +-
..._async.test_whole_batch_language_hint.yaml | 10 +-
...language_hint_and_dict_per_item_hints.yaml | 13 +-
...ole_batch_language_hint_and_obj_input.yaml | 10 +-
..._language_hint_and_obj_per_item_hints.yaml | 18 +-
...ties.test_all_successful_passing_dict.yaml | 8 +-
...uccessful_passing_text_document_input.yaml | 8 +-
..._linked_entities.test_bad_credentials.yaml | 4 +-
...entities.test_bad_model_version_error.yaml | 6 +-
...d_entities.test_batch_size_over_limit.yaml | 8 +-
...ties.test_batch_size_over_limit_error.yaml | 8 +-
...t_client_passed_default_language_hint.yaml | 24 +-
...t_attribute_error_no_result_attribute.yaml | 6 +-
...attribute_error_nonexistent_attribute.yaml | 6 +-
..._linked_entities.test_document_errors.yaml | 10 +-
...inked_entities.test_document_warnings.yaml | 8 +-
...ked_entities.test_duplicate_ids_error.yaml | 8 +-
..._entities.test_empty_credential_class.yaml | 4 +-
...d_entities.test_input_with_all_errors.yaml | 10 +-
..._entities.test_input_with_some_errors.yaml | 8 +-
...ities.test_invalid_language_hint_docs.yaml | 10 +-
...ies.test_invalid_language_hint_method.yaml | 12 +-
..._entities.test_language_kwarg_spanish.yaml | 8 +-
...linked_entities.test_out_of_order_ids.yaml | 8 +-
...ities.test_output_same_order_as_input.yaml | 8 +-
...cognize_linked_entities.test_pass_cls.yaml | 8 +-
...ked_entities.test_passing_only_string.yaml | 8 +-
....test_per_item_dont_use_language_hint.yaml | 6 +-
...entities.test_rotate_subscription_key.yaml | 20 +-
...ies.test_show_stats_and_model_version.yaml | 8 +-
...nked_entities.test_too_many_documents.yaml | 8 +-
...gnize_linked_entities.test_user_agent.yaml | 6 +-
...st_whole_batch_dont_use_language_hint.yaml | 8 +-
...tities.test_whole_batch_language_hint.yaml | 20 +-
...language_hint_and_dict_per_item_hints.yaml | 8 +-
...ole_batch_language_hint_and_obj_input.yaml | 18 +-
..._language_hint_and_obj_per_item_hints.yaml | 8 +-
...sync.test_all_successful_passing_dict.yaml | 10 +-
...uccessful_passing_text_document_input.yaml | 10 +-
...d_entities_async.test_bad_credentials.yaml | 6 +-
...es_async.test_bad_model_version_error.yaml | 8 +-
...ties_async.test_batch_size_over_limit.yaml | 8 +-
...sync.test_batch_size_over_limit_error.yaml | 10 +-
...t_client_passed_default_language_hint.yaml | 30 +-
...t_attribute_error_no_result_attribute.yaml | 8 +-
...attribute_error_nonexistent_attribute.yaml | 8 +-
...d_entities_async.test_document_errors.yaml | 14 +-
...entities_async.test_document_warnings.yaml | 10 +-
...tities_async.test_duplicate_ids_error.yaml | 10 +-
...ies_async.test_empty_credential_class.yaml | 6 +-
...ties_async.test_input_with_all_errors.yaml | 12 +-
...ies_async.test_input_with_some_errors.yaml | 10 +-
...async.test_invalid_language_hint_docs.yaml | 14 +-
...ync.test_invalid_language_hint_method.yaml | 12 +-
...ies_async.test_language_kwarg_spanish.yaml | 10 +-
..._entities_async.test_out_of_order_ids.yaml | 10 +-
...async.test_output_same_order_as_input.yaml | 10 +-
...e_linked_entities_async.test_pass_cls.yaml | 10 +-
...tities_async.test_passing_only_string.yaml | 10 +-
....test_per_item_dont_use_language_hint.yaml | 10 +-
...es_async.test_rotate_subscription_key.yaml | 26 +-
...ync.test_show_stats_and_model_version.yaml | 10 +-
...ntities_async.test_too_many_documents.yaml | 10 +-
...linked_entities_async.test_user_agent.yaml | 10 +-
...st_whole_batch_dont_use_language_hint.yaml | 10 +-
..._async.test_whole_batch_language_hint.yaml | 22 +-
...language_hint_and_dict_per_item_hints.yaml | 10 +-
...ole_batch_language_hint_and_obj_input.yaml | 22 +-
..._language_hint_and_obj_per_item_hints.yaml | 10 +-
...t_text_analytics.test_detect_language.yaml | 6 +-
.../tests/test_multiapi.py | 4 +-
.../tests/test_multiapi_async.py | 4 +-
349 files changed, 2878 insertions(+), 1737 deletions(-)
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_configuration.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_version.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/__init__.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_configuration_async.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin_async.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client_async.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/models.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/py.typed
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_metadata.json
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/_metadata.json
delete mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_multiapi.py
diff --git a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
index 82260740944b..ff0619621d9f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
+++ b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
@@ -2,6 +2,8 @@
## 5.0.1 (Unreleased)
+- We are now targeting the service's v3.1-preview.1 API as the default. If you would like to still use version v3.0 of the service,
+pass in `v3.0` to the kwarg `api_version` when creating your TextAnalyticsClient
## 5.0.0 (2020-07-27)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py
index 24df553f396d..aff577660a71 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py
@@ -6,7 +6,7 @@
from ._text_analytics_client import TextAnalyticsClient
from ._version import VERSION
-from ._multiapi import ApiVersion
+from ._base_client import ApiVersion
from ._models import (
DetectLanguageInput,
TextDocumentInput,
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py
index 3fe9927fbd0c..7f12d85dac71 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py
@@ -3,12 +3,19 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
-
+from enum import Enum
from azure.core.pipeline.policies import AzureKeyCredentialPolicy
from azure.core.credentials import AzureKeyCredential
+from ._generated import TextAnalyticsClient as _TextAnalyticsClient
from ._policies import TextAnalyticsResponseHookPolicy
from ._user_agent import USER_AGENT
-from ._multiapi import load_generated_api
+
+class ApiVersion(str, Enum):
+ """Text Analytics API versions supported by this package"""
+
+ #: this is the default version
+ V3_1_PREVIEW_1 = "v3.1-preview.1"
+ V3_0 = "v3.0"
def _authentication_policy(credential):
authentication_policy = None
@@ -26,11 +33,10 @@ def _authentication_policy(credential):
class TextAnalyticsClientBase(object):
def __init__(self, endpoint, credential, **kwargs):
- api_version = kwargs.pop("api_version", None)
- _TextAnalyticsClient = load_generated_api(api_version)
self._client = _TextAnalyticsClient(
endpoint=endpoint,
credential=credential,
+ api_version=kwargs.pop("api_version", ApiVersion.V3_1_PREVIEW_1),
sdk_moniker=USER_AGENT,
authentication_policy=_authentication_policy(credential),
custom_hook_policy=TextAnalyticsResponseHookPolicy(**kwargs),
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/__init__.py
index 8066e1dcc2fd..ca973ce68900 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/__init__.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/__init__.py
@@ -1,5 +1,16 @@
# coding=utf-8
-# ------------------------------------
-# Copyright (c) Microsoft Corporation.
-# Licensed under the MIT License.
-# ------------------------------------
\ No newline at end of file
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from ._text_analytics_client import TextAnalyticsClient
+__all__ = ['TextAnalyticsClient']
+
+try:
+ from ._patch import patch_sdk # type: ignore
+ patch_sdk()
+except ImportError:
+ pass
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_configuration.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_configuration.py
new file mode 100644
index 000000000000..9d8c2be5eb49
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_configuration.py
@@ -0,0 +1,66 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+from typing import Any
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+
+from ._version import VERSION
+
+
+class TextAnalyticsClientConfiguration(Configuration):
+ """Configuration for TextAnalyticsClient.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials.TokenCredential
+ :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
+ :type endpoint: str
+ """
+
+ def __init__(
+ self,
+ credential, # type: "TokenCredential"
+ endpoint, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ if credential is None:
+ raise ValueError("Parameter 'credential' must not be None.")
+ if endpoint is None:
+ raise ValueError("Parameter 'endpoint' must not be None.")
+ super(TextAnalyticsClientConfiguration, self).__init__(**kwargs)
+
+ self.credential = credential
+ self.endpoint = endpoint
+ self.credential_scopes = ['https://cognitiveservices.azure.com/.default']
+ self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
+ kwargs.setdefault('sdk_moniker', 'azure-ai-textanalytics/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
+ if self.credential and not self.authentication_policy:
+ self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py
new file mode 100644
index 000000000000..b54f150a56d9
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py
@@ -0,0 +1,270 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+from msrest import Serializer, Deserializer
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar
+
+
+class TextAnalyticsClientOperationsMixin(object):
+
+ def entities_linking(
+ self,
+ documents, # type: List["models.MultiLanguageInput"]
+ model_version=None, # type: Optional[str]
+ show_stats=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ """Linked entities from a well-known knowledge base.
+
+ The API returns a list of recognized entities with links to a well-known knowledge base. See
+ the :code:`Supported languages in Text Analytics API` for
+ the list of enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: EntityLinkingResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.EntityLinkingResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('entities_linking')
+ if api_version == 'v3.0':
+ from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from .v3_1_preview_1.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.entities_linking(documents, model_version, show_stats, **kwargs)
+
+ def entities_recognition_general(
+ self,
+ documents, # type: List["models.MultiLanguageInput"]
+ model_version=None, # type: Optional[str]
+ show_stats=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ """Named Entity Recognition.
+
+ The API returns a list of general named entities in a given document. For the list of supported
+ entity types, check :code:`Supported Entity Types in Text
+ Analytics API`. See the :code:`Supported languages in Text
+ Analytics API` for the list of enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: EntitiesResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.EntitiesResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('entities_recognition_general')
+ if api_version == 'v3.0':
+ from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from .v3_1_preview_1.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.entities_recognition_general(documents, model_version, show_stats, **kwargs)
+
+ def entities_recognition_pii(
+ self,
+ documents, # type: List["models.MultiLanguageInput"]
+ model_version=None, # type: Optional[str]
+ show_stats=None, # type: Optional[bool]
+ domain=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ """Entities containing personal information.
+
+ The API returns a list of entities with personal information (\"SSN\", \"Bank Account\" etc) in
+ the document. For the list of supported entity types, check :code:`Supported Entity Types in Text Analytics API`. See the
+ :code:`Supported languages in Text Analytics API` for the
+ list of enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :param domain: (Optional) if set to 'PHI', response will contain only PHI entities.
+ :type domain: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: EntitiesResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.EntitiesResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('entities_recognition_pii')
+ if api_version == 'v3.1-preview.1':
+ from .v3_1_preview_1.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.entities_recognition_pii(documents, model_version, show_stats, domain, **kwargs)
+
+ def key_phrases(
+ self,
+ documents, # type: List["models.MultiLanguageInput"]
+ model_version=None, # type: Optional[str]
+ show_stats=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ """Key Phrases.
+
+ The API returns a list of strings denoting the key phrases in the input text. See the :code:`Supported languages in Text Analytics API` for the list of
+ enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyPhraseResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.KeyPhraseResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('key_phrases')
+ if api_version == 'v3.0':
+ from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from .v3_1_preview_1.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.key_phrases(documents, model_version, show_stats, **kwargs)
+
+ def languages(
+ self,
+ documents, # type: List["models.LanguageInput"]
+ model_version=None, # type: Optional[str]
+ show_stats=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ """Detect Language.
+
+ The API returns the detected language and a numeric score between 0 and 1. Scores close to 1
+ indicate 100% certainty that the identified language is true. See the :code:`Supported languages in Text Analytics API` for the list of
+ enabled languages.
+
+ :param documents:
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: LanguageResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.LanguageResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('languages')
+ if api_version == 'v3.0':
+ from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from .v3_1_preview_1.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.languages(documents, model_version, show_stats, **kwargs)
+
+ def sentiment(
+ self,
+ documents, # type: List["models.MultiLanguageInput"]
+ model_version=None, # type: Optional[str]
+ show_stats=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ """Sentiment.
+
+ The API returns a sentiment prediction, as well as sentiment scores for each sentiment class
+ (Positive, Negative, and Neutral) for the document and each sentence within it. See the
+ :code:`Supported languages in Text Analytics API` for the
+ list of enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SentimentResponse, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.SentimentResponse
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('sentiment')
+ if api_version == 'v3.0':
+ from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from .v3_1_preview_1.operations import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.sentiment(documents, model_version, show_stats, **kwargs)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py
new file mode 100644
index 000000000000..3f15dad24caf
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py
@@ -0,0 +1,103 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from azure.core import PipelineClient
+from msrest import Serializer, Deserializer
+
+from azure.profiles import KnownProfiles, ProfileDefinition
+from azure.profiles.multiapiclient import MultiApiClientMixin
+from ._configuration import TextAnalyticsClientConfiguration
+from ._operations_mixin import TextAnalyticsClientOperationsMixin
+class _SDKClient(object):
+ def __init__(self, *args, **kwargs):
+ """This is a fake class to support current implemetation of MultiApiClientMixin."
+ Will be removed in final version of multiapi azure-core based client
+ """
+ pass
+
+class TextAnalyticsClient(TextAnalyticsClientOperationsMixin, MultiApiClientMixin, _SDKClient):
+ """The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview.
+
+ This ready contains multiple API versions, to help you deal with all of the Azure clouds
+ (Azure Stack, Azure Government, Azure China, etc.).
+ By default, it uses the latest API version available on public Azure.
+ For production, you should stick to a particular api-version and/or profile.
+ The profile sets a mapping between an operation group and its API version.
+ The api-version parameter sets the default API version if the operation
+ group is not described in the profile.
+
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials.TokenCredential
+ :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
+ :type endpoint: str
+ :param str api_version: API version to use if no profile is provided, or if
+ 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 = 'v3.0'
+ _PROFILE_TAG = "azure.ai.textanalytics.TextAnalyticsClient"
+ LATEST_PROFILE = ProfileDefinition({
+ _PROFILE_TAG: {
+ None: DEFAULT_API_VERSION,
+ }},
+ _PROFILE_TAG + " latest"
+ )
+
+ def __init__(
+ self,
+ credential, # type: "TokenCredential"
+ endpoint, # type: str
+ api_version=None,
+ profile=KnownProfiles.default,
+ **kwargs # type: Any
+ ):
+ if api_version == 'v3.0':
+ base_url = '{Endpoint}/text/analytics/v3.0'
+ elif api_version == 'v3.1-preview.1':
+ base_url = '{Endpoint}/text/analytics/v3.1-preview.1'
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs)
+ self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
+ super(TextAnalyticsClient, self).__init__(
+ api_version=api_version,
+ profile=profile
+ )
+
+ @classmethod
+ def _models_dict(cls, api_version):
+ return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
+
+ @classmethod
+ def models(cls, api_version=DEFAULT_API_VERSION):
+ """Module depends on the API version:
+
+ * v3.0: :mod:`v3_0.models`
+ * v3.1-preview.1: :mod:`v3_1_preview_1.models`
+ """
+ if api_version == 'v3.0':
+ from .v3_0 import models
+ return models
+ elif api_version == 'v3.1-preview.1':
+ from .v3_1_preview_1 import models
+ return models
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+
+ def close(self):
+ self._client.close()
+ def __enter__(self):
+ self._client.__enter__()
+ return self
+ def __exit__(self, *exc_details):
+ self._client.__exit__(*exc_details)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_version.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_version.py
new file mode 100644
index 000000000000..a30a458f8b5b
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_version.py
@@ -0,0 +1,8 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+VERSION = "0.1.0"
\ No newline at end of file
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/__init__.py
new file mode 100644
index 000000000000..ffe1820f1f27
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/__init__.py
@@ -0,0 +1,10 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from ._text_analytics_client_async import TextAnalyticsClient
+__all__ = ['TextAnalyticsClient']
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_configuration_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_configuration_async.py
new file mode 100644
index 000000000000..bb11db12b46f
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_configuration_async.py
@@ -0,0 +1,64 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+from typing import Any
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+
+from .._version import VERSION
+
+
+class TextAnalyticsClientConfiguration(Configuration):
+ """Configuration for TextAnalyticsClient.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
+ :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
+ :type endpoint: str
+ """
+
+ def __init__(
+ self,
+ credential, # type: "AsyncTokenCredential"
+ endpoint, # type: str
+ **kwargs # type: Any
+ ) -> None:
+ if credential is None:
+ raise ValueError("Parameter 'credential' must not be None.")
+ if endpoint is None:
+ raise ValueError("Parameter 'endpoint' must not be None.")
+ super(TextAnalyticsClientConfiguration, self).__init__(**kwargs)
+
+ self.credential = credential
+ self.endpoint = endpoint
+ self.credential_scopes = ['https://cognitiveservices.azure.com/.default']
+ self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
+ kwargs.setdefault('sdk_moniker', 'azure-ai-textanalytics/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
+ if self.credential and not self.authentication_policy:
+ self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin_async.py
new file mode 100644
index 000000000000..f0c0104f1145
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin_async.py
@@ -0,0 +1,266 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+from msrest import Serializer, Deserializer
+from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+
+
+class TextAnalyticsClientOperationsMixin(object):
+
+ async def entities_linking(
+ self,
+ documents: List["models.MultiLanguageInput"],
+ model_version: Optional[str] = None,
+ show_stats: Optional[bool] = None,
+ **kwargs
+ ) -> "models.EntityLinkingResult":
+ """Linked entities from a well-known knowledge base.
+
+ The API returns a list of recognized entities with links to a well-known knowledge base. See
+ the :code:`Supported languages in Text Analytics API` for
+ the list of enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: EntityLinkingResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.EntityLinkingResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('entities_linking')
+ if api_version == 'v3.0':
+ from ..v3_0.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from ..v3_1_preview_1.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.entities_linking(documents, model_version, show_stats, **kwargs)
+
+ async def entities_recognition_general(
+ self,
+ documents: List["models.MultiLanguageInput"],
+ model_version: Optional[str] = None,
+ show_stats: Optional[bool] = None,
+ **kwargs
+ ) -> "models.EntitiesResult":
+ """Named Entity Recognition.
+
+ The API returns a list of general named entities in a given document. For the list of supported
+ entity types, check :code:`Supported Entity Types in Text
+ Analytics API`. See the :code:`Supported languages in Text
+ Analytics API` for the list of enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: EntitiesResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.EntitiesResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('entities_recognition_general')
+ if api_version == 'v3.0':
+ from ..v3_0.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from ..v3_1_preview_1.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.entities_recognition_general(documents, model_version, show_stats, **kwargs)
+
+ async def entities_recognition_pii(
+ self,
+ documents: List["models.MultiLanguageInput"],
+ model_version: Optional[str] = None,
+ show_stats: Optional[bool] = None,
+ domain: Optional[str] = None,
+ **kwargs
+ ) -> "models.EntitiesResult":
+ """Entities containing personal information.
+
+ The API returns a list of entities with personal information (\"SSN\", \"Bank Account\" etc) in
+ the document. For the list of supported entity types, check :code:`Supported Entity Types in Text Analytics API`. See the
+ :code:`Supported languages in Text Analytics API` for the
+ list of enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :param domain: (Optional) if set to 'PHI', response will contain only PHI entities.
+ :type domain: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: EntitiesResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.EntitiesResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('entities_recognition_pii')
+ if api_version == 'v3.1-preview.1':
+ from ..v3_1_preview_1.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.entities_recognition_pii(documents, model_version, show_stats, domain, **kwargs)
+
+ async def key_phrases(
+ self,
+ documents: List["models.MultiLanguageInput"],
+ model_version: Optional[str] = None,
+ show_stats: Optional[bool] = None,
+ **kwargs
+ ) -> "models.KeyPhraseResult":
+ """Key Phrases.
+
+ The API returns a list of strings denoting the key phrases in the input text. See the :code:`Supported languages in Text Analytics API` for the list of
+ enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyPhraseResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.KeyPhraseResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('key_phrases')
+ if api_version == 'v3.0':
+ from ..v3_0.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from ..v3_1_preview_1.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.key_phrases(documents, model_version, show_stats, **kwargs)
+
+ async def languages(
+ self,
+ documents: List["models.LanguageInput"],
+ model_version: Optional[str] = None,
+ show_stats: Optional[bool] = None,
+ **kwargs
+ ) -> "models.LanguageResult":
+ """Detect Language.
+
+ The API returns the detected language and a numeric score between 0 and 1. Scores close to 1
+ indicate 100% certainty that the identified language is true. See the :code:`Supported languages in Text Analytics API` for the list of
+ enabled languages.
+
+ :param documents:
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: LanguageResult, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.LanguageResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('languages')
+ if api_version == 'v3.0':
+ from ..v3_0.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from ..v3_1_preview_1.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.languages(documents, model_version, show_stats, **kwargs)
+
+ async def sentiment(
+ self,
+ documents: List["models.MultiLanguageInput"],
+ model_version: Optional[str] = None,
+ show_stats: Optional[bool] = None,
+ **kwargs
+ ) -> "models.SentimentResponse":
+ """Sentiment.
+
+ The API returns a sentiment prediction, as well as sentiment scores for each sentiment class
+ (Positive, Negative, and Neutral) for the document and each sentence within it. See the
+ :code:`Supported languages in Text Analytics API` for the
+ list of enabled languages.
+
+ :param documents: The set of documents to process as part of this batch.
+ :type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]
+ :param model_version: (Optional) This value indicates which model will be used for scoring. If
+ a model-version is not specified, the API should default to the latest, non-preview version.
+ :type model_version: str
+ :param show_stats: (Optional) if set to true, response will contain input and document level
+ statistics.
+ :type show_stats: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SentimentResponse, or the result of cls(response)
+ :rtype: ~azure.ai.textanalytics.v3_0.models.SentimentResponse
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('sentiment')
+ if api_version == 'v3.0':
+ from ..v3_0.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ elif api_version == 'v3.1-preview.1':
+ from ..v3_1_preview_1.aio.operations_async import TextAnalyticsClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.sentiment(documents, model_version, show_stats, **kwargs)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client_async.py
new file mode 100644
index 000000000000..6637fb76e151
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client_async.py
@@ -0,0 +1,103 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from azure.core import AsyncPipelineClient
+from msrest import Serializer, Deserializer
+
+from azure.profiles import KnownProfiles, ProfileDefinition
+from azure.profiles.multiapiclient import MultiApiClientMixin
+from ._configuration_async import TextAnalyticsClientConfiguration
+from ._operations_mixin_async import TextAnalyticsClientOperationsMixin
+class _SDKClient(object):
+ def __init__(self, *args, **kwargs):
+ """This is a fake class to support current implemetation of MultiApiClientMixin."
+ Will be removed in final version of multiapi azure-core based client
+ """
+ pass
+
+class TextAnalyticsClient(TextAnalyticsClientOperationsMixin, MultiApiClientMixin, _SDKClient):
+ """The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview.
+
+ This ready contains multiple API versions, to help you deal with all of the Azure clouds
+ (Azure Stack, Azure Government, Azure China, etc.).
+ By default, it uses the latest API version available on public Azure.
+ For production, you should stick to a particular api-version and/or profile.
+ The profile sets a mapping between an operation group and its API version.
+ The api-version parameter sets the default API version if the operation
+ group is not described in the profile.
+
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
+ :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
+ :type endpoint: str
+ :param str api_version: API version to use if no profile is provided, or if
+ 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 = 'v3.0'
+ _PROFILE_TAG = "azure.ai.textanalytics.TextAnalyticsClient"
+ LATEST_PROFILE = ProfileDefinition({
+ _PROFILE_TAG: {
+ None: DEFAULT_API_VERSION,
+ }},
+ _PROFILE_TAG + " latest"
+ )
+
+ def __init__(
+ self,
+ credential, # type: "AsyncTokenCredential"
+ endpoint, # type: str
+ api_version=None,
+ profile=KnownProfiles.default,
+ **kwargs # type: Any
+ ) -> None:
+ if api_version == 'v3.0':
+ base_url = '{Endpoint}/text/analytics/v3.0'
+ elif api_version == 'v3.1-preview.1':
+ base_url = '{Endpoint}/text/analytics/v3.1-preview.1'
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs)
+ self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)
+ super(TextAnalyticsClient, self).__init__(
+ api_version=api_version,
+ profile=profile
+ )
+
+ @classmethod
+ def _models_dict(cls, api_version):
+ return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
+
+ @classmethod
+ def models(cls, api_version=DEFAULT_API_VERSION):
+ """Module depends on the API version:
+
+ * v3.0: :mod:`v3_0.models`
+ * v3.1-preview.1: :mod:`v3_1_preview_1.models`
+ """
+ if api_version == 'v3.0':
+ from ..v3_0 import models
+ return models
+ elif api_version == 'v3.1-preview.1':
+ from ..v3_1_preview_1 import models
+ return models
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+
+ async def close(self):
+ await self._client.close()
+ async def __aenter__(self):
+ await self._client.__aenter__()
+ return self
+ async def __aexit__(self, *exc_details):
+ await self._client.__aexit__(*exc_details)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/models.py
new file mode 100644
index 000000000000..2a2491bad85a
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/models.py
@@ -0,0 +1,7 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from .v3_0.models import *
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/py.typed b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/py.typed
new file mode 100644
index 000000000000..e5aff4f83af8
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_metadata.json b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_metadata.json
new file mode 100644
index 000000000000..c3506558ce44
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_metadata.json
@@ -0,0 +1,117 @@
+{
+ "chosen_version": "v3.0",
+ "total_api_version_list": ["v3.0"],
+ "client": {
+ "name": "TextAnalyticsClient",
+ "filename": "_text_analytics_client",
+ "description": "The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview.",
+ "base_url": null,
+ "custom_base_url": "\u0027{Endpoint}/text/analytics/v3.0\u0027",
+ "azure_arm": false
+ },
+ "global_parameters": {
+ "sync_method": {
+ "credential": {
+ "method_signature": "credential, # type: \"TokenCredential\"",
+ "description": "Credential needed for the client to connect to Azure.",
+ "docstring_type": "~azure.core.credentials.TokenCredential",
+ "required": true
+ },
+ "endpoint": {
+ "method_signature": "endpoint, # type: str",
+ "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).",
+ "docstring_type": "str",
+ "required": true
+ }
+ },
+ "async_method": {
+ "credential": {
+ "method_signature": "credential, # type: \"AsyncTokenCredential\"",
+ "description": "Credential needed for the client to connect to Azure.",
+ "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
+ "required": true
+ },
+ "endpoint": {
+ "method_signature": "endpoint, # type: str",
+ "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).",
+ "docstring_type": "str",
+ "required": true
+ }
+ },
+ "constant": {
+ },
+ "call": "credential, endpoint"
+ },
+ "config": {
+ "credential": true,
+ "credential_scopes": ["https://cognitiveservices.azure.com/.default"],
+ "credential_default_policy_type": "BearerTokenCredentialPolicy",
+ "credential_default_policy_type_has_async_version": true
+ },
+ "operation_groups": {
+ },
+ "operation_mixins": {
+ "entities_recognition_general" : {
+ "sync": {
+ "signature": "def entities_recognition_general(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Named Entity Recognition.\n\nThe API returns a list of general named entities in a given document. For the list of supported\nentity types, check :code:`\u003ca href=\"https://aka.ms/taner\"\u003eSupported Entity Types in Text\nAnalytics API\u003c/a\u003e`. See the :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text\nAnalytics API\u003c/a\u003e` for the list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def entities_recognition_general(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.EntitiesResult\":\n",
+ "doc": "\"\"\"Named Entity Recognition.\n\nThe API returns a list of general named entities in a given document. For the list of supported\nentity types, check :code:`\u003ca href=\"https://aka.ms/taner\"\u003eSupported Entity Types in Text\nAnalytics API\u003c/a\u003e`. See the :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text\nAnalytics API\u003c/a\u003e` for the list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ },
+ "entities_linking" : {
+ "sync": {
+ "signature": "def entities_linking(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Linked entities from a well-known knowledge base.\n\nThe API returns a list of recognized entities with links to a well-known knowledge base. See\nthe :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for\nthe list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntityLinkingResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def entities_linking(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.EntityLinkingResult\":\n",
+ "doc": "\"\"\"Linked entities from a well-known knowledge base.\n\nThe API returns a list of recognized entities with links to a well-known knowledge base. See\nthe :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for\nthe list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntityLinkingResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ },
+ "key_phrases" : {
+ "sync": {
+ "signature": "def key_phrases(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Key Phrases.\n\nThe API returns a list of strings denoting the key phrases in the input text. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyPhraseResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def key_phrases(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.KeyPhraseResult\":\n",
+ "doc": "\"\"\"Key Phrases.\n\nThe API returns a list of strings denoting the key phrases in the input text. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyPhraseResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ },
+ "languages" : {
+ "sync": {
+ "signature": "def languages(\n self,\n documents, # type: List[\"models.LanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Detect Language.\n\nThe API returns the detected language and a numeric score between 0 and 1. Scores close to 1\nindicate 100% certainty that the identified language is true. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents:\n:type documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LanguageResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def languages(\n self,\n documents: List[\"models.LanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.LanguageResult\":\n",
+ "doc": "\"\"\"Detect Language.\n\nThe API returns the detected language and a numeric score between 0 and 1. Scores close to 1\nindicate 100% certainty that the identified language is true. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents:\n:type documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LanguageResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ },
+ "sentiment" : {
+ "sync": {
+ "signature": "def sentiment(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Sentiment.\n\nThe API returns a sentiment prediction, as well as sentiment scores for each sentiment class\n(Positive, Negative, and Neutral) for the document and each sentence within it. See the\n:code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the\nlist of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SentimentResponse, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def sentiment(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.SentimentResponse\":\n",
+ "doc": "\"\"\"Sentiment.\n\nThe API returns a sentiment prediction, as well as sentiment scores for each sentiment class\n(Positive, Negative, and Neutral) for the document and each sentence within it. See the\n:code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the\nlist of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SentimentResponse, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ }
+ },
+ "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\"]}}}",
+ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\"]}}}"
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models.py
index fb1572c0fca8..8ff54b7760c3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models.py
@@ -832,7 +832,7 @@ class SentenceSentiment(msrest.serialization.Model):
All required parameters must be populated in order to send to Azure.
- :param text: The sentence text.
+ :param text: Required. The sentence text.
:type text: str
:param sentiment: Required. The predicted Sentiment for the sentence. Possible values include:
"positive", "neutral", "negative".
@@ -847,6 +847,7 @@ class SentenceSentiment(msrest.serialization.Model):
"""
_validation = {
+ 'text': {'required': True},
'sentiment': {'required': True},
'confidence_scores': {'required': True},
'offset': {'required': True},
@@ -866,7 +867,7 @@ def __init__(
**kwargs
):
super(SentenceSentiment, self).__init__(**kwargs)
- self.text = kwargs.get('text', None)
+ self.text = kwargs['text']
self.sentiment = kwargs['sentiment']
self.confidence_scores = kwargs['confidence_scores']
self.offset = kwargs['offset']
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py
index e00be3e2a7e8..80c27057d5b6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py
@@ -935,7 +935,7 @@ class SentenceSentiment(msrest.serialization.Model):
All required parameters must be populated in order to send to Azure.
- :param text: The sentence text.
+ :param text: Required. The sentence text.
:type text: str
:param sentiment: Required. The predicted Sentiment for the sentence. Possible values include:
"positive", "neutral", "negative".
@@ -950,6 +950,7 @@ class SentenceSentiment(msrest.serialization.Model):
"""
_validation = {
+ 'text': {'required': True},
'sentiment': {'required': True},
'confidence_scores': {'required': True},
'offset': {'required': True},
@@ -967,11 +968,11 @@ class SentenceSentiment(msrest.serialization.Model):
def __init__(
self,
*,
+ text: str,
sentiment: Union[str, "SentenceSentimentValue"],
confidence_scores: "SentimentConfidenceScorePerLabel",
offset: int,
length: int,
- text: Optional[str] = None,
**kwargs
):
super(SentenceSentiment, self).__init__(**kwargs)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/_metadata.json b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/_metadata.json
new file mode 100644
index 000000000000..f4ef29b8cd43
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/_metadata.json
@@ -0,0 +1,129 @@
+{
+ "chosen_version": "v3.1-preview.1",
+ "total_api_version_list": ["v3.1-preview.1"],
+ "client": {
+ "name": "TextAnalyticsClient",
+ "filename": "_text_analytics_client",
+ "description": "The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview.",
+ "base_url": null,
+ "custom_base_url": "\u0027{Endpoint}/text/analytics/v3.1-preview.1\u0027",
+ "azure_arm": false
+ },
+ "global_parameters": {
+ "sync_method": {
+ "credential": {
+ "method_signature": "credential, # type: \"TokenCredential\"",
+ "description": "Credential needed for the client to connect to Azure.",
+ "docstring_type": "~azure.core.credentials.TokenCredential",
+ "required": true
+ },
+ "endpoint": {
+ "method_signature": "endpoint, # type: str",
+ "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).",
+ "docstring_type": "str",
+ "required": true
+ }
+ },
+ "async_method": {
+ "credential": {
+ "method_signature": "credential, # type: \"AsyncTokenCredential\"",
+ "description": "Credential needed for the client to connect to Azure.",
+ "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
+ "required": true
+ },
+ "endpoint": {
+ "method_signature": "endpoint, # type: str",
+ "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).",
+ "docstring_type": "str",
+ "required": true
+ }
+ },
+ "constant": {
+ },
+ "call": "credential, endpoint"
+ },
+ "config": {
+ "credential": true,
+ "credential_scopes": ["https://cognitiveservices.azure.com/.default"],
+ "credential_default_policy_type": "BearerTokenCredentialPolicy",
+ "credential_default_policy_type_has_async_version": true
+ },
+ "operation_groups": {
+ },
+ "operation_mixins": {
+ "entities_recognition_general" : {
+ "sync": {
+ "signature": "def entities_recognition_general(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Named Entity Recognition.\n\nThe API returns a list of general named entities in a given document. For the list of supported\nentity types, check :code:`\u003ca href=\"https://aka.ms/taner\"\u003eSupported Entity Types in Text\nAnalytics API\u003c/a\u003e`. See the :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text\nAnalytics API\u003c/a\u003e` for the list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def entities_recognition_general(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.EntitiesResult\":\n",
+ "doc": "\"\"\"Named Entity Recognition.\n\nThe API returns a list of general named entities in a given document. For the list of supported\nentity types, check :code:`\u003ca href=\"https://aka.ms/taner\"\u003eSupported Entity Types in Text\nAnalytics API\u003c/a\u003e`. See the :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text\nAnalytics API\u003c/a\u003e` for the list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ },
+ "entities_recognition_pii" : {
+ "sync": {
+ "signature": "def entities_recognition_pii(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n domain=None, # type: Optional[str]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Entities containing personal information.\n\nThe API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in\nthe document. For the list of supported entity types, check :code:`\u003ca\nhref=\"https://aka.ms/tanerpii\"\u003eSupported Entity Types in Text Analytics API\u003c/a\u003e`. See the\n:code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the\nlist of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:param domain: (Optional) if set to \u0027PHI\u0027, response will contain only PHI entities.\n:type domain: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def entities_recognition_pii(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n domain: Optional[str] = None,\n **kwargs\n) -\u003e \"models.EntitiesResult\":\n",
+ "doc": "\"\"\"Entities containing personal information.\n\nThe API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in\nthe document. For the list of supported entity types, check :code:`\u003ca\nhref=\"https://aka.ms/tanerpii\"\u003eSupported Entity Types in Text Analytics API\u003c/a\u003e`. See the\n:code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the\nlist of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:param domain: (Optional) if set to \u0027PHI\u0027, response will contain only PHI entities.\n:type domain: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats, domain"
+ },
+ "entities_linking" : {
+ "sync": {
+ "signature": "def entities_linking(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Linked entities from a well-known knowledge base.\n\nThe API returns a list of recognized entities with links to a well-known knowledge base. See\nthe :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for\nthe list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntityLinkingResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def entities_linking(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.EntityLinkingResult\":\n",
+ "doc": "\"\"\"Linked entities from a well-known knowledge base.\n\nThe API returns a list of recognized entities with links to a well-known knowledge base. See\nthe :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for\nthe list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntityLinkingResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ },
+ "key_phrases" : {
+ "sync": {
+ "signature": "def key_phrases(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Key Phrases.\n\nThe API returns a list of strings denoting the key phrases in the input text. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyPhraseResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def key_phrases(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.KeyPhraseResult\":\n",
+ "doc": "\"\"\"Key Phrases.\n\nThe API returns a list of strings denoting the key phrases in the input text. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyPhraseResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ },
+ "languages" : {
+ "sync": {
+ "signature": "def languages(\n self,\n documents, # type: List[\"models.LanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Detect Language.\n\nThe API returns the detected language and a numeric score between 0 and 1. Scores close to 1\nindicate 100% certainty that the identified language is true. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents:\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.LanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LanguageResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def languages(\n self,\n documents: List[\"models.LanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.LanguageResult\":\n",
+ "doc": "\"\"\"Detect Language.\n\nThe API returns the detected language and a numeric score between 0 and 1. Scores close to 1\nindicate 100% certainty that the identified language is true. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents:\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.LanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LanguageResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats"
+ },
+ "sentiment" : {
+ "sync": {
+ "signature": "def sentiment(\n self,\n documents, # type: List[\"models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n opinion_mining=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Sentiment.\n\nThe API returns a detailed sentiment analysis for the input text. The analysis is done in\nmultiple levels of granularity, start from the a document level, down to sentence and key terms\n(aspects) and opinions.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:param opinion_mining: (Optional) if set to true, response will contain input and document\n level statistics including aspect-based sentiment analysis results.\n:type opinion_mining: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SentimentResponse, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def sentiment(\n self,\n documents: List[\"models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n opinion_mining: Optional[bool] = None,\n **kwargs\n) -\u003e \"models.SentimentResponse\":\n",
+ "doc": "\"\"\"Sentiment.\n\nThe API returns a detailed sentiment analysis for the input text. The analysis is done in\nmultiple levels of granularity, start from the a document level, down to sentence and key terms\n(aspects) and opinions.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_1.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain input and document level\n statistics.\n:type show_stats: bool\n:param opinion_mining: (Optional) if set to true, response will contain input and document\n level statistics including aspect-based sentiment analysis results.\n:type opinion_mining: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SentimentResponse, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_1.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "documents, model_version, show_stats, opinion_mining"
+ }
+ },
+ "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\"]}}}",
+ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\"]}}}"
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/models/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/models/_models.py
index 30ba7a3aca58..b410706fa998 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/models/_models.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/models/_models.py
@@ -226,8 +226,8 @@ class DocumentLanguage(msrest.serialization.Model):
:param id: Required. Unique, non-empty document identifier.
:type id: str
- :param detected_languages: Required. A list of extracted languages.
- :type detected_languages: list[~azure.ai.textanalytics.v3_1_preview_1.models.DetectedLanguage]
+ :param detected_language: Required. Detected Language.
+ :type detected_language: ~azure.ai.textanalytics.v3_1_preview_1.models.DetectedLanguage
:param warnings: Required. Warnings encountered while processing document.
:type warnings: list[~azure.ai.textanalytics.v3_1_preview_1.models.TextAnalyticsWarning]
:param statistics: if showStats=true was specified in the request this field will contain
@@ -237,13 +237,13 @@ class DocumentLanguage(msrest.serialization.Model):
_validation = {
'id': {'required': True},
- 'detected_languages': {'required': True},
+ 'detected_language': {'required': True},
'warnings': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
- 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'},
+ 'detected_language': {'key': 'detectedLanguage', 'type': 'DetectedLanguage'},
'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'},
'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'},
}
@@ -254,7 +254,7 @@ def __init__(
):
super(DocumentLanguage, self).__init__(**kwargs)
self.id = kwargs['id']
- self.detected_languages = kwargs['detected_languages']
+ self.detected_language = kwargs['detected_language']
self.warnings = kwargs['warnings']
self.statistics = kwargs.get('statistics', None)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/models/_models_py3.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/models/_models_py3.py
index 26b402385095..34603e0aa18e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/models/_models_py3.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_1/models/_models_py3.py
@@ -253,8 +253,8 @@ class DocumentLanguage(msrest.serialization.Model):
:param id: Required. Unique, non-empty document identifier.
:type id: str
- :param detected_languages: Required. A list of extracted languages.
- :type detected_languages: list[~azure.ai.textanalytics.v3_1_preview_1.models.DetectedLanguage]
+ :param detected_language: Required. Detected Language.
+ :type detected_language: ~azure.ai.textanalytics.v3_1_preview_1.models.DetectedLanguage
:param warnings: Required. Warnings encountered while processing document.
:type warnings: list[~azure.ai.textanalytics.v3_1_preview_1.models.TextAnalyticsWarning]
:param statistics: if showStats=true was specified in the request this field will contain
@@ -264,13 +264,13 @@ class DocumentLanguage(msrest.serialization.Model):
_validation = {
'id': {'required': True},
- 'detected_languages': {'required': True},
+ 'detected_language': {'required': True},
'warnings': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
- 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'},
+ 'detected_language': {'key': 'detectedLanguage', 'type': 'DetectedLanguage'},
'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'},
'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'},
}
@@ -279,14 +279,14 @@ def __init__(
self,
*,
id: str,
- detected_languages: List["DetectedLanguage"],
+ detected_language: "DetectedLanguage",
warnings: List["TextAnalyticsWarning"],
statistics: Optional["DocumentStatistics"] = None,
**kwargs
):
super(DocumentLanguage, self).__init__(**kwargs)
self.id = id
- self.detected_languages = detected_languages
+ self.detected_language = detected_language
self.warnings = warnings
self.statistics = statistics
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_multiapi.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_multiapi.py
deleted file mode 100644
index c3d1f548a989..000000000000
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_multiapi.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# ------------------------------------
-# Copyright (c) Microsoft Corporation.
-# Licensed under the MIT License.
-# ------------------------------------
-from enum import Enum
-from typing import TYPE_CHECKING
-
-if TYPE_CHECKING:
- from typing import Union
-
-
-class ApiVersion(str, Enum):
- """Text Analytics API versions supported by this package"""
-
- #: this is the default version
- V3_1_preview_1 = "v3.1-preview.1"
- V3_0 = "v3.0"
-
-
-DEFAULT_VERSION = ApiVersion.V3_0
-
-
-def load_generated_api(api_version, aio=False):
- api_version = api_version or DEFAULT_VERSION
- try:
- # api_version could be a string; map it to an instance of ApiVersion
- # (this is a no-op if it's already an instance of ApiVersion)
- api_version = ApiVersion(api_version)
- except ValueError:
- # api_version is unknown to ApiVersion
- raise NotImplementedError(
- "This package doesn't support API version '{}'. ".format(api_version)
- + "Supported versions: {}".format(", ".join(v.value for v in ApiVersion))
- )
-
- if api_version == ApiVersion.V3_1_preview_1:
- if aio:
- from ._generated.v3_1_preview_1.aio import TextAnalyticsClient
- else:
- from ._generated.v3_1_preview_1 import TextAnalyticsClient # type: ignore
- elif api_version == ApiVersion.V3_0:
- if aio:
- from ._generated.v3_0.aio import TextAnalyticsClient # type: ignore
- else:
- from ._generated.v3_0 import TextAnalyticsClient # type: ignore
- return TextAnalyticsClient
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py
index 753802047992..63f289e810ac 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py
@@ -6,9 +6,10 @@
from typing import Any
from azure.core.credentials import AzureKeyCredential
from azure.core.pipeline.policies import AzureKeyCredentialPolicy
+from .._generated.aio import TextAnalyticsClient as _TextAnalyticsClient
from .._policies import TextAnalyticsResponseHookPolicy
from .._user_agent import USER_AGENT
-from .._multiapi import load_generated_api
+from .._base_client import ApiVersion
def _authentication_policy(credential):
@@ -27,11 +28,10 @@ def _authentication_policy(credential):
class AsyncTextAnalyticsClientBase(object):
def __init__(self, endpoint, credential, **kwargs):
- api_version = kwargs.pop("api_version", None)
- _TextAnalyticsClient = load_generated_api(api_version, aio=True)
self._client = _TextAnalyticsClient(
endpoint=endpoint,
credential=credential,
+ api_version=kwargs.pop("api_version", ApiVersion.V3_1_PREVIEW_1),
sdk_moniker=USER_AGENT,
authentication_policy=_authentication_policy(credential),
custom_hook_policy=TextAnalyticsResponseHookPolicy(**kwargs),
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_all_successful_passing_dict.yaml
index c66291002dd9..4f57d94b3520 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_all_successful_passing_dict.yaml
@@ -19,7 +19,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=true
response:
body:
string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","sentiment":"neutral","statistics":{"charactersCount":51,"transactionsCount":1},"confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"offset":0,"length":51,"text":"Microsoft
@@ -30,13 +30,13 @@ interactions:
recommend you try it."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 06e7a065-3f22-4c07-a34d-fe9df28bf145
+ - ae5d92ce-b260-4d5b-b049-ca5685d10a6b
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:32 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -44,7 +44,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '83'
+ - '91'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_all_successful_passing_text_document_input.yaml
index 70d5c445ba66..91a92e24fee0 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_all_successful_passing_text_document_input.yaml
@@ -19,7 +19,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"offset":0,"length":51,"text":"Microsoft
@@ -30,13 +30,13 @@ interactions:
recommend you try it."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 588a761e-eb90-4099-921a-79ba72a639e7
+ - 5866ad77-79e5-4d72-ac8a-0c238d7ac7bd
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -44,7 +44,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '82'
+ - '107'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_bad_credentials.yaml
index e8d31fb2672e..221740d916e8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_bad_credentials.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_bad_model_version_error.yaml
index cef850e3de64..0eb032cb1367 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_bad_model_version_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2019-10-01,2020-04-01"}}}'
headers:
apim-request-id:
- - 20895e3e-f7cd-4cbb-a200-6384531a6aad
+ - d1b9044a-2cb3-42e1-b76a-d9b2954cacf1
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '9'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_batch_size_over_limit.yaml
index d165bd58dd7b..1939e946e79a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_batch_size_over_limit.yaml
@@ -760,18 +760,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - b9e3966b-355a-4feb-a21a-74793021f522
+ - 445231d6-240b-40ae-97c6-07a9ff798851
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -779,7 +779,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '14'
+ - '12'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_batch_size_over_limit_error.yaml
index ae0d701f176b..3210054faa25 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_batch_size_over_limit_error.yaml
@@ -725,18 +725,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - 8f9e2336-979c-4d5d-a2cc-a7cce506e4e8
+ - d7d79d04-f475-40ff-a5c1-4761cdac974a
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -744,7 +744,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '13'
+ - '11'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_client_passed_default_language_hint.yaml
index 206288db44a8..716d3aea0a58 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_client_passed_default_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_client_passed_default_language_hint.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -27,13 +27,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 31654ab2-9d20-44d7-8a32-27bed4d42ee7
+ - 34ec0818-4419-460d-ab51-f2849b662a9c
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '108'
+ - '112'
status:
code: 200
message: OK
@@ -64,7 +64,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -73,13 +73,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 69099214-9e2b-4e78-ad55-75422bce9fa2
+ - abff6a6e-dbc7-474f-ae86-a102c0dfb090
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -87,7 +87,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '88'
+ - '98'
status:
code: 200
message: OK
@@ -110,7 +110,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -119,13 +119,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 100b38e5-f6d9-430c-97f5-347d77c72be5
+ - 3358cc30-05f2-41cf-8db1-6439f50e4013
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -133,7 +133,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '114'
+ - '105'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_attribute_error_no_result_attribute.yaml
index e5ded4d1af9e..2810435be210 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_attribute_error_no_result_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,11 +23,11 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 6a7b6796-dcf1-4521-b4c7-d025565fbe63
+ - 42b48b6b-82af-4009-9fce-6e4b0aa84164
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '2'
+ - '229'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_attribute_error_nonexistent_attribute.yaml
index 961b251eab5f..478a27992e63 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_attribute_error_nonexistent_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,11 +23,11 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - ac88c327-e418-4e3c-9a7f-550ed485c1f1
+ - a9c831ec-f52b-48ae-b6c4-4c2c1009c948
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:35 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '2'
+ - '3'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_errors.yaml
index 015556d4b6c7..9f08bfcc9e2e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_errors.yaml
@@ -18,25 +18,25 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"A
document within the request was too large to be processed. Limit document
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 5f204711-42a5-4c7e-8395-85bb08a3446b
+ - 6fb01711-e54c-4d31-ac5c-31090c70d477
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_warnings.yaml
index 83590bb08296..504443cdef4b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_document_warnings.yaml
@@ -16,20 +16,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"offset":0,"length":40,"text":"This
won''t actually create a warning :''("}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 893a26f5-095d-4703-a8e0-b249e61eaccb
+ - a629bb87-c4d0-4834-8137-5022ecd0f326
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -37,7 +37,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '101'
+ - '341'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_duplicate_ids_error.yaml
index ee8af084e3af..030f80bdfe67 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_duplicate_ids_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
apim-request-id:
- - 79b2dec0-d8a3-44f4-b6d1-20f473671bde
+ - 7bf2cc9c-f7e4-4b28-87ab-9e18fc41757c
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '10'
+ - '5'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_empty_credential_class.yaml
index 3cffa3d699d5..1cabeef25689 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_empty_credential_class.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_input_with_all_errors.yaml
index 936566cefdc9..8c7c87ed7099 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_input_with_all_errors.yaml
@@ -17,23 +17,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 2ef6aa08-38bb-4579-bbfb-9c80b9e01e79
+ - e97267c2-7f30-4c2c-893c-8256c81626eb
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '5'
+ - '2'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_input_with_some_errors.yaml
index 43fb05a4c023..55ed4a7e8275 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_input_with_some_errors.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"3","sentiment":"positive","confidenceScores":{"positive":0.98,"neutral":0.02,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The
@@ -26,17 +26,17 @@ interactions:
recommend you try it."}],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 79faf6dc-a3e6-46aa-a954-f94673e7436f
+ - 8064c457-a71f-4406-bb38-07733225f402
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -44,7 +44,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '156'
+ - '98'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_invalid_language_hint_docs.yaml
index b94b356062c1..2d99da88294e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_invalid_language_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_invalid_language_hint_docs.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 245b0af4-f07c-4dba-85ce-189dd5f40fe9
+ - 6034c272-f384-4c3d-8bbb-f3e7157bd252
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_invalid_language_hint_method.yaml
index a9a645aa7565..1e7e6476273d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_invalid_language_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_invalid_language_hint_method.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - cc961f2b-2bc6-42a0-89bb-62a5df399e25
+ - ed3802cd-6a0a-4221-bb50-ba8aeb9634e3
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_language_kwarg_spanish.yaml
index a3888183be97..87255bd8f785 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_language_kwarg_spanish.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_language_kwarg_spanish.yaml
@@ -16,20 +16,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","sentiment":"neutral","statistics":{"charactersCount":35,"transactionsCount":1},"confidenceScores":{"positive":0.01,"neutral":0.98,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.98,"negative":0.01},"offset":0,"length":35,"text":"Bill
Gates is the CEO of Microsoft."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 77e266f2-c996-475a-912f-af9168ebcff8
+ - 3280fcc8-7534-44a2-9502-1f795ddb11d7
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 17:51:18 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -37,7 +37,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '90'
+ - '198'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_out_of_order_ids.yaml
index 1d27b967f00c..3914b133b687 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_out_of_order_ids.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"56","sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"offset":0,"length":2,"text":":)"}],"warnings":[]},{"id":"0","sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"offset":0,"length":2,"text":":("}],"warnings":[]},{"id":"19","sentiment":"neutral","confidenceScores":{"positive":0.3,"neutral":0.67,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.3,"neutral":0.67,"negative":0.03},"offset":0,"length":2,"text":":P"}],"warnings":[]},{"id":"1","sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"offset":0,"length":2,"text":":D"}],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - a8dd3009-0b69-4d69-a998-b4a97c23d241
+ - 202eb5e6-49a5-4e30-a8b9-f04ebb1d3a1d
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '85'
+ - '211'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_output_same_order_as_input.yaml
index fe8c30f1a09a..989e6708549d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_output_same_order_as_input.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.9,"negative":0.04},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.9,"negative":0.04},"offset":0,"length":3,"text":"one"}],"warnings":[]},{"id":"2","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.97,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.97,"negative":0.02},"offset":0,"length":3,"text":"two"}],"warnings":[]},{"id":"3","sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"offset":0,"length":5,"text":"three"}],"warnings":[]},{"id":"4","sentiment":"neutral","confidenceScores":{"positive":0.03,"neutral":0.96,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.03,"neutral":0.96,"negative":0.01},"offset":0,"length":4,"text":"four"}],"warnings":[]},{"id":"5","sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"offset":0,"length":4,"text":"five"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 164ce476-d77f-423d-99da-49ca42ffa802
+ - d3686859-3b21-44a7-991e-09bca1e698d5
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=5
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '88'
+ - '186'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_pass_cls.yaml
index 05822a1a66ba..932735b66b28 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_pass_cls.yaml
@@ -16,20 +16,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"neutral","confidenceScores":{"positive":0.32,"neutral":0.65,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.32,"neutral":0.65,"negative":0.03},"offset":0,"length":28,"text":"Test
passing cls to endpoint"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 7533e0c0-53f9-4e3f-aacc-55a323df392a
+ - d4509b09-bd20-4739-aeb5-2fb576ebbdd6
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -37,7 +37,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '87'
+ - '92'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_passing_only_string.yaml
index 250a850ad6cd..aaef6246dd11 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_passing_only_string.yaml
@@ -19,7 +19,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"offset":0,"length":51,"text":"Microsoft
@@ -32,13 +32,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 2d316802-f8d7-49c6-a78d-73d0254f3efb
+ - c3cd4fe4-c3da-4e35-8eb2-5788271eeb73
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -46,7 +46,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '86'
+ - '103'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_per_item_dont_use_language_hint.yaml
index 62e8c0307b53..454030da7907 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_per_item_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_per_item_dont_use_language_hint.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -27,13 +27,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - ee044433-b207-468c-821e-e6e0a26a3f21
+ - 6bd36846-ff3b-44c2-817f-b998cf8b8483
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:33 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '89'
+ - '101'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_rotate_subscription_key.yaml
index d51a2927a007..cf8a66ee6935 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_rotate_subscription_key.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -27,13 +27,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - b5263ebe-c94f-424d-b53b-178ef55c6ae5
+ - e586e4c3-409f-42f0-b982-19576111a359
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '89'
+ - '119'
status:
code: 200
message: OK
@@ -64,7 +64,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -74,7 +74,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:43 GMT
status:
code: 401
message: PermissionDenied
@@ -97,7 +97,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -106,13 +106,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 2fececee-d12d-4a2d-bec9-fc0ffab2a9eb
+ - 3efa5050-2382-404e-a814-2d66d202287b
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -120,7 +120,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '106'
+ - '93'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_show_stats_and_model_version.yaml
index 2e9d44595821..3cb69f9c6192 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_show_stats_and_model_version.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","sentiment":"positive","statistics":{"charactersCount":2,"transactionsCount":1},"confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"offset":0,"length":2,"text":":)"}],"warnings":[]},{"id":"0","sentiment":"negative","statistics":{"charactersCount":2,"transactionsCount":1},"confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"offset":0,"length":2,"text":":("}],"warnings":[]},{"id":"19","sentiment":"neutral","statistics":{"charactersCount":2,"transactionsCount":1},"confidenceScores":{"positive":0.3,"neutral":0.67,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.3,"neutral":0.67,"negative":0.03},"offset":0,"length":2,"text":":P"}],"warnings":[]},{"id":"1","sentiment":"positive","statistics":{"charactersCount":2,"transactionsCount":1},"confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"offset":0,"length":2,"text":":D"}],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 9e26502c-7014-40df-bcde-bdfe18321168
+ - 74763fb5-d048-49d1-aa5a-23c32aa1910c
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_too_many_documents.yaml
index d0d5d7a9b550..4369ce8282a0 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_too_many_documents.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_too_many_documents.yaml
@@ -21,7 +21,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.9,"negative":0.04},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.9,"negative":0.04},"offset":0,"length":3,"text":"One"}],"warnings":[]},{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.97,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.97,"negative":0.02},"offset":0,"length":3,"text":"Two"}],"warnings":[]},{"id":"2","sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"offset":0,"length":5,"text":"Three"}],"warnings":[]},{"id":"3","sentiment":"neutral","confidenceScores":{"positive":0.03,"neutral":0.96,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.03,"neutral":0.96,"negative":0.01},"offset":0,"length":4,"text":"Four"}],"warnings":[]},{"id":"4","sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"offset":0,"length":4,"text":"Five"}],"warnings":[]},{"id":"5","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.98,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.98,"negative":0.01},"offset":0,"length":3,"text":"Six"}],"warnings":[]},{"id":"6","sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.91,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.91,"negative":0.03},"offset":0,"length":5,"text":"Seven"}],"warnings":[]},{"id":"7","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.94,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.94,"negative":0.02},"offset":0,"length":5,"text":"Eight"}],"warnings":[]},{"id":"8","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.94,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.94,"negative":0.02},"offset":0,"length":4,"text":"Nine"}],"warnings":[]},{"id":"9","sentiment":"neutral","confidenceScores":{"positive":0.07,"neutral":0.9,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.07,"neutral":0.9,"negative":0.03},"offset":0,"length":3,"text":"Ten"}],"warnings":[]},{"id":"10","sentiment":"neutral","confidenceScores":{"positive":0.1,"neutral":0.86,"negative":0.04},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.1,"neutral":0.86,"negative":0.04},"offset":0,"length":6,"text":"Eleven"}],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
@@ -30,13 +30,13 @@ interactions:
https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 678d6919-fa5a-4f93-a47f-5947f05e5916
+ - 9d5eab99-956e-4d20-bb74-92ab0a0f971e
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=11
date:
- - Mon, 06 Jul 2020 22:22:28 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -44,7 +44,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '104'
+ - '201'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_user_agent.yaml
index 08db14b03e71..56e0fb0cb185 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_user_agent.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -27,13 +27,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - b5f60efb-88f2-45be-8044-8072ef840efa
+ - 7e3d865b-156b-46a4-a7ec-18300c77b15e
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:41 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '112'
+ - '97'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_dont_use_language_hint.yaml
index f55957f8e696..0e38aa4875fa 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_dont_use_language_hint.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":33,"text":"This
@@ -28,13 +28,13 @@ interactions:
restaurant was not as good as I hoped."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 7c1308ce-6bcf-43f2-ab62-06515776c082
+ - b5d70d4c-2813-44ac-9986-154a8a13130c
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -42,7 +42,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '85'
+ - '94'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint.yaml
index 47e1fff1c457..302ed7aac41c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"neutral","confidenceScores":{"positive":0.07,"neutral":0.93,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.07,"neutral":0.93,"negative":0.0},"offset":0,"length":33,"text":"This
@@ -28,13 +28,13 @@ interactions:
restaurant was not as good as I hoped."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - a0d2255c-d30b-454e-9832-e2c098059604
+ - 977bc57b-3591-4c0e-a083-5ff3326d32b9
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_dict_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_dict_input.yaml
index ec07824f3649..97ba615116e5 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_dict_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_dict_input.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -27,13 +27,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 39fe3a23-cbea-487d-8c6a-e1862a0192ba
+ - 83e8d870-affd-4f38-ad4f-03f8fe87dbb6
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:35 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '103'
+ - '115'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
index ccff7a4eaaf7..31bcb4d4e075 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -27,13 +27,13 @@ interactions:
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - a87e0f3f-7482-4e82-9078-b068d10e3ea6
+ - 00804568-0d8e-4051-87f1-a5399e251e23
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '114'
+ - '102'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_obj_input.yaml
index 2bcc83458fcb..a2141cbcafd2 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_obj_input.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: "{\"documents\":[{\"id\":\"1\",\"sentiment\":\"neutral\",\"confidenceScores\"\
@@ -37,13 +37,13 @@ interactions:
warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}"
headers:
apim-request-id:
- - 52b37512-586c-44b7-8d30-9a64fe9acddb
+ - 7bd94eb4-7f36-4590-86e0-d345f9924173
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -51,7 +51,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '102'
+ - '125'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
index e2ac02f49ca3..cb4c8a7ce81e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: "{\"documents\":[{\"id\":\"1\",\"sentiment\":\"neutral\",\"confidenceScores\"\
@@ -37,13 +37,13 @@ interactions:
warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}"
headers:
apim-request-id:
- - f6980faf-ca76-488a-aad2-44dbc78a3dd5
+ - 80ebc9f3-8257-47a2-a0c3-4652889c833e
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:34 GMT
+ - Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -51,7 +51,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '103'
+ - '109'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_all_successful_passing_dict.yaml
index 3ab84b6cc328..9e24c03bc67f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_all_successful_passing_dict.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=true
response:
body:
string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","sentiment":"neutral","statistics":{"charactersCount":51,"transactionsCount":1},"confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"offset":0,"length":51,"text":"Microsoft
@@ -25,16 +25,16 @@ interactions:
restaurant had really good food."},{"sentiment":"positive","confidenceScores":{"positive":0.96,"neutral":0.03,"negative":0.01},"offset":37,"length":23,"text":"I
recommend you try it."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 1ea4bb80-c433-4e12-a3a4-af2e0b71241e
+ apim-request-id: a02574f4-91fb-4ac8-8c9b-66ef9b9b9a13
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:34 GMT
+ date: Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '95'
+ x-envoy-upstream-service-time: '193'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_all_successful_passing_text_document_input.yaml
index 9036d36e82d7..67f54aaa3655 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_all_successful_passing_text_document_input.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"offset":0,"length":51,"text":"Microsoft
@@ -25,16 +25,16 @@ interactions:
restaurant had really good food."},{"sentiment":"positive","confidenceScores":{"positive":0.96,"neutral":0.03,"negative":0.01},"offset":37,"length":23,"text":"I
recommend you try it."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 014e6195-7360-4690-b35e-35d7e226d989
+ apim-request-id: 88f5d350-fd2a-4d63-9d33-efb5a3e9feaf
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:34 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '85'
+ x-envoy-upstream-service-time: '109'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_bad_credentials.yaml
index 9665bc75eff7..1959e3f0aef0 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_bad_credentials.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_bad_model_version_error.yaml
index 29f76d08acc8..3c23c13e0aaf 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_bad_model_version_error.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2019-10-01,2020-04-01"}}}'
headers:
- apim-request-id: b2edecb7-af67-4ab1-aaf2-c575ac16f379
+ apim-request-id: 186c3b7c-1e2e-4b39-b326-f42db2230e76
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:34 GMT
+ date: Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '5'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?model-version=bad&showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?model-version=bad&showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_batch_size_over_limit.yaml
index c6de3c992913..c1c3cb12629a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_batch_size_over_limit.yaml
@@ -756,21 +756,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: 3e275b09-1011-4fc2-bc9d-7883c522882b
+ apim-request-id: b7943f7e-f314-43ca-bb39-620fbf810522
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '12'
+ x-envoy-upstream-service-time: '14'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_batch_size_over_limit_error.yaml
index 35bbf18164ba..57ca5ed954dd 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_batch_size_over_limit_error.yaml
@@ -721,21 +721,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: 7c3161e7-cf86-4bab-893b-88b07067000c
+ apim-request-id: 273c84ac-b300-4ef8-9aad-815c0ea1b24c
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '15'
+ x-envoy-upstream-service-time: '11'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_client_passed_default_language_hint.yaml
index c64e51f57016..3f864f1a64a3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_client_passed_default_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_client_passed_default_language_hint.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -22,18 +22,18 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":0.97,"neutral":0.02,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.97,"neutral":0.02,"negative":0.01},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 6fc37371-6539-4c35-81a6-4acd6aecad1f
+ apim-request-id: b0146b82-a04a-404d-8689-0871e2277062
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '95'
+ x-envoy-upstream-service-time: '113'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -49,7 +49,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -57,18 +57,18 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: ae96d89e-4671-4ce1-a19c-aac5d0fdfb30
+ apim-request-id: 3896b0c1-d55a-48f4-95f6-381d90aa4b0a
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '82'
+ x-envoy-upstream-service-time: '90'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -84,7 +84,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -92,16 +92,16 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":0.97,"neutral":0.02,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.97,"neutral":0.02,"negative":0.01},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 36ef185b-36bd-43b1-9820-dd7c567f0697
+ apim-request-id: 2e58bfe8-176b-46b0-b607-25468cd90296
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '105'
+ x-envoy-upstream-service-time: '108'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_attribute_error_no_result_attribute.yaml
index 9e8204b36753..35b2268bbac3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_attribute_error_no_result_attribute.yaml
@@ -11,22 +11,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 4ab71047-dc6e-4a4c-bfcf-e6eaf7dcd13c
+ apim-request-id: 445ebb8b-1db3-451c-94f4-910ff2880adc
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '1'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_attribute_error_nonexistent_attribute.yaml
index 6d5869068700..b1365b867a6e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_attribute_error_nonexistent_attribute.yaml
@@ -11,22 +11,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 4acc249d-b5f3-49ae-a954-679f9839c206
+ apim-request-id: 93b7d9e6-652b-4d53-a262-f901c55aff44
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:42 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_errors.yaml
index e4d9e7fee714..ea7d16fd12f9 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_errors.yaml
@@ -14,28 +14,28 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"A
document within the request was too large to be processed. Limit document
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 1f858063-dfdd-4870-ac98-4428b7c8b674
+ apim-request-id: 15979b6e-b026-45f0-82af-183780125d6f
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:34 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_warnings.yaml
index 9464d062d308..6855dc69f736 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_document_warnings.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"offset":0,"length":40,"text":"This
won''t actually create a warning :''("}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: d89d7419-b3b2-4c36-a86b-e965c8b7c6ee
+ apim-request-id: cb6d5da1-7463-46c0-9e98-47badea2f281
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:34 GMT
+ date: Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '90'
+ x-envoy-upstream-service-time: '91'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_duplicate_ids_error.yaml
index 18d4fc930bd0..11ef8cc4c47f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_duplicate_ids_error.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
- apim-request-id: 2737941a-5316-4677-bcb7-8a8949f7b5e9
+ apim-request-id: 5ae6b123-edd5-4cb1-be77-71ffdae07d5d
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '9'
+ x-envoy-upstream-service-time: '4'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_empty_credential_class.yaml
index 2e78d2c408d4..6d04b1f4a524 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_empty_credential_class.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:34 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_input_with_all_errors.yaml
index e52d063c3f3c..44d4bb0d6061 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_input_with_all_errors.yaml
@@ -13,26 +13,26 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: dc92729b-e0ea-4d34-ac18-566c9ae93cd6
+ apim-request-id: 6db92618-5888-4b7c-8695-1682f2945e6e
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '2'
+ x-envoy-upstream-service-time: '3'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_input_with_some_errors.yaml
index 603779f07437..81d8ff523a4d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_input_with_some_errors.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"3","sentiment":"positive","confidenceScores":{"positive":0.98,"neutral":0.02,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The
@@ -22,19 +22,19 @@ interactions:
recommend you try it."}],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 08ceaf98-7c7d-451f-9e66-f8c8040e69d5
+ apim-request-id: e457581c-0f2f-4bdf-94bd-6df280015bc8
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:34 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '107'
+ x-envoy-upstream-service-time: '167'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_invalid_language_hint_docs.yaml
index 22b6f7a4b84a..ac135ae33a2b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_invalid_language_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_invalid_language_hint_docs.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: c0b5a944-5da2-406e-ba5c-b57a69caacc9
+ apim-request-id: e99b4a30-cff2-4ec3-af7f-722f1d90b11d
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_invalid_language_hint_method.yaml
index 3483070f41e7..e747200fdf3f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_invalid_language_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_invalid_language_hint_method.yaml
@@ -12,16 +12,16 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: de,en,es,fr,it,ja,ko,nl,pt-PT,zh-Hans,zh-Hant"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 2cac8bcd-b0ac-471f-957b-155b472e2641
+ apim-request-id: 8b3988d3-08e5-4f19-840c-831db5d90dfd
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -29,5 +29,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_language_kwarg_spanish.yaml
index 2391af0df607..c8bb7b9b08b8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_language_kwarg_spanish.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_language_kwarg_spanish.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","sentiment":"neutral","statistics":{"charactersCount":35,"transactionsCount":1},"confidenceScores":{"positive":0.01,"neutral":0.98,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.98,"negative":0.01},"offset":0,"length":35,"text":"Bill
Gates is the CEO of Microsoft."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: c12996a8-9b6a-40d8-ab31-2ac7d0e020ef
+ apim-request-id: b22cdb80-908b-4758-a721-638746a66fc7
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '111'
+ x-envoy-upstream-service-time: '93'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_out_of_order_ids.yaml
index e38892c81ff6..e1488f1d303f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_out_of_order_ids.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"56","sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"offset":0,"length":2,"text":":)"}],"warnings":[]},{"id":"0","sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"offset":0,"length":2,"text":":("}],"warnings":[]},{"id":"19","sentiment":"neutral","confidenceScores":{"positive":0.3,"neutral":0.67,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.3,"neutral":0.67,"negative":0.03},"offset":0,"length":2,"text":":P"}],"warnings":[]},{"id":"1","sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"offset":0,"length":2,"text":":D"}],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 3b9747a0-19af-4492-9f2c-f947763a268f
+ apim-request-id: d806272a-d892-40ae-97c5-5d1a205e23fc
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '95'
+ x-envoy-upstream-service-time: '107'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_output_same_order_as_input.yaml
index 109941cd913c..5eb1b109a9c4 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_output_same_order_as_input.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.9,"negative":0.04},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.9,"negative":0.04},"offset":0,"length":3,"text":"one"}],"warnings":[]},{"id":"2","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.97,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.97,"negative":0.02},"offset":0,"length":3,"text":"two"}],"warnings":[]},{"id":"3","sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"offset":0,"length":5,"text":"three"}],"warnings":[]},{"id":"4","sentiment":"neutral","confidenceScores":{"positive":0.03,"neutral":0.96,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.03,"neutral":0.96,"negative":0.01},"offset":0,"length":4,"text":"four"}],"warnings":[]},{"id":"5","sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"offset":0,"length":4,"text":"five"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 566486a9-fe05-4729-8fc7-e881866ad5b2
+ apim-request-id: 9f933ebf-771d-46ae-9f5e-964ab45d069f
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=5
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '86'
+ x-envoy-upstream-service-time: '98'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_pass_cls.yaml
index 51ed34d36017..bc62791c7b2e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_pass_cls.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"neutral","confidenceScores":{"positive":0.32,"neutral":0.65,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.32,"neutral":0.65,"negative":0.03},"offset":0,"length":28,"text":"Test
passing cls to endpoint"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: a35785a3-f3ff-4f7e-b4b4-3a847ff0d764
+ apim-request-id: 4d380e96-c279-4c56-9f5c-ec6f7778ef58
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:34 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '104'
+ x-envoy-upstream-service-time: '106'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_passing_only_string.yaml
index 06e39e8f2fd5..5df1a8509406 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_passing_only_string.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"offset":0,"length":51,"text":"Microsoft
@@ -27,16 +27,16 @@ interactions:
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 8db040c5-f3d8-4aa7-94a8-5234bb335301
+ apim-request-id: e622c344-99f3-451b-9f3b-8554dfa08e84
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '86'
+ x-envoy-upstream-service-time: '111'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_per_item_dont_use_language_hint.yaml
index 113178398e5b..1e361d1788ee 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_per_item_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_per_item_dont_use_language_hint.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -22,16 +22,16 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 0470d6b7-6870-4f02-9411-74ed129a307e
+ apim-request-id: 76258da2-0deb-4516-8709-9b46596c5c96
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '81'
+ x-envoy-upstream-service-time: '93'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_rotate_subscription_key.yaml
index 48c994f3ee3f..b9397c786d47 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_rotate_subscription_key.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -22,18 +22,18 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 53aea661-19c1-4847-80cf-2e92f9e766d3
+ apim-request-id: 6afc472c-0804-4bd0-8011-126b18576620
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '90'
+ x-envoy-upstream-service-time: '178'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -49,7 +49,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -57,11 +57,11 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -77,7 +77,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -85,16 +85,16 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: ffc6aa64-ab2a-4461-baa3-4ab9d1ca02a9
+ apim-request-id: 3fe95075-ac4e-4710-8ebe-1df34365799e
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '184'
+ x-envoy-upstream-service-time: '91'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_show_stats_and_model_version.yaml
index 41e304072a88..a5aa9833b2a8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_show_stats_and_model_version.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","sentiment":"positive","statistics":{"charactersCount":2,"transactionsCount":1},"confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"offset":0,"length":2,"text":":)"}],"warnings":[]},{"id":"0","sentiment":"negative","statistics":{"charactersCount":2,"transactionsCount":1},"confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.02,"negative":0.98},"offset":0,"length":2,"text":":("}],"warnings":[]},{"id":"19","sentiment":"neutral","statistics":{"charactersCount":2,"transactionsCount":1},"confidenceScores":{"positive":0.3,"neutral":0.67,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.3,"neutral":0.67,"negative":0.03},"offset":0,"length":2,"text":":P"}],"warnings":[]},{"id":"1","sentiment":"positive","statistics":{"charactersCount":2,"transactionsCount":1},"confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.89,"neutral":0.1,"negative":0.01},"offset":0,"length":2,"text":":D"}],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: fd4f5bfa-5ded-47e3-92d2-84ec46d00f14
+ apim-request-id: b920b85f-800a-4b92-b745-2f3c19a3a0de
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '98'
+ x-envoy-upstream-service-time: '200'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_too_many_documents.yaml
index 58e06b8278ff..9161b65b2c19 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_too_many_documents.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_too_many_documents.yaml
@@ -17,7 +17,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.9,"negative":0.04},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.9,"negative":0.04},"offset":0,"length":3,"text":"One"}],"warnings":[]},{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.97,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.97,"negative":0.02},"offset":0,"length":3,"text":"Two"}],"warnings":[]},{"id":"2","sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"offset":0,"length":5,"text":"Three"}],"warnings":[]},{"id":"3","sentiment":"neutral","confidenceScores":{"positive":0.03,"neutral":0.96,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.03,"neutral":0.96,"negative":0.01},"offset":0,"length":4,"text":"Four"}],"warnings":[]},{"id":"4","sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.05,"neutral":0.93,"negative":0.02},"offset":0,"length":4,"text":"Five"}],"warnings":[]},{"id":"5","sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.98,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.98,"negative":0.01},"offset":0,"length":3,"text":"Six"}],"warnings":[]},{"id":"6","sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.91,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.06,"neutral":0.91,"negative":0.03},"offset":0,"length":5,"text":"Seven"}],"warnings":[]},{"id":"7","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.94,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.94,"negative":0.02},"offset":0,"length":5,"text":"Eight"}],"warnings":[]},{"id":"8","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.94,"negative":0.02},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.94,"negative":0.02},"offset":0,"length":4,"text":"Nine"}],"warnings":[]},{"id":"9","sentiment":"neutral","confidenceScores":{"positive":0.07,"neutral":0.9,"negative":0.03},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.07,"neutral":0.9,"negative":0.03},"offset":0,"length":3,"text":"Ten"}],"warnings":[]},{"id":"10","sentiment":"neutral","confidenceScores":{"positive":0.1,"neutral":0.86,"negative":0.04},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.1,"neutral":0.86,"negative":0.04},"offset":0,"length":6,"text":"Eleven"}],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
@@ -25,16 +25,16 @@ interactions:
number of documents in the request have exceeded the data limitations. See
https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 8d9e8d76-86da-43c8-9c37-d45f05838605
+ apim-request-id: b2cc8f0b-9431-4c3c-afd2-112dc6167c03
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=11
- date: Mon, 06 Jul 2020 22:22:30 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '178'
+ x-envoy-upstream-service-time: '189'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_user_agent.yaml
index f5357d0e67cc..ac3c414a6fef 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_user_agent.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.09,"neutral":0.9,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -22,16 +22,16 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 0ba9a77a-bc64-438c-a4da-79426e529a9b
+ apim-request-id: d8a3ee55-eac4-4485-b2e1-1d5efbed8c3d
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '90'
+ x-envoy-upstream-service-time: '206'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_dont_use_language_hint.yaml
index f0ddfcc4e495..2ed04390cc88 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_dont_use_language_hint.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":33,"text":"This
@@ -23,16 +23,16 @@ interactions:
was too expensive."}],"warnings":[]},{"id":"2","sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.0,"negative":0.99},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.0,"negative":0.99},"offset":0,"length":42,"text":"The
restaurant was not as good as I hoped."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 225117bc-d91e-43ec-bfcb-1a4e63138dc2
+ apim-request-id: 0f770871-909a-48b1-8774-522ada8af602
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '83'
+ x-envoy-upstream-service-time: '154'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint.yaml
index c8be524002ec..1e25d8781f0e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"0","sentiment":"neutral","confidenceScores":{"positive":0.07,"neutral":0.93,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.07,"neutral":0.93,"negative":0.0},"offset":0,"length":33,"text":"This
@@ -23,16 +23,16 @@ interactions:
was too expensive."}],"warnings":[]},{"id":"2","sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.32,"negative":0.67},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.32,"negative":0.67},"offset":0,"length":42,"text":"The
restaurant was not as good as I hoped."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 9b599119-74b0-4436-b590-c633d8f11247
+ apim-request-id: 99e05f2b-dce3-4127-b1ef-a526ca59e311
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '105'
+ x-envoy-upstream-service-time: '89'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_dict_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_dict_input.yaml
index 97479206746d..f3fb54dbaed3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_dict_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_dict_input.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -22,16 +22,16 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":0.97,"neutral":0.02,"negative":0.01},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.97,"neutral":0.02,"negative":0.01},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: b9e3628e-8e52-488b-a8e1-313966e3363a
+ apim-request-id: c13e5370-bfb7-4ede-b734-d592c3839fa7
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '99'
+ x-envoy-upstream-service-time: '112'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
index 290069401887..968bfb0d6898 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: '{"documents":[{"id":"1","sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.04,"neutral":0.95,"negative":0.01},"offset":0,"length":22,"text":"I
@@ -22,16 +22,16 @@ interactions:
did not like the hotel we stayed at."}],"warnings":[]},{"id":"3","sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The
restaurant had really good food."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 1b8322e9-779b-4735-9b5e-3d07ddc2d1ef
+ apim-request-id: 8f86473f-9f4f-4d65-ae7f-1cb7eb91ce5f
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '97'
+ x-envoy-upstream-service-time: '124'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_obj_input.yaml
index 0fee7c9a573c..315edcfe68ca 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_obj_input.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: "{\"documents\":[{\"id\":\"1\",\"sentiment\":\"neutral\",\"confidenceScores\"\
@@ -32,16 +32,16 @@ interactions:
:0.06},\"offset\":0,\"length\":4,\"text\":\"\u732B\u306F\u5E78\u305B\"}],\"\
warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}"
headers:
- apim-request-id: 5df20d3f-b468-4c04-846e-a3e5a2a99b24
+ apim-request-id: 7344de7f-c20e-4596-b24c-a2c46c4ea626
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '141'
+ x-envoy-upstream-service-time: '95'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
index d20f38ac363e..9d6a5d77de4a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false
response:
body:
string: "{\"documents\":[{\"id\":\"1\",\"sentiment\":\"neutral\",\"confidenceScores\"\
@@ -32,16 +32,16 @@ interactions:
:0.06},\"offset\":0,\"length\":4,\"text\":\"\u732B\u306F\u5E78\u305B\"}],\"\
warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}"
headers:
- apim-request-id: 8812dfc4-8ff5-4362-a5c1-02c15f3123ef
+ apim-request-id: d2f7eac7-9960-40c5-9abe-7b3129747861
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '116'
+ x-envoy-upstream-service-time: '104'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_all_successful_passing_dict.yaml
index b3101d32a957..e40b226ed5e6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_all_successful_passing_dict.yaml
@@ -19,19 +19,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=true
response:
body:
string: '{"statistics":{"documentsCount":4,"validDocumentsCount":4,"erroneousDocumentsCount":0,"transactionsCount":4},"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"statistics":{"charactersCount":41,"transactionsCount":1},"warnings":[]},{"id":"2","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"statistics":{"charactersCount":39,"transactionsCount":1},"warnings":[]},{"id":"3","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"statistics":{"charactersCount":4,"transactionsCount":1},"warnings":[]},{"id":"4","detectedLanguage":{"name":"German","iso6391Name":"de","confidenceScore":1.0},"statistics":{"charactersCount":46,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 19d49ecf-b4ea-44be-96d9-c3328370b951
+ - f3a405b3-2203-46c8-89e4-c653d1c3871e
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -39,7 +39,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '39'
+ - '15'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_all_successful_passing_text_document_input.yaml
index 2e634f81dd61..c01a78d6174b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_all_successful_passing_text_document_input.yaml
@@ -19,19 +19,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"warnings":[]},{"id":"4","detectedLanguage":{"name":"German","iso6391Name":"de","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 7c0e1192-b8ec-4e83-8c8f-4af670b6861e
+ - 7a822279-2ca3-40c2-ab92-b2509700678c
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -39,7 +39,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '14'
+ - '8'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_bad_credentials.yaml
index ad134623393d..e819484b395d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_bad_credentials.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:43 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_bad_model_version_error.yaml
index 2330c011f031..3bad2e0ff64c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_bad_model_version_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2019-10-01"}}}'
headers:
apim-request-id:
- - a3967115-7236-4e39-be74-3532ae8c7a4b
+ - e865b305-db0a-4054-aeb2-f4c7c169a499
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:35 GMT
+ - Fri, 24 Jul 2020 16:32:43 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_batch_size_over_limit.yaml
index ad0464c2c7fb..1bef5ab737f6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_batch_size_over_limit.yaml
@@ -765,18 +765,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - 7180ece1-d314-4aae-89da-5fe822d0efd2
+ - 59601596-fa31-44c9-82f4-e4e435eb248e
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -784,7 +784,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '17'
+ - '15'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_batch_size_over_limit_error.yaml
index 1379bada53ee..34fda7040f3b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_batch_size_over_limit_error.yaml
@@ -730,18 +730,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - 7e8dce65-e3d9-470b-8847-ecec8cf704c3
+ - cf658a6e-41c2-4324-bbce-1c98d6d6910f
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -749,7 +749,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '13'
+ - '11'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_client_passed_default_country_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_client_passed_default_country_hint.yaml
index b71093c34149..1d2d164fbc08 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_client_passed_default_country_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_client_passed_default_country_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 12c434c9-149f-48b1-8974-24a63326069b
+ - a263b0ec-bd7f-46fc-b278-898936be3abf
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '13'
+ - '15'
status:
code: 200
message: OK
@@ -61,19 +61,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 4f69b127-e0b4-4067-bd33-1755f121d8a9
+ - e0cd65c2-3d62-485b-85a3-72aa09bfe905
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -104,19 +104,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 0d4a6b62-cb9c-4670-82f0-bd910636f3cb
+ - a22d55b3-a257-473b-b03e-84f66b7dd1aa
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -124,7 +124,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '24'
+ - '8'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_country_hint_kwarg.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_country_hint_kwarg.yaml
index ade51c6e1cdd..2ac6f96f9edb 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_country_hint_kwarg.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_country_hint_kwarg.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"statistics":{"charactersCount":26,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 769ac36f-8e7d-4c14-b49b-22ec378cc3c0
+ - dbf379af-a317-47f7-8cb9-508c45bf31d5
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '8'
+ - '7'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_country_hint_none.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_country_hint_none.yaml
index 48302e7445b5..c2e8f3a37937 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_country_hint_none.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_country_hint_none.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - e18658ae-8b8d-45dd-9f65-a6b3de0e01bb
+ - 4a730470-e0bf-46f2-95bb-e69de1dfbd2d
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '13'
status:
code: 200
message: OK
@@ -57,19 +57,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 455d9952-1791-4269-9423-f6e1ac63ef48
+ - d46766e6-e8ee-466f-b0cb-5ca6766bd34a
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -77,7 +77,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '7'
+ - '14'
status:
code: 200
message: OK
@@ -98,19 +98,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 5685507b-bb83-49fa-b33e-b21ca3a6da5e
+ - 5f2451ba-29dd-4267-bba2-cadccc494974
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -118,7 +118,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '7'
status:
code: 200
message: OK
@@ -139,19 +139,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 8cb36934-eb16-4870-adc3-2d03434a9ee0
+ - 7eb6cdd5-9142-4a0b-8994-5bd77aea5742
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -159,7 +159,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '14'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_attribute_error_no_result_attribute.yaml
index 7dbe49d10176..984b6a9e1bb1 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_attribute_error_no_result_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,11 +23,11 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 329feb8b-3fb7-48ce-ba41-a796c55294e2
+ - e5596b4f-83b8-48fa-8b65-3eb34fe41c2a
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '2'
+ - '1'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_attribute_error_nonexistent_attribute.yaml
index fd97efc0d6a9..43c74a00b0eb 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_attribute_error_nonexistent_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,11 +23,11 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 4a59fcb6-7aba-45b3-ae87-dbba475e3468
+ - a013ede2-7c6a-4fc4-80d0-bf5c1b00a841
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '2'
+ - '1'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_errors.yaml
index 35cc4bf00a9a..2205a1d99025 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_errors.yaml
@@ -17,7 +17,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -29,11 +29,11 @@ interactions:
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 82cd70f4-bdbd-4a57-92ca-c5ef97356a42
+ - acb47440-95c7-4b54-a0fe-dc941d8ec512
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_warnings.yaml
index 164982d7fca1..1f86206274ec 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_document_warnings.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 4efc2e16-6e12-4df9-b634-d48f11fa76f8
+ - a9b4bb8e-4e7d-46c2-bfd9-54e8d12b0b21
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '8'
+ - '17'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_duplicate_ids_error.yaml
index 2dee04713406..0403f5d51666 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_duplicate_ids_error.yaml
@@ -17,18 +17,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
apim-request-id:
- - 4fd4d073-1ed1-4298-b31f-54933860756a
+ - 3b4b92b3-ee37-44f4-a585-5f35267a0f77
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '5'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_empty_credential_class.yaml
index f745a4468b84..635df607cab8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_empty_credential_class.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_input_with_all_errors.yaml
index d06a38f264b5..1ad1c6ba2f4c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_input_with_all_errors.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -34,11 +34,11 @@ interactions:
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 02ca543c-db02-4c5e-92d3-6e8c6115e006
+ - b1d46a45-3d64-4ae5-a1e6-3a217b055c20
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -46,7 +46,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '3'
+ - '2'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_input_with_some_errors.yaml
index a3e22cf5d4a3..2981492b7f67 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_input_with_some_errors.yaml
@@ -19,7 +19,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"2","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"4","detectedLanguage":{"name":"German","iso6391Name":"de","confidenceScore":1.0},"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -30,13 +30,13 @@ interactions:
is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 1e84f6ca-ad68-4bc1-9011-7100a0b0eb93
+ - 63384771-382a-46d9-bbd8-389ae19b218c
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=2
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -44,7 +44,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '13'
+ - '6'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_invalid_country_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_invalid_country_hint_docs.yaml
index bf1c2b1285e6..f6eecbe40c6c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_invalid_country_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_invalid_country_hint_docs.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -25,11 +25,11 @@ interactions:
code."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 61f55788-8470-48e0-abb5-ad0c6b8a471a
+ - 19265f5b-cfac-4376-b6c3-f435474d4f06
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_invalid_country_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_invalid_country_hint_method.yaml
index 14eb31346d76..b9c006eab882 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_invalid_country_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_invalid_country_hint_method.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -25,11 +25,11 @@ interactions:
code."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 34598bde-e4da-4f65-9779-de4c4fc0b774
+ - 704de4ad-a062-4a59-9706-61114f611145
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -37,7 +37,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '2'
+ - '1'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_out_of_order_ids.yaml
index 2fee3dc0f702..13ec20b9d837 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_out_of_order_ids.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"56","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"warnings":[]},{"id":"0","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"warnings":[]},{"id":"19","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"warnings":[]},{"id":"1","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 24bf4210-f1a1-4740-8d04-020c27bc3e1b
+ - 8194be8f-2284-436d-b878-711535e0fa48
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '7'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_output_same_order_as_input.yaml
index 434e3365db58..697f8e93e56b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_output_same_order_as_input.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"4","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"5","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - e652b58d-4f1d-4139-8dbd-19c1db1942c5
+ - 7acba81f-4af2-45a2-9cbb-89d9623c95db
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=5
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_pass_cls.yaml
index 38730e018360..0fa211fb6af2 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_pass_cls.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 839a0d15-bca3-41a0-a6e5-0b0ee3b7ac97
+ - 323f2cbb-f92b-488a-ae2a-1902d4673096
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '12'
+ - '9'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_passing_only_string.yaml
index 32dd59b21a02..88d5a03efbd0 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_passing_only_string.yaml
@@ -19,7 +19,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"1","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"German","iso6391Name":"de","confidenceScore":1.0},"warnings":[]}],"errors":[{"id":"4","error":{"code":"InvalidArgument","message":"Invalid
@@ -27,13 +27,13 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - e580a9e6-b3ed-405f-b714-7bdad4f0c4d6
+ - 9fcc3c4e-c0ab-4c43-8fe2-3ea7c1f1d9e4
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_per_item_dont_use_country_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_per_item_dont_use_country_hint.yaml
index b26bb76b578d..a6d38f7c1519 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_per_item_dont_use_country_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_per_item_dont_use_country_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - ddf95f80-f779-481f-9d05-39a76460f8cf
+ - 28b1bff6-586e-4618-8898-7dd8c41a565f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '8'
+ - '10'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_rotate_subscription_key.yaml
index 22bd7f2a2202..575e422b805b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_rotate_subscription_key.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 3f5fdea2-46f0-4257-a79e-911f11d33c6c
+ - dcf16c34-b2e1-4cba-af06-7f1025e14f0f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '12'
+ - '7'
status:
code: 200
message: OK
@@ -61,7 +61,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -71,7 +71,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
status:
code: 401
message: PermissionDenied
@@ -94,19 +94,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 6de0b4fb-28f0-46e2-be9c-aad8a842a635
+ - d91407e8-405e-421b-9e77-ac2a6c7c1b5f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -114,7 +114,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '8'
+ - '7'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_show_stats_and_model_version.yaml
index 4e8892634c7a..a48a1f763653 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_show_stats_and_model_version.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"0","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"19","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"1","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 9d4da61a-7c88-4b34-90cb-e502165e780d
+ - b885ec99-9c84-406c-ae5a-89730c9b6ba2
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_user_agent.yaml
index 66df20ff6f80..1eb950111f5e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_user_agent.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 695cb4ca-8c6b-46c6-a1c6-f4f05a425898
+ - e7b82277-8276-4ee8-bd8f-5420c531dae8
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:35 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '21'
+ - '6'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint.yaml
index 1890d271cf32..4120c358d34b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 81a96f7c-fd71-4774-a88b-952eea548dff
+ - c8cae5a2-898c-4320-b2e4-5a3e1f343734
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '16'
+ - '7'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_dict_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_dict_input.yaml
index 104af2aba194..f2cbae68f52b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_dict_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_dict_input.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 64238405-29ad-4e40-9a33-27f93c8aaabc
+ - 82e09fb7-977c-459e-ab06-f646f0b759f8
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '14'
+ - '9'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_dict_per_item_hints.yaml
index 11dee2103817..8fc790defee3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_dict_per_item_hints.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 054c8895-2d5d-4f62-b050-6543eb17db19
+ - 26a25701-f156-4ece-8d4b-4a452664b21f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:36 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '8'
+ - '6'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_obj_input.yaml
index d64cfbf123f1..8638ba6a71ed 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_obj_input.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 8a8be22a-d108-4ede-9c38-92363381225d
+ - 44c91ebc-9e7b-4107-b492-e6811a25c461
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '14'
+ - '26'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_obj_per_item_hints.yaml
index 68a1edeb284f..b3c627bb7c18 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_country_hint_and_obj_per_item_hints.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"4","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 623f02d3-a3a4-44eb-9dd6-2e80b3e51112
+ - 8cda4b5a-8838-4244-9f81-3173b3fbd257
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '7'
+ - '8'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_dont_use_country_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_dont_use_country_hint.yaml
index b8e2dbf47d48..a86542113bde 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_dont_use_country_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language.test_whole_batch_dont_use_country_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 6909997c-5aa4-4739-b540-a35709b7c95e
+ - 7c9531b7-b9ef-4acb-9fe7-d7b88725e022
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '12'
+ - '6'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_all_successful_passing_dict.yaml
index 904af9d875fe..63898d6ce2c0 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_all_successful_passing_dict.yaml
@@ -15,21 +15,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=true
response:
body:
string: '{"statistics":{"documentsCount":4,"validDocumentsCount":4,"erroneousDocumentsCount":0,"transactionsCount":4},"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"statistics":{"charactersCount":41,"transactionsCount":1},"warnings":[]},{"id":"2","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"statistics":{"charactersCount":39,"transactionsCount":1},"warnings":[]},{"id":"3","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"statistics":{"charactersCount":4,"transactionsCount":1},"warnings":[]},{"id":"4","detectedLanguage":{"name":"German","iso6391Name":"de","confidenceScore":1.0},"statistics":{"charactersCount":46,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 6ba6a553-4383-4710-b227-1410e81ef0d7
+ apim-request-id: d94f0fbd-be40-42ff-bed6-b965ea7be8b6
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '8'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_all_successful_passing_text_document_input.yaml
index b8e0ce87b179..0b50ac6bbb8e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_all_successful_passing_text_document_input.yaml
@@ -15,21 +15,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"warnings":[]},{"id":"4","detectedLanguage":{"name":"German","iso6391Name":"de","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 02367ade-4be5-436b-8be7-14eb2d4ca7a0
+ apim-request-id: 107b426b-0380-4176-889b-d0e3c12ff24c
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '9'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_bad_credentials.yaml
index fb027a9b9fa2..96b847d8e76e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_bad_credentials.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_bad_model_version_error.yaml
index 077160632d13..657a367ac066 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_bad_model_version_error.yaml
@@ -12,15 +12,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2019-10-01"}}}'
headers:
- apim-request-id: 05118777-7c61-4f60-bc52-a1a461deb4f6
+ apim-request-id: 8fb49529-a052-4607-bbd7-67a89128744d
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -28,5 +28,5 @@ interactions:
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?model-version=bad&showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?model-version=bad&showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_batch_size_over_limit.yaml
index 0788ef6cbbd7..c2f2f4445da8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_batch_size_over_limit.yaml
@@ -761,15 +761,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: 87cacf11-a25f-436e-90e5-2de057c09642
+ apim-request-id: c6e185a9-5654-4b2d-a6a7-3e79b7200910
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -777,5 +777,5 @@ interactions:
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_batch_size_over_limit_error.yaml
index 1d10b392475e..86ee553acfd6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_batch_size_over_limit_error.yaml
@@ -726,15 +726,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: ec20dfea-630f-49c2-8482-e874442828b0
+ apim-request-id: 00a77b36-500c-434e-baa9-307c4a111d2d
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -742,5 +742,5 @@ interactions:
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_client_passed_default_country_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_client_passed_default_country_hint.yaml
index a3dd54c675c1..659b2fbeef94 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_client_passed_default_country_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_client_passed_default_country_hint.yaml
@@ -14,15 +14,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 4738455b-f272-4e94-9768-6021d4d7984b
+ apim-request-id: 953e3a4e-b259-4c71-9a07-67e4e6cb4365
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -30,7 +30,7 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "countryHint":
"DE"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "countryHint":
@@ -46,23 +46,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 060867ee-a949-49f2-a82b-891254100429
+ apim-request-id: 6dce5c9c-113c-4bd3-9e36-0f64bb4ed770
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '8'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "countryHint":
"CA"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "countryHint":
@@ -78,15 +78,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 107b8e95-53f8-4976-aeff-16c8d9a8fd2f
+ apim-request-id: e3c0cf99-3a02-44d8-a2d7-654a95bfe0a2
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -94,5 +94,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_country_hint_kwarg.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_country_hint_kwarg.yaml
index 2ab8165c2aa4..318eb84741b5 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_country_hint_kwarg.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_country_hint_kwarg.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"statistics":{"charactersCount":26,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: d0d20306-4081-4572-a412-c30fcd20d39f
+ apim-request-id: 6143cb65-5cdf-4334-a8fe-0712449a3d4d
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_country_hint_none.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_country_hint_none.yaml
index b2b20ffddc46..19b21ffc79da 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_country_hint_none.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_country_hint_none.yaml
@@ -12,23 +12,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 3156fff9-6913-4389-aa12-7ae792138cda
+ apim-request-id: 95a96846-394d-42e5-966a-21b64f1580d3
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '6'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "This is written in English.", "countryHint":
""}]}'
@@ -42,23 +42,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 9ce75f11-6f43-4d01-a8f6-19530d7acb1a
+ apim-request-id: 3a06cf6b-0f7e-4bab-8c7b-70d0252c2340
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '6'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
- request:
body: '{"documents": [{"id": "0", "text": "this is written in english", "countryHint":
""}]}'
@@ -72,15 +72,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 450df9eb-9d57-4c2c-acfb-cb7c971dd7fe
+ apim-request-id: 402c2b36-368d-4dc0-ab58-750bba36d03f
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -88,7 +88,7 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
- request:
body: '{"documents": [{"id": "0", "text": "this is written in english", "countryHint":
""}]}'
@@ -102,21 +102,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 6c0219e4-13e0-44d9-b871-061031f0e611
+ apim-request-id: 434c280f-c230-4f1f-8487-e662af1c0644
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '10'
+ x-envoy-upstream-service-time: '6'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_attribute_error_no_result_attribute.yaml
index 919a90c5d1b5..7ba981192239 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_attribute_error_no_result_attribute.yaml
@@ -11,16 +11,16 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: a1d94548-65ce-4dfe-b693-1f5b21675a1a
+ apim-request-id: 0554e944-c14e-4a8f-a1b3-ebf8b6f9b358
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -28,5 +28,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_attribute_error_nonexistent_attribute.yaml
index 805c3b78e7aa..270eaa7a54a8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_attribute_error_nonexistent_attribute.yaml
@@ -11,22 +11,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 6761c394-c5e6-478c-b297-b977215aeeb1
+ apim-request-id: 2d0972f1-9c05-4171-a6b1-bb5dc1cb2bba
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '1'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_errors.yaml
index 5ca479b6010e..2a93dc403995 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_errors.yaml
@@ -13,7 +13,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -24,15 +24,15 @@ interactions:
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 43652b83-8bb8-4a93-af3e-87ca7b4775f6
+ apim-request-id: 0546eff8-748b-4af5-a8f3-8e6d7b5c0c7d
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_warnings.yaml
index 78568d0d1f60..70f18ef11454 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_document_warnings.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 7f7e2a04-9e26-4230-9dfb-22fc808ac7af
+ apim-request-id: af357aca-1a06-4cea-bcb9-e3d46a068965
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '12'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_duplicate_ids_error.yaml
index f23d2efb346b..7a19130126a9 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_duplicate_ids_error.yaml
@@ -13,21 +13,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
- apim-request-id: 849a9531-4019-4302-84ff-33ba8733aa4e
+ apim-request-id: 8eb45a08-cafe-4a18-bf95-1ebbb4c20441
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '4'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_empty_credential_class.yaml
index 3d2c66ac4e60..165c5b8e8a7f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_empty_credential_class.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_input_with_all_errors.yaml
index 4fed5f527d85..586e2c97efc6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_input_with_all_errors.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -29,9 +29,9 @@ interactions:
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 19673641-d8f2-4452-8df5-aa13260d4d8f
+ apim-request-id: fca43c30-c24b-4707-b788-64eedc0658da
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -39,5 +39,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_input_with_some_errors.yaml
index c7a9cb8f2e92..2dfcc26980ee 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_input_with_some_errors.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"2","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"4","detectedLanguage":{"name":"German","iso6391Name":"de","confidenceScore":1.0},"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -25,16 +25,16 @@ interactions:
in request.","innererror":{"code":"InvalidDocument","message":"Document text
is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 1f668a29-226b-478d-b00f-62de077f6431
+ apim-request-id: 46640073-4a4d-437a-8502-6436ddc59e2b
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=2
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '9'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_invalid_country_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_invalid_country_hint_docs.yaml
index 1a560df3e58e..341a6ec9d24d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_invalid_country_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_invalid_country_hint_docs.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -20,15 +20,15 @@ interactions:
hint is not valid. Please specify an ISO 3166-1 alpha-2 two letter country
code."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: a7d3dd96-ec58-449b-8b77-c005f4749219
+ apim-request-id: e4ad770a-7a0e-455c-bedf-514223112e62
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:44 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '1'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_invalid_country_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_invalid_country_hint_method.yaml
index d43d794848b0..aaee341861d2 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_invalid_country_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_invalid_country_hint_method.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -20,15 +20,15 @@ interactions:
hint is not valid. Please specify an ISO 3166-1 alpha-2 two letter country
code."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 4a934f16-8c9a-4663-a1d8-cc6034024d61
+ apim-request-id: 453f65f8-a508-4786-aa17-51ea1572d655
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '1'
+ x-envoy-upstream-service-time: '3'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_out_of_order_ids.yaml
index d96c39f0749a..94302c744d7e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_out_of_order_ids.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"56","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"warnings":[]},{"id":"0","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"warnings":[]},{"id":"19","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"warnings":[]},{"id":"1","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 6ae30d05-4f3a-46da-a8ce-821ac18691c2
+ apim-request-id: efd59133-9888-4938-b865-3bbfb894cb57
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:35 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '19'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_output_same_order_as_input.yaml
index 4b511f78286c..14bd8b474e8d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_output_same_order_as_input.yaml
@@ -14,15 +14,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"4","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"5","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 983f98e8-0936-4ba4-8ffa-9493068ff1d8
+ apim-request-id: 566ba137-d50b-4e9c-af1c-68fade3ee438
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=5
- date: Thu, 18 Jun 2020 19:52:36 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -30,5 +30,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_pass_cls.yaml
index 4fa56e9ea156..e6ecd56442e9 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_pass_cls.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: f4adffc8-071a-4aaf-b223-224a4602acbb
+ apim-request-id: e5129bae-469f-41a2-bc8f-2a74718a640f
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '8'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_passing_only_string.yaml
index 4ae17b391169..03e233da9e79 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_passing_only_string.yaml
@@ -15,23 +15,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"1","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"German","iso6391Name":"de","confidenceScore":1.0},"warnings":[]}],"errors":[{"id":"4","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 47444ecf-0d8a-4875-b80c-512a496086d7
+ apim-request-id: fa0ec23e-1bc1-41ca-8d06-fa4096707af9
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '11'
+ x-envoy-upstream-service-time: '8'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_per_item_dont_use_country_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_per_item_dont_use_country_hint.yaml
index 4179d853658b..7a5ff9103970 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_per_item_dont_use_country_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_per_item_dont_use_country_hint.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 7a99c22c-bee3-4bf1-b6d3-222fcc045f60
+ apim-request-id: 33359a13-be2b-41eb-bdd0-5e62ba465326
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '6'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_rotate_subscription_key.yaml
index 8cab22adf807..7d6795d9b36f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_rotate_subscription_key.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 56a1d36e-6396-47ef-b754-fd05110b5585
+ apim-request-id: e5259fef-6a15-483f-987c-02841de95064
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '8'
+ x-envoy-upstream-service-time: '9'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "countryHint":
"US"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "countryHint":
@@ -46,7 +46,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -54,11 +54,11 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "countryHint":
"US"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "countryHint":
@@ -74,21 +74,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 553b9352-5c9d-4963-950a-484af4f9a60e
+ apim-request-id: 7c866ffa-9002-44d1-b5af-0f9f5806b5de
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:38 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '6'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_show_stats_and_model_version.yaml
index 65666565d281..537e41983b4f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_show_stats_and_model_version.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"0","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"19","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"1","detectedLanguage":{"name":"(Unknown)","iso6391Name":"(Unknown)","confidenceScore":0.0},"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 690c5550-17f6-498e-b65d-58de62d205a3
+ apim-request-id: 659acbc9-62e9-4685-9a80-555c2e4aa6bd
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '9'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_user_agent.yaml
index e255c4888dc6..251fbda17f82 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_user_agent.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: f9c6bc83-bcf0-4f63-aaa8-78af677e081d
+ apim-request-id: 221b50d8-3ed8-42ea-be97-08eca6cd869a
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '10'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint.yaml
index 5d03f75bfa6a..a4f8d277a6cf 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 69673223-8d3a-4be7-b027-2d835cbf22b7
+ apim-request-id: eec8dafd-4162-4eab-a1d4-dcd948c67559
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '6'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_dict_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_dict_input.yaml
index 78e325e061fa..4e40f9a88329 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_dict_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_dict_input.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 905c8fe8-a6e8-4165-a64b-4f377979443c
+ apim-request-id: cd3971ab-59dd-4ff7-9ce9-1d018861b070
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:45 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '11'
+ x-envoy-upstream-service-time: '15'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_dict_per_item_hints.yaml
index 58e94156c1f3..93391c2bf70c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_dict_per_item_hints.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 59095ec2-03b3-476a-ac51-6dc276b0ea1a
+ apim-request-id: 2f6bc694-d58e-4e53-80ea-52b4d0b06065
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '8'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_obj_input.yaml
index fc36b464059f..0bd48495a316 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_obj_input.yaml
@@ -14,15 +14,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: bc8c1737-a35e-4f23-9c17-21e756366ec0
+ apim-request-id: 1712442a-1b0d-4ee1-ae42-c4851e9dcbea
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -30,5 +30,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_obj_per_item_hints.yaml
index d2b479083786..b0c6dab20fbf 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_country_hint_and_obj_per_item_hints.yaml
@@ -14,15 +14,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"4","detectedLanguage":{"name":"Spanish","iso6391Name":"es","confidenceScore":1.0},"warnings":[]},{"id":"3","detectedLanguage":{"name":"Japanese","iso6391Name":"ja","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 76eacc7f-1f5f-4f7c-9a5a-0ea05a376e58
+ apim-request-id: 3835547e-2543-47e5-8ab7-06f610de2366
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -30,5 +30,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_dont_use_country_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_dont_use_country_hint.yaml
index 6944ba038acb..3a67ae1e2d8d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_dont_use_country_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_detect_language_async.test_whole_batch_dont_use_country_hint.yaml
@@ -14,15 +14,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"0","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]},{"id":"2","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 2c7c65be-5520-419c-a886-d061f5567bd1
+ apim-request-id: 88426c3b-36c1-4832-8f78-da90b1110622
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:37 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -30,5 +30,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/languages?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/languages?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_all_successful_passing_dict.yaml
index ab80be89fc8d..2c495c14818a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_all_successful_passing_dict.yaml
@@ -17,7 +17,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=true
response:
body:
string: '{"statistics":{"documentsCount":2,"validDocumentsCount":2,"erroneousDocumentsCount":0,"transactionsCount":2},"documents":[{"id":"1","keyPhrases":["Bill
@@ -25,13 +25,13 @@ interactions:
Gates","Paul Allen","Microsoft"],"statistics":{"charactersCount":49,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 6810720f-8032-4dd2-b1ad-d957a2d3192b
+ - a1dc5e5b-6b95-4fba-8c0f-72fa4b1fc8cf
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=2
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -39,7 +39,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '10'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_all_successful_passing_text_document_input.yaml
index aa7670c16e7e..f9945d6ddc85 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_all_successful_passing_text_document_input.yaml
@@ -17,20 +17,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["Bill Gates","Paul Allen","Microsoft"],"warnings":[]},{"id":"2","keyPhrases":["Bill
Gates","Paul Allen","Microsoft"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - c5cb47c5-19c4-46b3-ba74-a1aa4c900631
+ - 12f1524e-96a6-4bfa-b3be-a231085521e5
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=2
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '9'
+ - '6'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_bad_credentials.yaml
index 130ac6dbfe65..0548ef9ceaa2 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_bad_credentials.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_bad_model_version_error.yaml
index 83fb65972566..7232fb03e2cf 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_bad_model_version_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2019-10-01"}}}'
headers:
apim-request-id:
- - 95b27978-aae2-4310-a894-aab0d28f107f
+ - 7fdf22bd-feb4-4eb4-96ec-5dbdaba47725
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '4'
+ - '5'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_batch_size_over_limit.yaml
index 5552a6420038..f210131573f3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_batch_size_over_limit.yaml
@@ -760,18 +760,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - 4522d2c2-b135-4362-b3af-ed45d993a397
+ - 508b2e5b-6400-4b8d-a9e5-99d3a80ef225
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:37 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -779,7 +779,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '27'
+ - '88'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_batch_size_over_limit_error.yaml
index 4e32c36bd1d6..fbc706fdee32 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_batch_size_over_limit_error.yaml
@@ -725,18 +725,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - f981da9c-5e9f-452d-8b88-2a9a12ecdd49
+ - b405b156-5759-48fe-aec9-9da3099f23bc
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -744,7 +744,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '27'
+ - '28'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_client_passed_default_language_hint.yaml
index d22c2ddca6f6..6966617c9a8a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_client_passed_default_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_client_passed_default_language_hint.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["the park","I will go"],"warnings":[]},{"id":"2","keyPhrases":["I
@@ -26,13 +26,13 @@ interactions:
restaurant had really good food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - a3ba672f-3224-455d-8bcc-d1ae109a0b3b
+ - 24393168-ca16-430e-aee9-2de400735e3c
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '5'
status:
code: 200
message: OK
@@ -63,20 +63,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 13b3a80f-e918-4b9d-8115-cd0562b71b10
+ - fb2f575c-9b11-49a0-8621-a95f3666b588
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -84,7 +84,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '7'
+ - '5'
status:
code: 200
message: OK
@@ -107,7 +107,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["the park","I will go"],"warnings":[]},{"id":"2","keyPhrases":["I
@@ -115,13 +115,13 @@ interactions:
restaurant had really good food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 03c57d75-a07f-4d36-8237-58b07146d044
+ - 7aa045c3-3683-4d9c-8a8f-d21779493dd7
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -129,7 +129,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '8'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_attribute_error_no_result_attribute.yaml
index 6193cbc3ac38..815fe02f44f4 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_attribute_error_no_result_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,13 +23,13 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - af6ea06a-281e-4980-98c6-63d980e7f490
+ - bac7a530-8e51-487a-b285-90e68e599ba3
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=0
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_attribute_error_nonexistent_attribute.yaml
index df51820d0035..cb661c47d74d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_attribute_error_nonexistent_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,13 +23,13 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - d06eae58-0de2-4d54-87b5-f7eb272dc802
+ - eda65839-3f7c-4f65-b9ed-5b879c35221c
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=0
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_errors.yaml
index 035d256e9935..48432d780a0a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_errors.yaml
@@ -18,27 +18,27 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"A
document within the request was too large to be processed. Limit document
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - d1c3e889-da1d-47da-a4d6-15c27be993a4
+ - d6e92877-5f9c-4b01-b176-1147f3b903d5
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=0
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -46,7 +46,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '3'
+ - '4'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_warnings.yaml
index 3984a64f0e5f..de00b99991ab 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_document_warnings.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["Thisisaveryveryverylongtextwhichgoesonforalongtimeandwhichalmost"],"warnings":[{"code":"LongWordsInDocument","message":"The
@@ -24,13 +24,13 @@ interactions:
will be truncated and may result in unreliable model predictions."}]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 143b0c59-ac42-419c-aeee-f47a8b6c2f04
+ - 9db1eddc-bf89-4fe6-867a-f33ae45bcdf8
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_duplicate_ids_error.yaml
index 6dbcbd84ae89..3cc8dde17dc4 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_duplicate_ids_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
apim-request-id:
- - a65243fc-d9d6-485b-868c-9f8a5c2e5e10
+ - 0e5ee702-318b-4dc2-aed2-0ce3491d6de4
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '4'
+ - '115'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_empty_credential_class.yaml
index 130ac6dbfe65..6ad43a5093b7 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_empty_credential_class.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_input_with_all_errors.yaml
index 057b411c1a68..6c7b4b4134f3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_input_with_all_errors.yaml
@@ -17,23 +17,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - bf621d9f-db43-4581-bf94-f443921ba246
+ - 3f113b25-f3d0-4a67-b2b5-dcb8288cfb44
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=0
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '3'
+ - '4'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_input_with_some_errors.yaml
index 2719e6fada64..3516d4c89dd8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_input_with_some_errors.yaml
@@ -17,21 +17,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"2","keyPhrases":["Bill Gates","Paul Allen","Microsoft"],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 549ebae2-e279-407c-8479-efe1ff72c5d6
+ - 30a860fe-3391-4efe-95f8-0f6646540be6
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -39,7 +39,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '5'
+ - '4'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_invalid_language_hint_docs.yaml
index c0e93765c4ee..72263bd6365a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_invalid_language_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_invalid_language_hint_docs.yaml
@@ -16,21 +16,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 98ff6f40-efa7-4881-ad2c-329055785e13
+ - f8f1d7bf-d734-472f-97e2-f247a51e7f13
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=0
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_invalid_language_hint_method.yaml
index e6bb45405e47..8ef63985d834 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_invalid_language_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_invalid_language_hint_method.yaml
@@ -16,21 +16,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - be220d98-d9eb-4b2f-ac50-9d7863c40411
+ - d68bc80b-dc0c-4786-9bb8-fd9fbf4b8560
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=0
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '4'
+ - '3'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_language_kwarg_spanish.yaml
index 307ddcf3f8ba..086c9ddbdebc 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_language_kwarg_spanish.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_language_kwarg_spanish.yaml
@@ -16,20 +16,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","keyPhrases":["Bill
Gates","the CEO of Microsoft"],"statistics":{"charactersCount":35,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - f0ce9612-c59c-4bcd-b098-80327c810b9d
+ - eda5bd78-7e7e-456f-a018-84b3de5100d1
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -37,7 +37,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '5'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_out_of_order_ids.yaml
index e5d778a301a4..576c9b2623a7 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_out_of_order_ids.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"56","keyPhrases":[],"warnings":[]},{"id":"0","keyPhrases":[],"warnings":[]},{"id":"19","keyPhrases":[],"warnings":[]},{"id":"1","keyPhrases":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - b71912f6-a7bf-496b-ac3f-cc81a5956519
+ - b82efbe6-b285-460b-9bf6-cdca01f4e9bd
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:46 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_output_same_order_as_input.yaml
index 2927fb988d4b..a7ac8e322290 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_output_same_order_as_input.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":[],"warnings":[]},{"id":"2","keyPhrases":[],"warnings":[]},{"id":"3","keyPhrases":[],"warnings":[]},{"id":"4","keyPhrases":[],"warnings":[]},{"id":"5","keyPhrases":[],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 4e94de77-fb7d-4cbc-8ac3-3ec8358a5976
+ - f50c1b4c-5d74-4f2f-b5e7-28b3d1d74ea4
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=5
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '5'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_pass_cls.yaml
index 53d6dab22549..d69aa0a38bf6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_pass_cls.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":["Test","cls","endpoint"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 831feebe-fca9-440f-bb33-29719e7c7dfc
+ - e0a05ba4-8350-4aa4-aae2-c89993bffd3e
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '6'
+ - '4'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_passing_only_string.yaml
index ef32a2cdb4ac..0d276d91beab 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_passing_only_string.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":["Bill Gates","Paul Allen","Microsoft"],"warnings":[]},{"id":"1","keyPhrases":["Microsoft
@@ -27,13 +27,13 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - d05b154b-9a57-4d8b-a8d8-626b965342b9
+ - ca9315ad-43b8-465e-8b18-c53bdb1bad8e
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=2
date:
- - Thu, 18 Jun 2020 19:52:38 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '10'
+ - '5'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_per_item_dont_use_language_hint.yaml
index 9fe93b16a008..015efc446784 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_per_item_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_per_item_dont_use_language_hint.yaml
@@ -18,20 +18,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 2f108377-21fb-431e-89ed-f55a8272645e
+ - 19ac7e4f-11c9-47c2-910f-ab2ae479369d
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -39,7 +39,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '5'
+ - '11'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_rotate_subscription_key.yaml
index 6a91e626ddcf..ae749752ecf8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_rotate_subscription_key.yaml
@@ -18,20 +18,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 8b4de5ef-2b5a-46c3-9881-4ccce29f77cd
+ - ca90ad95-949c-49fa-a1c6-2a93cdbea9fb
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -39,7 +39,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '11'
+ - '8'
status:
code: 200
message: OK
@@ -62,7 +62,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -72,7 +72,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
status:
code: 401
message: PermissionDenied
@@ -95,20 +95,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - c12c61a9-faa5-477c-b3b3-1f9c321fa669
+ - 08e53e9a-da68-4250-bc3a-716276d08480
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -116,7 +116,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '13'
+ - '5'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_show_stats_and_model_version.yaml
index 5f13c6f9720b..7ec0aa6f1d5b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_show_stats_and_model_version.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","keyPhrases":[],"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"0","keyPhrases":[],"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"19","keyPhrases":[],"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"1","keyPhrases":[],"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - d2ca5a99-7573-49bd-8a91-cae21fad6a57
+ - b2dd2681-05ed-49a4-9a6d-f1e3abc0d838
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '4'
+ - '9'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_too_many_documents.yaml
index 003d4c776df7..c527e1d5270d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_too_many_documents.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_too_many_documents.yaml
@@ -21,7 +21,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":[],"warnings":[]},{"id":"1","keyPhrases":[],"warnings":[]},{"id":"2","keyPhrases":[],"warnings":[]},{"id":"3","keyPhrases":[],"warnings":[]},{"id":"4","keyPhrases":[],"warnings":[]},{"id":"5","keyPhrases":[],"warnings":[]},{"id":"6","keyPhrases":[],"warnings":[]},{"id":"7","keyPhrases":[],"warnings":[]},{"id":"8","keyPhrases":[],"warnings":[]},{"id":"9","keyPhrases":[],"warnings":[]},{"id":"10","keyPhrases":[],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
@@ -30,13 +30,13 @@ interactions:
https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 1974472d-7ecc-43ed-9ef6-2b190f4006ee
+ - 09ec440d-c44f-41bc-a697-dff470e9b026
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=11
date:
- - Mon, 06 Jul 2020 22:22:33 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -44,7 +44,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '10'
+ - '5'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_user_agent.yaml
index 172dc9ec7370..ac51c536f619 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_user_agent.yaml
@@ -18,20 +18,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 74139c1a-94fd-4eba-84c8-a37c3412cd98
+ - 7712c14a-3f22-4b1b-9378-cded10398f1f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -39,7 +39,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '8'
+ - '7'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_dont_use_language_hint.yaml
index 5f51e5127d73..0642e4d6ccb0 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_dont_use_language_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":["best day","life"],"warnings":[]},{"id":"1","keyPhrases":["hotel"],"warnings":[]},{"id":"2","keyPhrases":["restaurant"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - d2a1ad1f-bc28-4854-b5fc-0b9e3cc4885b
+ - dcbc480a-b83b-4875-951d-b1f0808781ff
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint.yaml
index d883f1003ed0..acb236b7fe7f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":["This was the best day","my"],"warnings":[]},{"id":"1","keyPhrases":["like
@@ -26,13 +26,13 @@ interactions:
good as I hoped","The restaurant was"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 43037573-051e-4321-aa6d-0d75bb7bd777
+ - 591564a0-8960-4793-a5ed-27b29b170cfd
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '5'
+ - '6'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
index 44fac10fa33f..709c70cb588c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["the park","I will go"],"warnings":[]},{"id":"2","keyPhrases":["I
@@ -26,13 +26,13 @@ interactions:
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 9bc4deab-818d-48b9-a685-1f0589f4e3e6
+ - 3035fd59-72f5-4179-aaf1-a205b8757b5d
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '5'
+ - '10'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_obj_input.yaml
index 34c6430028e3..aa90729092a6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_obj_input.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: "{\"documents\":[{\"id\":\"1\",\"keyPhrases\":[\"should take my cat\
@@ -28,13 +28,13 @@ interactions:
:[],\"modelVersion\":\"2019-10-01\"}"
headers:
apim-request-id:
- - c7570d27-625f-46e9-9349-ed32cebf05d1
+ - 663df110-444c-4687-bb63-fa20b4d13725
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -42,7 +42,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '3'
+ - '4'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
index e6eb5a52324d..800922c5a264 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: "{\"documents\":[{\"id\":\"1\",\"keyPhrases\":[\"I should take my cat\"\
@@ -28,13 +28,13 @@ interactions:
:\"2019-10-01\"}"
headers:
apim-request-id:
- - c2ac0619-accc-4b19-8e9e-3c834eaf6f6e
+ - 976fb829-fca1-461b-9365-4e8d496841e0
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:39 GMT
+ - Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -42,7 +42,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '5'
+ - '6'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_all_successful_passing_dict.yaml
index 0c7dbcb88ddf..e348ccce2359 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_all_successful_passing_dict.yaml
@@ -13,23 +13,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=true
response:
body:
string: '{"statistics":{"documentsCount":2,"validDocumentsCount":2,"erroneousDocumentsCount":0,"transactionsCount":2},"documents":[{"id":"1","keyPhrases":["Bill
Gates","Paul Allen","Microsoft"],"statistics":{"charactersCount":50,"transactionsCount":1},"warnings":[]},{"id":"2","keyPhrases":["Bill
Gates","Paul Allen","Microsoft"],"statistics":{"charactersCount":49,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 41620549-572b-42eb-9550-4f4122209501
+ apim-request-id: 464b770a-6eba-46c4-90b1-4aee87689925
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=2
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '6'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_all_successful_passing_text_document_input.yaml
index 4e1a7f5133a0..75571dc691bf 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_all_successful_passing_text_document_input.yaml
@@ -13,22 +13,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["Bill Gates","Paul Allen","Microsoft"],"warnings":[]},{"id":"2","keyPhrases":["Bill
Gates","Paul Allen","Microsoft"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 6e921974-2404-4794-8386-5a2a163afbc6
+ apim-request-id: 52d19de4-ae26-435c-8c3a-6adb16619cca
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=2
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '6'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_bad_credentials.yaml
index 950d185a7706..957dcaabd35f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_bad_credentials.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:50 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_bad_model_version_error.yaml
index 69950a350aa2..af73617e8de3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_bad_model_version_error.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2019-10-01"}}}'
headers:
- apim-request-id: ad6c4f88-075d-455d-9b0e-50cef2d496ca
+ apim-request-id: 2fb9b99b-0e5f-41c6-91eb-7d089b18eb3c
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '4'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?model-version=bad&showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?model-version=bad&showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_batch_size_over_limit.yaml
index 4fb10e84a56a..9f6d45a9e1c1 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_batch_size_over_limit.yaml
@@ -756,21 +756,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: 283ad302-0efb-4899-8f74-3562c0a94027
+ apim-request-id: bf8d8f75-d1cc-4a1f-ac3a-19305d8affd0
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '19'
+ x-envoy-upstream-service-time: '35'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_batch_size_over_limit_error.yaml
index 6293e3ad8dea..693910a6250c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_batch_size_over_limit_error.yaml
@@ -721,21 +721,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: 9f3e87fc-b78f-4729-9dad-a062b8a3fd55
+ apim-request-id: 16b64a34-7382-45f0-abd6-c3a2245ffea1
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '31'
+ x-envoy-upstream-service-time: '19'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_client_passed_default_language_hint.yaml
index f9f931d6b203..c37b01483b15 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_client_passed_default_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_client_passed_default_language_hint.yaml
@@ -14,25 +14,25 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["the park","I will go"],"warnings":[]},{"id":"2","keyPhrases":["I
did not like the hotel we stayed at"],"warnings":[]},{"id":"3","keyPhrases":["The
restaurant had really good food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: a82137d6-c881-4094-959b-8460800f84eb
+ apim-request-id: 3fea7699-b489-4d16-befe-a15b61dd98bc
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -48,24 +48,24 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: f644ba79-4276-4925-8eae-544c3a1ec865
+ apim-request-id: 78f8ac1e-1eda-42b5-89d8-1c6e03d095cd
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '8'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -81,23 +81,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["the park","I will go"],"warnings":[]},{"id":"2","keyPhrases":["I
did not like the hotel we stayed at"],"warnings":[]},{"id":"3","keyPhrases":["The
restaurant had really good food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: e6b570c1-e428-4375-8f50-d6cdd7bd5dae
+ apim-request-id: f454c8b4-7e92-45da-ac98-62d6f080ac74
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '6'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_attribute_error_no_result_attribute.yaml
index 149f02f216b4..85862cbb606f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_attribute_error_no_result_attribute.yaml
@@ -11,17 +11,17 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: ae11300e-26d8-4017-8802-f8d607c334b1
+ apim-request-id: beb8aede-873f-43f1-ae0c-da559b8db8ef
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=0
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -29,5 +29,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_attribute_error_nonexistent_attribute.yaml
index 417aa718a043..8747168d77bf 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_attribute_error_nonexistent_attribute.yaml
@@ -11,17 +11,17 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 104fc8de-6246-4b4f-a214-a9214c0493f3
+ apim-request-id: f73240a0-3f35-4ce7-876a-a9bd7756d3b7
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=0
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -29,5 +29,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_errors.yaml
index b04a67d82281..63c4981b1c4e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_errors.yaml
@@ -14,29 +14,29 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"A
document within the request was too large to be processed. Limit document
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 74912856-8241-49bb-a09d-4a3dba7d33d8
+ apim-request-id: 4035421d-154f-459b-aa89-76e8bf964b26
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=0
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '3'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_warnings.yaml
index f8afec5a0e13..d3b33e2881e9 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_document_warnings.yaml
@@ -12,23 +12,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["Thisisaveryveryverylongtextwhichgoesonforalongtimeandwhichalmost"],"warnings":[{"code":"LongWordsInDocument","message":"The
document contains very long words (longer than 64 characters). These words
will be truncated and may result in unreliable model predictions."}]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: c33ef0f8-1d74-4be7-9dbd-44bc24e79d3d
+ apim-request-id: ed062a5f-71a5-4c7e-bb2c-a3e4ecf91d34
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '5'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_duplicate_ids_error.yaml
index 9af0d93a58f0..917748bd5598 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_duplicate_ids_error.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
- apim-request-id: 670a1889-8c6b-4a4d-bd9a-fc3b7afe5f10
+ apim-request-id: a0a74962-faea-471e-a3c8-7f7c589d6530
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '6'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_empty_credential_class.yaml
index 33f73da0f41b..68820e3601d3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_empty_credential_class.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_input_with_all_errors.yaml
index 9b7db2155108..fb949b174560 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_input_with_all_errors.yaml
@@ -13,25 +13,25 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 5d9da846-cb89-4325-9a4d-cff54293aa3e
+ apim-request-id: 872df718-1a9c-4980-b0ad-beeaa4a686b0
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=0
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '5'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_input_with_some_errors.yaml
index d039afd03d28..6a6a7f6e6416 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_input_with_some_errors.yaml
@@ -13,23 +13,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"2","keyPhrases":["Bill Gates","Paul Allen","Microsoft"],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 5c6f2448-b881-48dc-b4dc-6d90709a99fd
+ apim-request-id: acc1d893-8446-4a6c-9430-c0c78e15c58b
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '8'
+ x-envoy-upstream-service-time: '5'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_invalid_language_hint_docs.yaml
index eb76a427c0d9..a47122c371db 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_invalid_language_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_invalid_language_hint_docs.yaml
@@ -12,17 +12,17 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: ea0ffb1b-791e-46c7-9546-ba4275150223
+ apim-request-id: baf4943d-29d8-41d0-98c7-62ec2c9a249c
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=0
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -30,5 +30,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_invalid_language_hint_method.yaml
index eae1d4963d78..3442ff379ff2 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_invalid_language_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_invalid_language_hint_method.yaml
@@ -12,23 +12,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: da,de,en,es,fi,fr,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv"}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 65354389-6419-4e01-ac33-f866e55c389a
+ apim-request-id: 0953a5d2-ac21-4231-b2ca-80aa5b5cfa59
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=0
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '4'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_language_kwarg_spanish.yaml
index 4ea759b8bad8..2d90abe85eb3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_language_kwarg_spanish.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_language_kwarg_spanish.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","keyPhrases":["Bill
Gates","the CEO of Microsoft"],"statistics":{"charactersCount":35,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: b3e1bf3a-525e-4dbf-8629-9d5791b83d11
+ apim-request-id: adf9177c-740e-4b86-a2d0-0248f31e811e
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '6'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_out_of_order_ids.yaml
index ab1f75baa6e5..422d3c16d2c3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_out_of_order_ids.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"56","keyPhrases":[],"warnings":[]},{"id":"0","keyPhrases":[],"warnings":[]},{"id":"19","keyPhrases":[],"warnings":[]},{"id":"1","keyPhrases":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: a2ee111d-8f66-43b0-80eb-6972199e4d5e
+ apim-request-id: 0b0a2a0c-c8ba-4ec5-b784-f3ea7d2427bf
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:47 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '8'
+ x-envoy-upstream-service-time: '5'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_output_same_order_as_input.yaml
index e4079228c88c..93e3e865b662 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_output_same_order_as_input.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":[],"warnings":[]},{"id":"2","keyPhrases":[],"warnings":[]},{"id":"3","keyPhrases":[],"warnings":[]},{"id":"4","keyPhrases":[],"warnings":[]},{"id":"5","keyPhrases":[],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: f11432d5-8a79-4e7d-baaa-e1b62ffd4bb2
+ apim-request-id: 6e5dcf93-10c4-4fb0-8927-8c72d8a3d789
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=5
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '4'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_pass_cls.yaml
index f7ef066326aa..08d6e479b828 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_pass_cls.yaml
@@ -12,15 +12,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":["Test","cls","endpoint"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 4201d461-6861-4564-a05a-1212af038ce5
+ apim-request-id: 6d3aabd0-1930-46d5-a7d8-1119e6a9b3bf
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -28,5 +28,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_passing_only_string.yaml
index 38e72fe11623..3001b5098263 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_passing_only_string.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":["Bill Gates","Paul Allen","Microsoft"],"warnings":[]},{"id":"1","keyPhrases":["Microsoft
@@ -22,16 +22,16 @@ interactions:
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 3a07a0cd-c96d-4f31-8a89-a7595be2f917
+ apim-request-id: b570e13a-871e-447f-94b2-df06d49687ca
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=2
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '6'
+ x-envoy-upstream-service-time: '5'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_per_item_dont_use_language_hint.yaml
index e6263935f9f1..aa76cfea8e4e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_per_item_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_per_item_dont_use_language_hint.yaml
@@ -14,22 +14,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: b6efe781-17a4-4c26-ae4f-7017dd9e5a6d
+ apim-request-id: e073e0bb-f79e-4988-bbfa-4234a11e54d1
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:39 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '6'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_rotate_subscription_key.yaml
index 95b9ec4be9ee..1683cb51c50a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_rotate_subscription_key.yaml
@@ -14,16 +14,16 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 4b3796fa-a8d9-478c-a334-fcffac10343a
+ apim-request-id: c5c76435-0a9f-44ea-bb29-96ecde9dd1a5
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -31,7 +31,7 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -47,7 +47,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -55,11 +55,11 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -75,22 +75,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 704a13b1-fb4d-4dee-a86d-a749276ae3c0
+ apim-request-id: 3d1162fe-4397-4e24-8300-5735162763e1
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '6'
+ x-envoy-upstream-service-time: '8'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_show_stats_and_model_version.yaml
index 66b46778d457..b3b9cd278b21 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_show_stats_and_model_version.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","keyPhrases":[],"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"0","keyPhrases":[],"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"19","keyPhrases":[],"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]},{"id":"1","keyPhrases":[],"statistics":{"charactersCount":2,"transactionsCount":1},"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 6fc6b769-973e-4549-b60f-56d4fc374a26
+ apim-request-id: e2903f20-e815-4a70-8c06-e2daaad408ea
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_too_many_documents.yaml
index da5f036d638e..df8cb68ee8ff 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_too_many_documents.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_too_many_documents.yaml
@@ -17,7 +17,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":[],"warnings":[]},{"id":"1","keyPhrases":[],"warnings":[]},{"id":"2","keyPhrases":[],"warnings":[]},{"id":"3","keyPhrases":[],"warnings":[]},{"id":"4","keyPhrases":[],"warnings":[]},{"id":"5","keyPhrases":[],"warnings":[]},{"id":"6","keyPhrases":[],"warnings":[]},{"id":"7","keyPhrases":[],"warnings":[]},{"id":"8","keyPhrases":[],"warnings":[]},{"id":"9","keyPhrases":[],"warnings":[]},{"id":"10","keyPhrases":[],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
@@ -25,16 +25,16 @@ interactions:
number of documents in the request have exceeded the data limitations. See
https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 146279f0-8cf2-4535-9b76-c747d7ac701d
+ apim-request-id: e01332a2-e954-4808-a67d-16aeb9a9ea60
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=11
- date: Mon, 06 Jul 2020 22:22:33 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '21'
+ x-envoy-upstream-service-time: '7'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_user_agent.yaml
index 64da18f77a3d..1cc306759409 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_user_agent.yaml
@@ -14,22 +14,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["park"],"warnings":[]},{"id":"2","keyPhrases":["hotel"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: c02fba21-470c-4f74-a4ef-f7081f63761f
+ apim-request-id: 0adeaded-6610-43a7-bd39-dfc2058d0522
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '5'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_dont_use_language_hint.yaml
index 726afe21b821..b8d00f9fc54e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_dont_use_language_hint.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":["best day","life"],"warnings":[]},{"id":"1","keyPhrases":["hotel"],"warnings":[]},{"id":"2","keyPhrases":["restaurant"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: c2166cf3-51b0-492e-aacf-9151d5302b7d
+ apim-request-id: eebf745d-da7e-4d36-9bd6-6043ddb2208f
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '6'
+ x-envoy-upstream-service-time: '12'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint.yaml
index 5ed9f3420854..4438365ff9ce 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"0","keyPhrases":["This was the best day","my"],"warnings":[]},{"id":"1","keyPhrases":["like
the hotel we stayed","It was too expensive","I did"],"warnings":[]},{"id":"2","keyPhrases":["as
good as I hoped","The restaurant was"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: b92e8ca9-b15f-4f70-be41-a694d3f34215
+ apim-request-id: 6c82c32f-6052-4964-98b9-b2b1e74e51e9
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '9'
+ x-envoy-upstream-service-time: '12'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
index a862f9e97f87..28f0dbc7ef6f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: '{"documents":[{"id":"1","keyPhrases":["the park","I will go"],"warnings":[]},{"id":"2","keyPhrases":["I
did not like the hotel we stayed at"],"warnings":[]},{"id":"3","keyPhrases":["restaurant","good
food"],"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
- apim-request-id: 146636cd-ef70-4d54-a4d0-d2a706fbec6c
+ apim-request-id: e484df49-591e-4abb-b2a1-423e001e2c2d
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:40 GMT
+ date: Fri, 24 Jul 2020 16:32:48 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '5'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_obj_input.yaml
index 0748e4f779f2..de6fffd8bb09 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_obj_input.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: "{\"documents\":[{\"id\":\"1\",\"keyPhrases\":[\"should take my cat\
@@ -23,16 +23,16 @@ interactions:
3\",\"keyPhrases\":[\"\u732B\u306F\u5E78\u305B\"],\"warnings\":[]}],\"errors\"\
:[],\"modelVersion\":\"2019-10-01\"}"
headers:
- apim-request-id: 0c786bea-b13a-4a88-8877-f3496e1adccb
+ apim-request-id: 5b1d04ff-ac44-45a5-bc93-ef5662f0530f
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '7'
+ x-envoy-upstream-service-time: '12'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
index a3d928f6f559..ce4f0f23da89 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_extract_key_phrases_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/keyPhrases?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/keyPhrases?showStats=false
response:
body:
string: "{\"documents\":[{\"id\":\"1\",\"keyPhrases\":[\"I should take my cat\"\
@@ -23,16 +23,16 @@ interactions:
:[\"\u732B\u306F\u5E78\u305B\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\"\
:\"2019-10-01\"}"
headers:
- apim-request-id: 5afe9b4e-5340-4884-8456-7999ff9910ff
+ apim-request-id: 36700dd7-4ea9-41e0-9476-5d063f1ff835
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '6'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/keyPhrases?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/keyPhrases?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_all_successful_passing_dict.yaml
index 75cc5a5a52c8..ca94c5cd398b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_all_successful_passing_dict.yaml
@@ -19,7 +19,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=2020-02-01&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=2020-02-01&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","statistics":{"charactersCount":68,"transactionsCount":1},"entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":1.0},{"text":"Bill
@@ -34,13 +34,13 @@ interactions:
Allen","category":"Person","offset":52,"length":10,"confidenceScore":0.98}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 9b1ce967-31fc-43ec-aba0-b2eadc6f4948
+ - e3dfc9b0-ff48-46af-a97e-ed1646abcd2f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -48,7 +48,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '82'
+ - '88'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_all_successful_passing_text_document_input.yaml
index 163910268564..383331f428a8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_all_successful_passing_text_document_input.yaml
@@ -19,7 +19,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=2020-02-01&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=2020-02-01&showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":1.0},{"text":"Bill
@@ -34,13 +34,13 @@ interactions:
Allen","category":"Person","offset":52,"length":10,"confidenceScore":0.98}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 72338736-1693-4a47-994e-8dc31b2f1e32
+ - 8971f287-f80e-49c1-a177-655d2160a528
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -48,7 +48,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '76'
+ - '84'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_bad_credentials.yaml
index 50e2843267d2..6b015f7602e6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_bad_credentials.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_bad_model_version_error.yaml
index 47aad93f9077..d7ed8fb43d12 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_bad_model_version_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2020-04-01,2019-10-01,2020-02-01"}}}'
headers:
apim-request-id:
- - 397b0efa-d690-4a97-80f5-bc778f13d24b
+ - ce6f5d5a-370e-4cdc-9aa7-dd226a7a4863
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '5'
+ - '12'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_batch_size_over_limit.yaml
index d33db9afb6c6..9a6ffff43606 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_batch_size_over_limit.yaml
@@ -760,18 +760,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - 70d965f0-ca04-4ece-9ecb-37c10a25d2cd
+ - 11413a6a-19cc-499d-b510-7abf522c78c9
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -779,7 +779,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '212'
+ - '13'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_batch_size_over_limit_error.yaml
index 1de80057faa8..3e17dc694447 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_batch_size_over_limit_error.yaml
@@ -725,18 +725,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - fcb03bb8-08a9-4b8b-988b-f144bf687441
+ - 6b6dafcc-307b-4724-b4b4-fbdda466e279
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -744,7 +744,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '10'
+ - '12'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_client_passed_default_language_hint.yaml
index f77998047cd8..0f94473a2d14 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_client_passed_default_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_client_passed_default_language_hint.yaml
@@ -18,19 +18,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: '{"documents":[{"id":"1","entities":[{"text":"I will go to the park","category":"Product","offset":0,"length":21,"confidenceScore":0.51}],"warnings":[]},{"id":"2","entities":[{"text":"hotel
+ we stayed at","category":"Location","offset":19,"length":18,"confidenceScore":0.69}],"warnings":[]},{"id":"3","entities":[{"text":"The
+ restaurant had really good food","category":"Organization","offset":0,"length":35,"confidenceScore":0.47}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - f148cbcd-9c20-487d-a1be-e3e4188f64dc
+ - 342b3816-dc70-4b3b-95e8-106e58e0b4e6
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '13'
+ - '61'
status:
code: 200
message: OK
@@ -61,19 +63,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 0027e7fa-cb78-4018-a3f4-c92e306df94d
+ - 00a84aaa-fdcf-483d-85ce-2ef1dfac66e6
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -81,7 +83,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '115'
+ - '73'
status:
code: 200
message: OK
@@ -104,19 +106,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: '{"documents":[{"id":"1","entities":[{"text":"I will go to the park","category":"Product","offset":0,"length":21,"confidenceScore":0.51}],"warnings":[]},{"id":"2","entities":[{"text":"hotel
+ we stayed at","category":"Location","offset":19,"length":18,"confidenceScore":0.69}],"warnings":[]},{"id":"3","entities":[{"text":"The
+ restaurant had really good food","category":"Organization","offset":0,"length":35,"confidenceScore":0.47}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - d93fcac2-c89d-4da9-ac2c-cb116e2f2858
+ - f0ec3d64-b04b-403e-bc89-c288f3fe7475
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -124,7 +128,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '13'
+ - '81'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_attribute_error_no_result_attribute.yaml
index 3ad946f3eb0f..c4fddfd62061 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_attribute_error_no_result_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,11 +23,11 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 3bca820e-a077-4af1-a897-c0d57770e022
+ - d80ef079-8ec4-4c05-9aa4-29b1653ef594
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:43 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_attribute_error_nonexistent_attribute.yaml
index 6b35b9ca97fa..89712ab2afc6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_attribute_error_nonexistent_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,11 +23,11 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - c2a99feb-feb9-4bf7-94db-d475c7bb39e8
+ - 5c7ee3ca-6114-464a-9769-60f5e3173194
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:43 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_errors.yaml
index 4438a2853f88..356ae6746102 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_errors.yaml
@@ -18,25 +18,25 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"A
document within the request was too large to be processed. Limit document
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 49e3839e-66d6-4516-bb8e-06f7d621e566
+ - 22fde167-8a5f-48c0-92d6-dc9b182e9555
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:40 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_warnings.yaml
index aa6764133500..612d1d1012d5 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_document_warnings.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - f1796c03-2d2b-4fa3-a5a6-1a113505a6e3
+ - cce93ad3-6587-4c7f-9cd9-c70935c8c98b
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '70'
+ - '82'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_duplicate_ids_error.yaml
index 40df34b85a3d..3606553dc3b1 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_duplicate_ids_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
apim-request-id:
- - e2acf14c-7ee1-4e6d-9779-23d3e37140a0
+ - 22777aa3-46e1-4f56-9b09-d5f8e2ed6b1f
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_empty_credential_class.yaml
index ad53ab6ccdef..0bf3e2c9b502 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_empty_credential_class.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_input_with_all_errors.yaml
index f9ec4768dd2b..ec8a08ec1faa 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_input_with_all_errors.yaml
@@ -16,23 +16,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - ac462e27-de99-4e0f-ad3e-64febff5c468
+ - 6d299485-1450-403e-a59b-d7c9139cef37
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:45 GMT
+ - Fri, 24 Jul 2020 16:32:49 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '1'
+ - '2'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_input_with_some_errors.yaml
index bab59726c6a0..ed080baa7132 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_input_with_some_errors.yaml
@@ -17,26 +17,26 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":0.8},{"text":"Bill
Gates","category":"Person","offset":25,"length":10,"confidenceScore":0.83},{"text":"Paul
Allen","category":"Person","offset":40,"length":10,"confidenceScore":0.87},{"text":"April
4, 1975","category":"DateTime","subcategory":"Date","offset":54,"length":13,"confidenceScore":0.8}],"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 79086bb3-5557-40d1-9b45-5d815ea01f58
+ - 0c7cc811-d948-4c84-98d7-774033dfd78a
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -44,7 +44,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '89'
+ - '90'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_invalid_language_hint_docs.yaml
index 9f72ccfa9238..3fa77ef7ac1a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_invalid_language_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_invalid_language_hint_docs.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - bf5ac76b-8682-452e-9a69-819ca40ea24f
+ - bdbdc474-4c6f-4347-aacf-e3f8254f1d55
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_invalid_language_hint_method.yaml
index ee46fe96e558..0a30ef06b2e3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_invalid_language_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_invalid_language_hint_method.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 6f9fa2a2-93ae-4c85-87f0-5ba1223005ca
+ - 4122d8f9-dece-44fa-8013-762c68e5f39f
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '10'
+ - '2'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_language_kwarg_spanish.yaml
index e5961d2512d0..37e476374402 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_language_kwarg_spanish.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_language_kwarg_spanish.yaml
@@ -16,20 +16,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","statistics":{"charactersCount":35,"transactionsCount":1},"entities":[{"text":"Bill
- Gates","category":"Person","offset":0,"length":10,"confidenceScore":0.8},{"text":"Microsoft","category":"Organization","offset":25,"length":9,"confidenceScore":0.98}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ Gates","category":"Person","offset":0,"length":10,"confidenceScore":0.76},{"text":"CEO","category":"PersonType","offset":18,"length":3,"confidenceScore":0.66},{"text":"Microsoft","category":"Organization","offset":25,"length":9,"confidenceScore":0.38}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 1381e5ce-b989-4dbc-b46b-8f27b6d8618c
+ - 298936b7-c69e-42a0-9a2d-022af7bb194e
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -37,7 +37,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '13'
+ - '68'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_out_of_order_ids.yaml
index 79f62addde58..e4a82a33a073 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_out_of_order_ids.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"56","entities":[],"warnings":[]},{"id":"0","entities":[],"warnings":[]},{"id":"19","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 6b54fffb-6297-475e-9c5f-0a9b5fb28df4
+ - 29dc84bc-9b70-4330-a52d-12d9be9d78da
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '68'
+ - '73'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_output_same_order_as_input.yaml
index b9246f89217f..aae6b9d409e1 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_output_same_order_as_input.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"one","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]},{"id":"2","entities":[{"text":"two","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]},{"id":"3","entities":[{"text":"three","category":"Quantity","subcategory":"Number","offset":0,"length":5,"confidenceScore":0.8}],"warnings":[]},{"id":"4","entities":[{"text":"four","category":"Quantity","subcategory":"Number","offset":0,"length":4,"confidenceScore":0.8}],"warnings":[]},{"id":"5","entities":[{"text":"five","category":"Quantity","subcategory":"Number","offset":0,"length":4,"confidenceScore":0.8}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 641ce3f1-d60e-41bd-a147-6a772cb86ca6
+ - e249c914-10ec-4c5f-9590-1f41588fe23d
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=5
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '316'
+ - '152'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_pass_cls.yaml
index c4f077303e2b..304715f4aa1e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_pass_cls.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"0","entities":[{"text":"cls","category":"Skill","offset":13,"length":3,"confidenceScore":0.8}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: '{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - b1bbd14d-adbd-42e8-a42b-20065364c3ec
+ - 164da941-5c73-4d83-8c1b-315cabcdd588
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '72'
+ - '67'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_passing_only_string.yaml
index cb3645932dec..cc1c71b81d0a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_passing_only_string.yaml
@@ -20,7 +20,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":0.81},{"text":"Bill
@@ -34,13 +34,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - b11e4dfd-da87-4084-b07b-a6bcb5ef1f0c
+ - 15d71555-b5cb-413d-9b3d-166b4758bb39
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -48,7 +48,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '148'
+ - '94'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_per_item_dont_use_language_hint.yaml
index b723469c3579..abbd3bd809a7 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_per_item_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_per_item_dont_use_language_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 59e2c37b-83bf-435a-9e55-59849412270a
+ - db979dc4-7d21-4303-b7f8-ccc249dd07c1
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '79'
+ - '145'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_rotate_subscription_key.yaml
index bf7c187bccf4..e76eb90795ad 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_rotate_subscription_key.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 7aa8830a-fa01-4f68-844d-bd923b68d806
+ - 228b889f-1a77-4e5b-9684-8019d12fbee0
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '193'
+ - '108'
status:
code: 200
message: OK
@@ -61,7 +61,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -71,7 +71,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:50 GMT
status:
code: 401
message: PermissionDenied
@@ -94,19 +94,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - ef2edc89-7a18-48fc-a0b9-e6d0e6444f6b
+ - 095e5155-4e34-4253-ab44-036cd49dc859
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -114,7 +114,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '76'
+ - '83'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_show_stats_and_model_version.yaml
index e8475879ee24..f56b980e6b7f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_show_stats_and_model_version.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 85031a5c-a87d-48c3-a75d-6c186ef714ad
+ - 8111d7b3-6440-4173-af2d-c2cf6fc44a2d
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '64'
+ - '69'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_too_many_documents.yaml
index 14d768500cbc..a0257f4c84f8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_too_many_documents.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_too_many_documents.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[{"text":"One","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]},{"id":"1","entities":[{"text":"Two","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]},{"id":"2","entities":[{"text":"Three","category":"Quantity","subcategory":"Number","offset":0,"length":5,"confidenceScore":0.8}],"warnings":[]},{"id":"3","entities":[{"text":"Four","category":"Quantity","subcategory":"Number","offset":0,"length":4,"confidenceScore":0.8}],"warnings":[]},{"id":"4","entities":[{"text":"Five","category":"Quantity","subcategory":"Number","offset":0,"length":4,"confidenceScore":0.8}],"warnings":[]},{"id":"5","entities":[{"text":"Six","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
@@ -27,13 +27,13 @@ interactions:
https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 13bd2b1b-b7be-4027-9876-67cdc993bba4
+ - 2292583c-7682-4b41-b8c1-debe740a4816
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=6
date:
- - Mon, 06 Jul 2020 22:22:33 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '74'
+ - '107'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_user_agent.yaml
index e49afa3fa981..0179474a4584 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_user_agent.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - f9f5e830-c5f5-4188-9dc6-178a6a5647e2
+ - be80426a-5177-4171-b20e-baa9ec3a37b0
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '80'
+ - '111'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_dont_use_language_hint.yaml
index 7027c303b8c2..09c0d3c229ea 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_dont_use_language_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"2","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.71}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 4d04d901-d793-410d-9814-9c99a488b5ad
+ - 8f74198d-98bd-4fcf-9ce6-65492f247cd0
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '115'
+ - '110'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint.yaml
index 52cbc035d3db..88f438df0a9f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 47343887-c4ca-4875-8d45-16b4fc146c5e
+ - b804738c-5f66-4e20-a0b8-3d3fd6be556f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '24'
+ - '29'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
index 6756193f0852..e1f42559c91d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -18,19 +18,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: '{"documents":[{"id":"1","entities":[{"text":"I will go to the park","category":"Product","offset":0,"length":21,"confidenceScore":0.51}],"warnings":[]},{"id":"2","entities":[{"text":"hotel
+ we stayed at","category":"Location","offset":19,"length":18,"confidenceScore":0.69}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - 23626692-e370-436b-a7ed-90cc41d25abc
+ - 15be8002-652a-437e-b9bf-1c375d135407
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +39,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '111'
+ - '107'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_obj_input.yaml
index 06f48252e840..054df131fcb3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_obj_input.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
apim-request-id:
- - a90536d4-7890-48b3-8a92-9742393e9013
+ - 85b2dec7-9000-4fe0-b616-0910ce07d02d
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:41 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '15'
+ - '18'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
index 8c14c6073a76..b85c9f57bef9 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -18,19 +18,25 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[{"text":"un","category":"Quantity","subcategory":"Number","offset":8,"length":2,"confidenceScore":0.8}],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: "{\"documents\":[{\"id\":\"1\",\"entities\":[],\"warnings\":[]},{\"\
+ id\":\"2\",\"entities\":[{\"text\":\"un\",\"category\":\"Quantity\",\"subcategory\"\
+ :\"Number\",\"offset\":8,\"length\":2,\"confidenceScore\":0.8},{\"text\":\"\
+ Espa\xF1ol\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\"\
+ :31,\"length\":7,\"confidenceScore\":0.5}],\"warnings\":[]},{\"id\":\"3\"\
+ ,\"entities\":[],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"\
+ }"
headers:
apim-request-id:
- - 0b239455-aaf6-4134-a284-45b2130c6b5c
+ - cfb3fb7f-cb3e-43b6-a060-9c6f39c8d9c5
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:42 GMT
+ - Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +44,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '64'
+ - '94'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_all_successful_passing_dict.yaml
index 50f1e637c1d1..b244316fbf84 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_all_successful_passing_dict.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=2020-02-01&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=2020-02-01&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","statistics":{"charactersCount":68,"transactionsCount":1},"entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":1.0},{"text":"Bill
@@ -29,16 +29,16 @@ interactions:
Gates","category":"Person","offset":37,"length":10,"confidenceScore":0.86},{"text":"Paul
Allen","category":"Person","offset":52,"length":10,"confidenceScore":0.98}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 0baa79dd-b11c-4061-b835-fbbcb609053a
+ apim-request-id: 65f18a29-41aa-4fba-9778-be7079694cc2
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '79'
+ x-envoy-upstream-service-time: '88'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?model-version=2020-02-01&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?model-version=2020-02-01&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_all_successful_passing_text_document_input.yaml
index dc8a701de973..1fdb8e8cde58 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_all_successful_passing_text_document_input.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=2020-02-01&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=2020-02-01&showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":1.0},{"text":"Bill
@@ -29,16 +29,16 @@ interactions:
Gates","category":"Person","offset":37,"length":10,"confidenceScore":0.86},{"text":"Paul
Allen","category":"Person","offset":52,"length":10,"confidenceScore":0.98}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: e87e5480-0183-4c67-b1c3-8e4206970c40
+ apim-request-id: de39f48c-2692-4b86-b691-f49d4dcceab2
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:41 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '87'
+ x-envoy-upstream-service-time: '93'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?model-version=2020-02-01&showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?model-version=2020-02-01&showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_bad_credentials.yaml
index c033e6455106..6e3b0bab2fcb 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_bad_credentials.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_bad_model_version_error.yaml
index b0aad90ee7a1..0969624290c7 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_bad_model_version_error.yaml
@@ -12,15 +12,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2020-04-01,2019-10-01,2020-02-01"}}}'
headers:
- apim-request-id: 2e4a2fd5-f550-476d-b9e8-021218fb98ce
+ apim-request-id: 04f62dd7-a44c-4135-b65e-0d0351808aae
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -28,5 +28,5 @@ interactions:
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?model-version=bad&showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?model-version=bad&showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_batch_size_over_limit.yaml
index 1cf3a75c0e2a..5587fd087d15 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_batch_size_over_limit.yaml
@@ -756,21 +756,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: f962f17c-2975-47b3-917c-e9ebf889fa04
+ apim-request-id: 78247336-f4e0-4a31-a834-2357afed21d4
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '10'
+ x-envoy-upstream-service-time: '11'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_batch_size_over_limit_error.yaml
index b3f6eef43787..3763483bb092 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_batch_size_over_limit_error.yaml
@@ -721,21 +721,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: 8c5c8818-eeec-48d2-badc-0791366baa47
+ apim-request-id: 266bd6e9-198a-4d14-968c-0710f8682550
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '9'
+ x-envoy-upstream-service-time: '16'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_client_passed_default_language_hint.yaml
index e8127cdabc5b..f86c8d7b564e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_client_passed_default_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_client_passed_default_language_hint.yaml
@@ -14,23 +14,25 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: '{"documents":[{"id":"1","entities":[{"text":"I will go to the park","category":"Product","offset":0,"length":21,"confidenceScore":0.51}],"warnings":[]},{"id":"2","entities":[{"text":"hotel
+ we stayed at","category":"Location","offset":19,"length":18,"confidenceScore":0.69}],"warnings":[]},{"id":"3","entities":[{"text":"The
+ restaurant had really good food","category":"Organization","offset":0,"length":35,"confidenceScore":0.47}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: cc90f8eb-1d91-4de7-9baf-c8ed6de1b59d
+ apim-request-id: c807c077-38db-4b7b-ba0a-ee9502dab692
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '17'
+ x-envoy-upstream-service-time: '100'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -46,23 +48,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: eebfe636-180f-470b-88ea-35f862960eff
+ apim-request-id: dfd5420f-7d9a-447b-b0ed-e73e2134a521
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '176'
+ x-envoy-upstream-service-time: '91'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -78,21 +80,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: '{"documents":[{"id":"1","entities":[{"text":"I will go to the park","category":"Product","offset":0,"length":21,"confidenceScore":0.51}],"warnings":[]},{"id":"2","entities":[{"text":"hotel
+ we stayed at","category":"Location","offset":19,"length":18,"confidenceScore":0.69}],"warnings":[]},{"id":"3","entities":[{"text":"The
+ restaurant had really good food","category":"Organization","offset":0,"length":35,"confidenceScore":0.47}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: a779a176-96b4-49aa-8634-97a9c2677743
+ apim-request-id: 15295932-e4ca-4ccb-a8a4-56768029c3d7
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '14'
+ x-envoy-upstream-service-time: '72'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_attribute_error_no_result_attribute.yaml
index a5d81026fea1..7f94b5b0c563 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_attribute_error_no_result_attribute.yaml
@@ -11,16 +11,16 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 3ac14a39-7b5f-44d1-9b0c-d79b4bdddb0d
+ apim-request-id: ec05cc81-df53-4da6-ba92-98d31bb54813
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:50 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -28,5 +28,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
index fe02c039607b..ffbcc08f6dac 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
@@ -11,22 +11,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: a8fac211-958d-4a9d-993d-d4ea1c526f50
+ apim-request-id: 65f42798-dd03-4b83-b1d6-c70e16b99b89
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '2'
+ x-envoy-upstream-service-time: '1'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_errors.yaml
index daa82ba2b7e0..cdb73c08388e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_errors.yaml
@@ -14,22 +14,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"A
document within the request was too large to be processed. Limit document
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 8beca0f1-2c2e-4808-b6aa-14028a18fc75
+ apim-request-id: 5c1dfd56-c75f-4dc3-b297-015654437160
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -37,5 +37,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_warnings.yaml
index 001171bb0eeb..193db94e9024 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_document_warnings.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 5a477d67-6a79-4938-8064-3799caca55ed
+ apim-request-id: e2244930-e473-41d9-b5b1-c0162734d1f4
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '75'
+ x-envoy-upstream-service-time: '85'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_duplicate_ids_error.yaml
index 79438cfbaf57..e02ef044ac94 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_duplicate_ids_error.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
- apim-request-id: 65bc5068-5170-4b9b-8dff-0d1e41458848
+ apim-request-id: b05a5a13-40b6-4e2c-95f4-c98bc597975e
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '5'
+ x-envoy-upstream-service-time: '4'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_empty_credential_class.yaml
index c033e6455106..d1b952033c44 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_empty_credential_class.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_input_with_all_errors.yaml
index 3e3f25eeef6d..a56c9c12a720 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_input_with_all_errors.yaml
@@ -12,20 +12,20 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 83c7e8ee-4ed9-43b9-b36e-2b214f4ba53b
+ apim-request-id: 0cc28fef-6973-45ef-b30a-267724521a35
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -33,5 +33,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_input_with_some_errors.yaml
index 800541329ee9..2c9c16650ccc 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_input_with_some_errors.yaml
@@ -13,28 +13,28 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":0.8},{"text":"Bill
Gates","category":"Person","offset":25,"length":10,"confidenceScore":0.83},{"text":"Paul
Allen","category":"Person","offset":40,"length":10,"confidenceScore":0.87},{"text":"April
4, 1975","category":"DateTime","subcategory":"Date","offset":54,"length":13,"confidenceScore":0.8}],"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 48f84373-3062-4c45-b2bd-7305c77b41e0
+ apim-request-id: da486603-eafc-4a26-9ccb-ea18c5b95944
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '88'
+ x-envoy-upstream-service-time: '93'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_invalid_language_hint_docs.yaml
index bb2e5a3e675f..ff4504546ba4 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_invalid_language_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_invalid_language_hint_docs.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 8ce2e723-4a25-4f3e-a4af-fcebfdf93fb5
+ apim-request-id: db2fb1e1-cec1-4cdf-8bcc-d0b8794ca04f
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '1'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_invalid_language_hint_method.yaml
index 2ded0204ae1c..05e9bf9f5c6f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_invalid_language_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_invalid_language_hint_method.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}}],"modelVersion":"2020-04-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: ar,cs,da,de,en,es,fi,fr,hu,it,ja,ko,nl,no,pl,pt-BR,pt-PT,ru,sv,tr,zh-Hans"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 49ca5f18-80d0-4f88-b0e9-ce4132cc32e9
+ apim-request-id: 5df1ec1a-e306-45c8-a4fa-97dab0aeba98
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '2'
+ x-envoy-upstream-service-time: '1'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_language_kwarg_spanish.yaml
index 76c6f9f174ac..c1a5eeb39aad 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_language_kwarg_spanish.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_language_kwarg_spanish.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","statistics":{"charactersCount":35,"transactionsCount":1},"entities":[{"text":"Bill
- Gates","category":"Person","offset":0,"length":10,"confidenceScore":0.8},{"text":"Microsoft","category":"Organization","offset":25,"length":9,"confidenceScore":0.98}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ Gates","category":"Person","offset":0,"length":10,"confidenceScore":0.76},{"text":"CEO","category":"PersonType","offset":18,"length":3,"confidenceScore":0.66},{"text":"Microsoft","category":"Organization","offset":25,"length":9,"confidenceScore":0.38}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 78a0c930-341b-4604-8495-c791e1f8199d
+ apim-request-id: ca3cc0b1-7bb8-4193-9f3d-a04f73c4c1f7
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '13'
+ x-envoy-upstream-service-time: '62'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_out_of_order_ids.yaml
index ae0d28d1bbaa..a0338f84e728 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_out_of_order_ids.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"56","entities":[],"warnings":[]},{"id":"0","entities":[],"warnings":[]},{"id":"19","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 5ebce000-a362-4988-b3e1-9eebe0ac7166
+ apim-request-id: f4ca3d49-d617-47a7-876f-60b885a7535c
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '71'
+ x-envoy-upstream-service-time: '61'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_output_same_order_as_input.yaml
index ff32caf8ef49..cbd04542a68e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_output_same_order_as_input.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"one","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]},{"id":"2","entities":[{"text":"two","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]},{"id":"3","entities":[{"text":"three","category":"Quantity","subcategory":"Number","offset":0,"length":5,"confidenceScore":0.8}],"warnings":[]},{"id":"4","entities":[{"text":"four","category":"Quantity","subcategory":"Number","offset":0,"length":4,"confidenceScore":0.8}],"warnings":[]},{"id":"5","entities":[{"text":"five","category":"Quantity","subcategory":"Number","offset":0,"length":4,"confidenceScore":0.8}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: ac7283eb-05ef-45ac-b53c-27405d8a6567
+ apim-request-id: da2ea466-6b82-479a-9a41-4aae33901ae0
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=5
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '78'
+ x-envoy-upstream-service-time: '71'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_pass_cls.yaml
index fad0bea98242..9b48654a25b8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_pass_cls.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"0","entities":[{"text":"cls","category":"Skill","offset":13,"length":3,"confidenceScore":0.8}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: '{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 28ef150e-34a9-47eb-be18-eb495588a669
+ apim-request-id: 4743fbf1-d4ec-4d08-873d-1dcf8a29053b
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '68'
+ x-envoy-upstream-service-time: '65'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_passing_only_string.yaml
index 3db838c74db5..a57d9db3919e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_passing_only_string.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":0.81},{"text":"Bill
@@ -29,16 +29,16 @@ interactions:
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 152851fc-8cac-44a2-94f6-71b927d63a34
+ apim-request-id: 17178476-3e07-4c7f-8185-db701b1beaf5
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '87'
+ x-envoy-upstream-service-time: '92'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_per_item_dont_use_language_hint.yaml
index 86d4665a0a44..e13f580ffdea 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_per_item_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_per_item_dont_use_language_hint.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: e2730442-ed85-488f-8f04-7117e56ae0fa
+ apim-request-id: 01d8b8d7-1bc1-4406-9ff9-a1fbb40607da
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '69'
+ x-envoy-upstream-service-time: '121'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_rotate_subscription_key.yaml
index 3935f4fe1f5e..d28746a24408 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_rotate_subscription_key.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 41e46e75-b982-4461-858e-540697d42fed
+ apim-request-id: b2e5da80-6835-4217-b8c9-45c5d90bf02f
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:51 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '92'
+ x-envoy-upstream-service-time: '120'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -46,7 +46,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -54,11 +54,11 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -74,21 +74,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: bc939d4b-7fa9-4e85-80fb-25f35f334a56
+ apim-request-id: 5ec4a9bc-24ce-458c-abd6-0a14e25a76d5
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '91'
+ x-envoy-upstream-service-time: '90'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_show_stats_and_model_version.yaml
index 74fedd3981e5..f13bdf3b6c76 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_show_stats_and_model_version.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: f640379e-1959-4ddb-99bb-bf580e8e807e
+ apim-request-id: a017cf5d-14bf-4770-876b-83b85788be2a
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:42 GMT
+ date: Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '62'
+ x-envoy-upstream-service-time: '64'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_too_many_documents.yaml
index 32d35f7ea164..dd53667a3e03 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_too_many_documents.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_too_many_documents.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[{"text":"One","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]},{"id":"1","entities":[{"text":"Two","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]},{"id":"2","entities":[{"text":"Three","category":"Quantity","subcategory":"Number","offset":0,"length":5,"confidenceScore":0.8}],"warnings":[]},{"id":"3","entities":[{"text":"Four","category":"Quantity","subcategory":"Number","offset":0,"length":4,"confidenceScore":0.8}],"warnings":[]},{"id":"4","entities":[{"text":"Five","category":"Quantity","subcategory":"Number","offset":0,"length":4,"confidenceScore":0.8}],"warnings":[]},{"id":"5","entities":[{"text":"Six","category":"Quantity","subcategory":"Number","offset":0,"length":3,"confidenceScore":0.8}],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
@@ -22,16 +22,16 @@ interactions:
number of documents in the request have exceeded the data limitations. See
https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 3363e7d4-6b71-46d9-90e0-af1c5b778ee0
+ apim-request-id: 1f335d86-bb3d-48b0-89ab-ea502b6083fb
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=6
- date: Mon, 06 Jul 2020 22:22:33 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '85'
+ x-envoy-upstream-service-time: '99'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_user_agent.yaml
index 4a7adac62b07..76fdc3052dbd 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_user_agent.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"text":"park","category":"Location","offset":17,"length":4,"confidenceScore":0.83}],"warnings":[]},{"id":"2","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 75664d8c-6b61-4940-aff2-fe887f3ed8ee
+ apim-request-id: c7083a40-622b-488b-b4bd-961f5e62a67b
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '74'
+ x-envoy-upstream-service-time: '116'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_dont_use_language_hint.yaml
index 690d4e049df3..3a610051ab9e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_dont_use_language_hint.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[{"text":"hotel","category":"Location","offset":19,"length":5,"confidenceScore":0.76}],"warnings":[]},{"id":"2","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.71}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 36e64223-80c8-476d-bf09-d23fd038c9d1
+ apim-request-id: 627a7869-2975-4ef0-ae1b-387d14a8fce8
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '103'
+ x-envoy-upstream-service-time: '126'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint.yaml
index a5da2d5b3050..311a177a89d7 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 211c167b-4e43-48b1-806b-21f9f10ee330
+ apim-request-id: 92d3687d-0881-49e8-a51e-40b944ef39d4
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '33'
+ x-envoy-upstream-service-time: '28'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
index 5f3f8a3b0fe6..58eb01977232 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -14,21 +14,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: '{"documents":[{"id":"1","entities":[{"text":"I will go to the park","category":"Product","offset":0,"length":21,"confidenceScore":0.51}],"warnings":[]},{"id":"2","entities":[{"text":"hotel
+ we stayed at","category":"Location","offset":19,"length":18,"confidenceScore":0.69}],"warnings":[]},{"id":"3","entities":[{"text":"restaurant","category":"Location","subcategory":"Structural","offset":4,"length":10,"confidenceScore":0.7}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: 86cf81a2-1fd3-4c8b-9325-161eee86ba5e
+ apim-request-id: 0e548cbb-aca0-4e8d-b7c1-f8822f33fffa
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:44 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '94'
+ x-envoy-upstream-service-time: '72'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
index 4e2a244ea1f8..59beeea616e8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
headers:
- apim-request-id: be2962db-3260-42ce-8f1a-a215c9eb6eb0
+ apim-request-id: 5666c40f-8046-40b8-b517-d3c5a026a701
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:43 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '19'
+ x-envoy-upstream-service-time: '22'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
index 0920162593a9..4eb073ad334b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -14,21 +14,27 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
response:
body:
- string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[{"text":"un","category":"Quantity","subcategory":"Number","offset":8,"length":2,"confidenceScore":0.8}],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ string: "{\"documents\":[{\"id\":\"1\",\"entities\":[],\"warnings\":[]},{\"\
+ id\":\"2\",\"entities\":[{\"text\":\"un\",\"category\":\"Quantity\",\"subcategory\"\
+ :\"Number\",\"offset\":8,\"length\":2,\"confidenceScore\":0.8},{\"text\":\"\
+ Espa\xF1ol\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\"\
+ :31,\"length\":7,\"confidenceScore\":0.5}],\"warnings\":[]},{\"id\":\"3\"\
+ ,\"entities\":[],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"\
+ }"
headers:
- apim-request-id: 6ced424e-c55f-4acb-a3d0-9e19390c0746
+ apim-request-id: fd2c4ed3-bda7-4bf3-aadd-80aad96825bb
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:44 GMT
+ date: Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '59'
+ x-envoy-upstream-service-time: '105'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/recognition/general?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_all_successful_passing_dict.yaml
index c780a7291862..8081c5425871 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_all_successful_passing_dict.yaml
@@ -17,7 +17,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=true
response:
body:
string: '{"statistics":{"documentsCount":2,"validDocumentsCount":2,"erroneousDocumentsCount":0,"transactionsCount":2},"documents":[{"id":"1","statistics":{"charactersCount":50,"transactionsCount":1},"entities":[{"name":"Bill
@@ -31,13 +31,13 @@ interactions:
Allen","url":"https://es.wikipedia.org/wiki/Paul_Allen","dataSource":"Wikipedia"},{"name":"Microsoft","matches":[{"text":"Microsoft","offset":0,"length":9,"confidenceScore":0.38}],"language":"es","id":"Microsoft","url":"https://es.wikipedia.org/wiki/Microsoft","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 639de9bd-815d-4548-ad3c-9537c4808327
+ - 4160c7cf-d35f-45a2-9209-016817ec43bf
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=2
date:
- - Thu, 18 Jun 2020 19:52:43 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -45,7 +45,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '52'
+ - '20'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_all_successful_passing_text_document_input.yaml
index 64db8fcb6aa0..6ec543b54ce1 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_all_successful_passing_text_document_input.yaml
@@ -17,7 +17,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"name":"Bill Gates","matches":[{"text":"Bill
@@ -31,13 +31,13 @@ interactions:
Allen","url":"https://en.wikipedia.org/wiki/Paul_Allen","dataSource":"Wikipedia"},{"name":"Microsoft","matches":[{"text":"Microsoft","offset":0,"length":9,"confidenceScore":0.49}],"language":"en","id":"Microsoft","url":"https://en.wikipedia.org/wiki/Microsoft","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 937bdac4-76ca-484a-ae8f-dde267890f68
+ - 5f47fcab-660e-4935-b27d-5fdf13438a25
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=2
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -45,7 +45,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '251'
+ - '20'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_bad_credentials.yaml
index 924026376322..2eb9944c0af7 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_bad_credentials.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:43 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_bad_model_version_error.yaml
index 9fd145f67c76..e9c3283611bc 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_bad_model_version_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2020-02-01"}}}'
headers:
apim-request-id:
- - c9ec3e73-5bc6-4efd-85b9-e408498349b2
+ - 5a1acd94-b720-40b1-a15b-b7ef2f90dec8
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_batch_size_over_limit.yaml
index 7d67fbe9485b..8297c25e994e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_batch_size_over_limit.yaml
@@ -760,18 +760,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - 97858bfc-af52-42f5-96a5-20de6513f0f4
+ - 89b8ad88-a954-4ee5-812d-a422cb2e0f5d
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -779,7 +779,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '11'
+ - '12'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_batch_size_over_limit_error.yaml
index d24285722924..bcea6315ec8a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_batch_size_over_limit_error.yaml
@@ -725,18 +725,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
apim-request-id:
- - 802cf76a-d343-463d-9b18-8696fec2f2de
+ - 3b71ea53-fcd9-4b20-b71b-8277cc1dcbec
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:43 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -744,7 +744,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '10'
+ - '22'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_client_passed_default_language_hint.yaml
index d19232205a8d..f700a02eb40d 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_client_passed_default_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_client_passed_default_language_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 90ab45ad-d5f5-4578-87d6-94ebe426f967
+ - 9b97ed9b-7e9c-4c93-a5d0-989cfed2c210
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '177'
+ - '42'
status:
code: 200
message: OK
@@ -61,19 +61,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 255ceb22-9eda-4b5e-b2a8-bd154d9227e8
+ - 5fbaf613-b88a-4f9b-8601-373d330ccb2f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -81,7 +81,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '25'
+ - '20'
status:
code: 200
message: OK
@@ -104,19 +104,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 17de2612-1bc9-4385-8a78-1017e124392f
+ - 79a31c9b-d193-4d71-b790-e709f3cbe5bf
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -124,7 +124,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '14'
+ - '25'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_attribute_error_no_result_attribute.yaml
index 1f8f47d1ecbe..596c9209ca0a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_attribute_error_no_result_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,11 +23,11 @@ interactions:
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 84905508-8936-4140-a6b2-1c5c1684f6a3
+ - 0647649b-3e29-4733-9699-54140928dace
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:43 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_attribute_error_nonexistent_attribute.yaml
index 355c415c2d2e..f0a223af119b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_attribute_error_nonexistent_attribute.yaml
@@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
@@ -23,11 +23,11 @@ interactions:
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - b311142a-dca6-4700-8f86-cae3d66c4e2e
+ - 00434868-b438-4f14-be49-9ae5697a23f6
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_errors.yaml
index 2a0270e9dcc2..cace20eda695 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_errors.yaml
@@ -18,25 +18,25 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"A
document within the request was too large to be processed. Limit document
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 707c8c6d-016b-4b57-8085-70f0e4c70309
+ - b8e50cf6-c03e-4a1f-bc00-a7e81b96985b
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_warnings.yaml
index 939073c4e30e..2ebfcdba1d1c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_document_warnings.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 641d43fc-98a8-427b-91e8-78b780173073
+ - 5ec736e9-b7a7-4a08-96d6-7e02203f65ec
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '273'
+ - '23'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_duplicate_ids_error.yaml
index 65f6bc214ffc..b1f33b78ff9e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_duplicate_ids_error.yaml
@@ -16,18 +16,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
apim-request-id:
- - 6e961c70-b6d9-4ca4-8cff-cf01865c5587
+ - d11116e6-97e4-4297-8f54-157582fb352f
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:43 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -35,7 +35,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '4'
+ - '6'
status:
code: 400
message: Bad Request
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_empty_credential_class.yaml
index 6d27ca57ea82..2eb9944c0af7 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_empty_credential_class.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -26,7 +26,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:52 GMT
status:
code: 401
message: PermissionDenied
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_input_with_all_errors.yaml
index 2d5cc28160c1..f7908518ea2c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_input_with_all_errors.yaml
@@ -16,21 +16,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 583748c3-4088-44a1-8fdd-95f700132b6c
+ - ad7decfd-817a-48e9-bebc-d1e79cc9604c
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_input_with_some_errors.yaml
index 1c91225788fa..ba563211c819 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_input_with_some_errors.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"2","entities":[{"name":"Bill Gates","matches":[{"text":"Bill
@@ -28,13 +28,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - b66fc535-9c11-4875-b544-a0cd320e41e6
+ - 0f59c287-eec4-49b2-b08a-6ebb4e17e394
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -42,7 +42,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '19'
+ - '13'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_invalid_language_hint_docs.yaml
index 249a700fc949..be9f1639a9f7 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_invalid_language_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_invalid_language_hint_docs.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 4f639cfa-e3eb-472f-9133-90c2e3ff0126
+ - 4521f87f-478b-4e8e-a4c5-9dc4947060cb
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_invalid_language_hint_method.yaml
index 09187dc23b7f..64b39a83a709 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_invalid_language_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_invalid_language_hint_method.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 91a9bbbd-10be-4a78-982d-872cb4cd3124
+ - 8c47d0e8-47c6-44e5-b024-a564b2a10892
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:43 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '2'
+ - '1'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_language_kwarg_spanish.yaml
index 4541061d7453..32b2dbd4f830 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_language_kwarg_spanish.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_language_kwarg_spanish.yaml
@@ -16,7 +16,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","statistics":{"charactersCount":35,"transactionsCount":1},"entities":[{"name":"Bill
@@ -26,13 +26,13 @@ interactions:
ejecutivo","url":"https://es.wikipedia.org/wiki/Director_ejecutivo","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 0db9ed9d-ca58-45e3-9bef-0ff18be1b7fa
+ - 3c3df070-832f-433d-a960-661858c31770
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '24'
+ - '36'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_out_of_order_ids.yaml
index 4ce54961f363..a92eeada9df6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_out_of_order_ids.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"56","entities":[],"warnings":[]},{"id":"0","entities":[],"warnings":[]},{"id":"19","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 18e0fc16-4aa4-4ffc-b5c0-c5bf44e69ef2
+ - e9fe43da-5048-4601-ae76-d14971f580f7
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:45 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '74'
+ - '19'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_output_same_order_as_input.yaml
index 5573ca82eee2..442d6710a57f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_output_same_order_as_input.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"5","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - fa82cfe2-df6b-4cec-9831-35b7672a292d
+ - 5f52dbac-3707-4243-89ad-713e7734a26f
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=5
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '16'
+ - '18'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_pass_cls.yaml
index 1f76e7fa8b65..812e74443d80 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_pass_cls.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[{"name":".test","matches":[{"text":"Test","offset":0,"length":4,"confidenceScore":0.02}],"language":"en","id":".test","url":"https://en.wikipedia.org/wiki/.test","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 7085e6dd-d559-4c78-b4a3-4a0f2ae9af91
+ - 6ad14174-59e4-402a-9f53-a2a0453d3d53
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -36,7 +36,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '29'
+ - '18'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_passing_only_string.yaml
index 204243cff44e..e0f941ac68bb 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_passing_only_string.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[{"name":"Bill Gates","matches":[{"text":"Bill
@@ -34,13 +34,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 637a210e-0525-4656-8e69-e1db41009b9a
+ - 36282cc5-775e-4aa3-92db-b8e94a992869
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=2
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -48,7 +48,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '24'
+ - '26'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_per_item_dont_use_language_hint.yaml
index c8dba7f79748..021514242ec0 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_per_item_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_per_item_dont_use_language_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - c4a12641-a4fb-4ee0-98ae-73eb65f0da53
+ - 0f81e4d1-7751-414f-9e05-0ac33fbb8fe2
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:45 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_rotate_subscription_key.yaml
index 1db03a6b1b37..c2890b573267 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_rotate_subscription_key.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - d0dc74a2-d2c4-4912-9f86-ce2ebd00a8d4
+ - 7ad4d363-7984-4215-b5ac-4a8bda5a5be9
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '20'
+ - '19'
status:
code: 200
message: OK
@@ -61,7 +61,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -71,7 +71,7 @@ interactions:
content-length:
- '224'
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
status:
code: 401
message: PermissionDenied
@@ -94,19 +94,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - c4d93d17-6db2-47f3-b56b-3afbcf4abc77
+ - 87848571-95b8-4913-9c27-18e9948ae0b2
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -114,7 +114,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '18'
+ - '22'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_show_stats_and_model_version.yaml
index 9e5c654462b6..29d560d86b2f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_show_stats_and_model_version.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
@@ -26,13 +26,13 @@ interactions:
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 2cf15d2d-4d0e-432f-baf4-6b22ca7b26fd
+ - 4a1c7b65-8307-4589-9aab-5cbf2c6f4e0a
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=4
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -40,7 +40,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '17'
+ - '18'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_too_many_documents.yaml
index 8c243a3095ef..a205bd47f06f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_too_many_documents.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_too_many_documents.yaml
@@ -18,7 +18,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"5","entities":[],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
@@ -27,13 +27,13 @@ interactions:
https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 80077607-e16a-48eb-b1e5-1247121a5c56
+ - a163297b-80a2-4153-8ca7-401355eb6b28
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=6
date:
- - Mon, 06 Jul 2020 22:22:34 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -41,7 +41,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '21'
+ - '17'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_user_agent.yaml
index 744b9698420f..d6a2345d9dca 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_user_agent.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 0d2fa015-f696-4a6f-ad2f-42928701eae7
+ - 58643084-7b61-4e27-b8eb-3d22d4ccfcc6
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_dont_use_language_hint.yaml
index 5b9b9c588ca7..509f22dce9c8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_dont_use_language_hint.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 2abe30d7-e5fe-4514-a62e-42bc7274b346
+ - c9c49a5a-3366-4063-8620-8c2d9d27580a
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '22'
+ - '19'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint.yaml
index f85d3b0fa78d..b69363e4c942 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint.yaml
@@ -18,23 +18,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 7ec846dd-a0d8-44d8-be7d-7ed954bfa876
+ - fc5cfbb4-cc8b-4fdd-80b7-364697293a7b
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -42,7 +42,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '3'
+ - '1'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
index c0745b87352d..96a5d19f6c58 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - 96fe5585-5684-4112-9f18-8f301b9e3a47
+ - 65d883bb-fea9-4e90-82cb-3356318d9bb0
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '18'
+ - '17'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_obj_input.yaml
index dcd18183ece2..ccf0d2918aaa 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_obj_input.yaml
@@ -18,23 +18,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"4","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"4","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - a1f35ef7-90ec-463e-a943-e9b8545fb87e
+ - eb99cec2-70e8-47d0-922e-a897d2f9dea5
content-type:
- application/json; charset=utf-8
date:
- - Thu, 18 Jun 2020 19:52:45 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
index fec0ef493de0..d69172a02a62 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -18,19 +18,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
apim-request-id:
- - ea5da2e6-79b9-4a62-94a5-1cc5381326d6
+ - f4c781bb-17f4-4015-9e6b-9db07f45f60d
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=3
date:
- - Thu, 18 Jun 2020 19:52:44 GMT
+ - Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
@@ -38,7 +38,7 @@ interactions:
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- - '31'
+ - '20'
status:
code: 200
message: OK
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_all_successful_passing_dict.yaml
index cd5da10873f4..20c88ee25b33 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_all_successful_passing_dict.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_all_successful_passing_dict.yaml
@@ -13,7 +13,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=true
response:
body:
string: '{"statistics":{"documentsCount":2,"validDocumentsCount":2,"erroneousDocumentsCount":0,"transactionsCount":2},"documents":[{"id":"1","statistics":{"charactersCount":50,"transactionsCount":1},"entities":[{"name":"Bill
@@ -26,16 +26,16 @@ interactions:
Allen","matches":[{"text":"Paul Allen","offset":39,"length":10,"confidenceScore":0.9}],"language":"es","id":"Paul
Allen","url":"https://es.wikipedia.org/wiki/Paul_Allen","dataSource":"Wikipedia"},{"name":"Microsoft","matches":[{"text":"Microsoft","offset":0,"length":9,"confidenceScore":0.38}],"language":"es","id":"Microsoft","url":"https://es.wikipedia.org/wiki/Microsoft","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 873308a2-fc3f-4a18-8f13-bf1648ead697
+ apim-request-id: fd94c924-ab60-44f2-93e3-b10acccde0d5
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=2
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '17'
+ x-envoy-upstream-service-time: '19'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_all_successful_passing_text_document_input.yaml
index f6c0fb7840aa..726f4d4ebb69 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_all_successful_passing_text_document_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_all_successful_passing_text_document_input.yaml
@@ -13,7 +13,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[{"name":"Bill Gates","matches":[{"text":"Bill
@@ -26,16 +26,16 @@ interactions:
Allen","matches":[{"text":"Paul Allen","offset":39,"length":10,"confidenceScore":0.55}],"language":"en","id":"Paul
Allen","url":"https://en.wikipedia.org/wiki/Paul_Allen","dataSource":"Wikipedia"},{"name":"Microsoft","matches":[{"text":"Microsoft","offset":0,"length":9,"confidenceScore":0.49}],"language":"en","id":"Microsoft","url":"https://en.wikipedia.org/wiki/Microsoft","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 5ac156ce-1932-4c3e-a8f3-de976d743792
+ apim-request-id: 025755c7-b02e-47c8-9a7d-9bc05b057cc3
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=2
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '19'
+ x-envoy-upstream-service-time: '20'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_bad_credentials.yaml
index 248682b28b6f..f6eb4a8b8c7b 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_bad_credentials.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_bad_credentials.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:44 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_bad_model_version_error.yaml
index caf7efe08a92..1ed7dca17f7a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_bad_model_version_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_bad_model_version_error.yaml
@@ -12,15 +12,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?model-version=bad&showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?model-version=bad&showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
model version. Possible values are: latest,2020-02-01"}}}'
headers:
- apim-request-id: 7838c220-c22f-42cc-a75f-fae421688cb8
+ apim-request-id: 7249675b-85f5-4e8d-9419-edbce42d40d7
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -28,5 +28,5 @@ interactions:
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?model-version=bad&showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?model-version=bad&showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_batch_size_over_limit.yaml
index ee5b518b7da3..ef2eee9b4e86 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_batch_size_over_limit.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_batch_size_over_limit.yaml
@@ -756,15 +756,15 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: 108853c2-dedc-46cb-a77d-5f46c22641e4
+ apim-request-id: fbca31f1-04a0-43ca-b267-d90d406db170
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -772,5 +772,5 @@ interactions:
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_batch_size_over_limit_error.yaml
index 5caeecb5ad5e..ea4099b21f85 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_batch_size_over_limit_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_batch_size_over_limit_error.yaml
@@ -721,21 +721,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
request contains too many records. Max 1000 records are permitted."}}}'
headers:
- apim-request-id: 8e74553e-6e90-4da4-949e-88bd9a7290c6
+ apim-request-id: 6007033c-e14d-4fb2-ac42-b20824683b0f
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '11'
+ x-envoy-upstream-service-time: '16'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_client_passed_default_language_hint.yaml
index bcf00b057950..3d22cf0baafc 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_client_passed_default_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_client_passed_default_language_hint.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 16d85b26-cb10-4ece-9d88-d4e7d5f79689
+ apim-request-id: 469f7ac4-71a1-480a-b677-32c9cb37b495
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '89'
+ x-envoy-upstream-service-time: '25'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -46,23 +46,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 9d8295bb-a419-432c-964f-12c3bb197b29
+ apim-request-id: 50825193-f63a-4938-ac9c-474c0666b202
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '22'
+ x-envoy-upstream-service-time: '20'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -78,21 +78,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: eae7e7a8-cd06-41c1-8bb3-5221b2caad77
+ apim-request-id: 22af470d-c9e3-482a-8ea1-e545a027c842
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '28'
+ x-envoy-upstream-service-time: '16'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_attribute_error_no_result_attribute.yaml
index 54ee1957503a..277ae06a996c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_attribute_error_no_result_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_attribute_error_no_result_attribute.yaml
@@ -11,16 +11,16 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 457562ee-9746-4c35-a677-2b774ddb351f
+ apim-request-id: e46f5195-cac5-4ad6-93d7-adc35e71c844
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -28,5 +28,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
index 21dfe5dafd05..73b70a3026a2 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
@@ -11,16 +11,16 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: d9745e6b-f786-4e5e-a5ce-39eb2b238cf8
+ apim-request-id: c7da8cc2-d67a-429e-9e7b-3ea1135082d8
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -28,5 +28,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_errors.yaml
index 822f452aac16..98228f15b915 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_errors.yaml
@@ -14,28 +14,28 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"A
document within the request was too large to be processed. Limit document
size to: 5120 text elements. For additional details on the data limitations
see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: df5a1469-80f3-4c6c-9536-f2dda34e0878
+ apim-request-id: 1efcd7ae-7817-4d9d-b7d7-4488c750ab2f
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '2'
+ x-envoy-upstream-service-time: '1'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_warnings.yaml
index d548e120db16..942af5ce87ee 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_warnings.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_document_warnings.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 4656bdb9-bb0b-4a64-a308-037fa01a3624
+ apim-request-id: 17bf9844-ece6-48bf-9846-ea55e0e21a9b
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '20'
+ x-envoy-upstream-service-time: '18'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_duplicate_ids_error.yaml
index 36adac21fb4f..18868d4215e6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_duplicate_ids_error.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_duplicate_ids_error.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
contains duplicated Ids. Make sure each document has a unique Id."}}}'
headers:
- apim-request-id: 56148473-19a0-4b12-b48a-2d27af1a4c6b
+ apim-request-id: 2161000b-0b54-49f5-b803-2a0aeea14b11
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:44 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '4'
+ x-envoy-upstream-service-time: '7'
status:
code: 400
message: Bad Request
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_empty_credential_class.yaml
index 37eadeb4c104..eb3ca2a20d64 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_empty_credential_class.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_empty_credential_class.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -20,9 +20,9 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:53 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_input_with_all_errors.yaml
index 937ffdf6adb1..80c2a8cd4708 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_input_with_all_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_input_with_all_errors.yaml
@@ -12,18 +12,18 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: ef616f01-1d39-4aae-b018-83002eaeac21
+ apim-request-id: 537d5f63-cf53-4a58-a44e-1ef5c3049ed5
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -31,5 +31,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_input_with_some_errors.yaml
index ffa37c273b22..1c9b300eea9c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_input_with_some_errors.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_input_with_some_errors.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"2","entities":[{"name":"Bill Gates","matches":[{"text":"Bill
@@ -23,16 +23,16 @@ interactions:
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: e8fbb53e-b8aa-4b23-a522-4b74dca6b062
+ apim-request-id: b9b8759e-0f33-43bc-8cc2-aa235472e7d0
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:53 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '14'
+ x-envoy-upstream-service-time: '15'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_invalid_language_hint_docs.yaml
index c9714647cba5..66f8999cda44 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_invalid_language_hint_docs.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_invalid_language_hint_docs.yaml
@@ -12,22 +12,22 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: a9f69703-ddff-42ee-9fd1-c737a6c8028a
+ apim-request-id: 77dfcf1f-3432-445d-8c41-2b7f61d12d66
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '1'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_invalid_language_hint_method.yaml
index e5871942c63b..800c87068757 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_invalid_language_hint_method.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_invalid_language_hint_method.yaml
@@ -12,16 +12,16 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 5663d178-a0c8-46d3-92c2-eba0db279364
+ apim-request-id: 0977ae21-8661-4ad2-b74f-aaea52b10322
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
@@ -29,5 +29,5 @@ interactions:
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_language_kwarg_spanish.yaml
index a6ba0f9d05d2..b2d8a03cb497 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_language_kwarg_spanish.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_language_kwarg_spanish.yaml
@@ -12,7 +12,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","statistics":{"charactersCount":35,"transactionsCount":1},"entities":[{"name":"Bill
@@ -21,16 +21,16 @@ interactions:
ejecutivo","matches":[{"text":"CEO","offset":18,"length":3,"confidenceScore":0.22}],"language":"es","id":"Director
ejecutivo","url":"https://es.wikipedia.org/wiki/Director_ejecutivo","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 486e6daa-c6c9-4e99-8669-7d3dcc61a706
+ apim-request-id: 96d24414-61f1-45e4-b0ba-2d79ba7b7157
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '13'
+ x-envoy-upstream-service-time: '12'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_out_of_order_ids.yaml
index 1b58fe09910a..f532f47567b6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_out_of_order_ids.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_out_of_order_ids.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"56","entities":[],"warnings":[]},{"id":"0","entities":[],"warnings":[]},{"id":"19","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 448b3d66-db2d-4d64-ac01-1fa1cec902cd
+ apim-request-id: 33247fd1-7a5b-4d05-be46-212e9d179ebb
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '25'
+ x-envoy-upstream-service-time: '20'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_output_same_order_as_input.yaml
index 77c0cbf5d20c..56b28a32d832 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_output_same_order_as_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_output_same_order_as_input.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"5","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 74f31d77-d16f-4d42-a664-f98ea95a97e2
+ apim-request-id: 229ba3d2-0692-4ebd-ad22-0bdd986e7777
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=5
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '20'
+ x-envoy-upstream-service-time: '17'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_pass_cls.yaml
index fa95dfaed3f7..a2bc3802c12f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_pass_cls.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_pass_cls.yaml
@@ -12,21 +12,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[{"name":".test","matches":[{"text":"Test","offset":0,"length":4,"confidenceScore":0.02}],"language":"en","id":".test","url":"https://en.wikipedia.org/wiki/.test","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 9d40ffbb-1856-4e65-890b-14614eab37e5
+ apim-request-id: 95399e26-fec8-4c71-bf46-41c6d8344ef5
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '17'
+ x-envoy-upstream-service-time: '18'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_passing_only_string.yaml
index 1f924cb6d4be..5b581412c8a3 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_passing_only_string.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_passing_only_string.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[{"name":"Bill Gates","matches":[{"text":"Bill
@@ -29,16 +29,16 @@ interactions:
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: ff3d956d-5a92-4b5a-8fb1-a1bb685b915c
+ apim-request-id: 6e846d7b-c38e-4e85-96d5-881a966bb493
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=2
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '20'
+ x-envoy-upstream-service-time: '15'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_per_item_dont_use_language_hint.yaml
index 55f9c4e27540..2e9ba11c2b9f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_per_item_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_per_item_dont_use_language_hint.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 8d2fc071-b6b0-4b8e-9998-7f454e8b16b4
+ apim-request-id: 9fe7703b-6ba0-45d5-9ec6-8ee4ecc734e0
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '20'
+ x-envoy-upstream-service-time: '18'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_rotate_subscription_key.yaml
index c57fe67ad559..05e14e2b178f 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_rotate_subscription_key.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_rotate_subscription_key.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: d09958e8-7678-488f-a4b4-5e67d9715eaa
+ apim-request-id: 118eda7d-ce05-4319-9113-713873ef0eed
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '21'
+ x-envoy-upstream-service-time: '18'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -46,7 +46,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
@@ -54,11 +54,11 @@ interactions:
subscription and use a correct regional API endpoint for your resource."}}'
headers:
content-length: '224'
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
status:
code: 401
message: PermissionDenied
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
- request:
body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
"en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
@@ -74,21 +74,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: bb050f03-f5c9-4f12-adc8-e12ae0596c1a
+ apim-request-id: 5c8055fc-ba3e-4a14-84be-7d445f310de1
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '33'
+ x-envoy-upstream-service-time: '21'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_show_stats_and_model_version.yaml
index cf4dc2d5ebc6..a9add4cab583 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_show_stats_and_model_version.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_show_stats_and_model_version.yaml
@@ -14,23 +14,23 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?model-version=latest&showStats=true
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?model-version=latest&showStats=true
response:
body:
string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
document in request.","innererror":{"code":"InvalidDocument","message":"Document
text is empty."}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: ded23179-cd38-4e62-ba3c-61adc204f76e
+ apim-request-id: be1949a7-90b0-442d-a5e4-d8f4f70183c2
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '19'
+ x-envoy-upstream-service-time: '17'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?model-version=latest&showStats=true
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?model-version=latest&showStats=true
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_too_many_documents.yaml
index a7d47c8d8ffd..4285f3eaeeea 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_too_many_documents.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_too_many_documents.yaml
@@ -14,7 +14,7 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"5","entities":[],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
@@ -22,16 +22,16 @@ interactions:
number of documents in the request have exceeded the data limitations. See
https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 186f9a49-84c5-4607-99c6-5652811a6a98
+ apim-request-id: 20eaf457-826e-4ef8-a088-f6c242a4cc61
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=6
- date: Mon, 06 Jul 2020 22:22:35 GMT
+ date: Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '19'
+ x-envoy-upstream-service-time: '21'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_user_agent.yaml
index e4bd2f6cb93f..8df745d5fa6a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_user_agent.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_user_agent.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 39cf1747-f01e-4d4c-b1e3-70b4e7988431
+ apim-request-id: 91c99cfb-6cff-4875-be5f-45049318de2e
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '18'
+ x-envoy-upstream-service-time: '21'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_dont_use_language_hint.yaml
index 63ac7285a8e6..d1e416480b26 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_dont_use_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_dont_use_language_hint.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: e78ce0cb-785b-4414-b17e-3d62b74d6ac0
+ apim-request-id: 5f54fc71-e850-480b-8302-1bd53fe461ca
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '23'
+ x-envoy-upstream-service-time: '22'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint.yaml
index c371fbe2d64a..db0d67dcd685 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint.yaml
@@ -14,26 +14,26 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: dfa9021c-170d-49c0-99da-18c55663a9d2
+ apim-request-id: 4793450f-091a-4a73-8e00-cef2601a1ee0
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '2'
+ x-envoy-upstream-service-time: '1'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
index 192faa77a9ea..c59970badac2 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 9e221de3-fe89-4ae2-9b6f-71a9ad4c3590
+ apim-request-id: d6f10f38-8662-4984-9298-5280bd55065d
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:46 GMT
+ date: Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '16'
+ x-envoy-upstream-service-time: '17'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
index 7ad1327611f3..cd927bfed930 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
@@ -14,26 +14,26 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"4","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
- Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Supplied
- language not supported. Pass in one of: en,es"}}}],"modelVersion":"2020-02-01"}'
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"4","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en,es"}}}],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: cf0a890b-1dbd-4bc0-b685-71b8c40ea40d
+ apim-request-id: 0e8b861c-c482-4948-8f86-06a2bd59819d
content-type: application/json; charset=utf-8
- date: Thu, 18 Jun 2020 19:52:45 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '3'
+ x-envoy-upstream-service-time: '2'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
index 687ebfe87378..b4fc91911f52 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_linked_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -14,21 +14,21 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/linking?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/linking?showStats=false
response:
body:
string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-02-01"}'
headers:
- apim-request-id: 83d64a94-0a36-423d-8b82-d49014e399ca
+ apim-request-id: a0737de8-e4ad-40d1-9709-404d4bf77a13
content-type: application/json; charset=utf-8
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
- date: Thu, 18 Jun 2020 19:52:47 GMT
+ date: Fri, 24 Jul 2020 16:32:54 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
transfer-encoding: chunked
x-content-type-options: nosniff
- x-envoy-upstream-service-time: '1040'
+ x-envoy-upstream-service-time: '28'
status:
code: 200
message: OK
- url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/entities/linking?showStats=false
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/linking?showStats=false
version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_text_analytics.test_detect_language.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_text_analytics.test_detect_language.yaml
index 8055b10aca13..c255175d949e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_text_analytics.test_detect_language.yaml
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_text_analytics.test_detect_language.yaml
@@ -16,19 +16,19 @@ interactions:
User-Agent:
- azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
method: POST
- uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/languages?showStats=false
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/languages?showStats=false
response:
body:
string: '{"documents":[{"id":"1","detectedLanguage":{"name":"English","iso6391Name":"en","confidenceScore":1.0},"warnings":[]}],"errors":[],"modelVersion":"2019-10-01"}'
headers:
apim-request-id:
- - 8f7eff6d-caa2-4867-9bd4-3c74cfa9436d
+ - 06186e79-1fdc-4e28-87cb-7e6a1422d7f1
content-type:
- application/json; charset=utf-8
csp-billing-usage:
- CognitiveServices.TextAnalytics.BatchScoring=1
date:
- - Thu, 18 Jun 2020 19:52:47 GMT
+ - Fri, 24 Jul 2020 16:32:55 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi.py
index fd9d267d8849..64633222a99a 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi.py
@@ -14,7 +14,7 @@ def test_default_api_version(self, resource_group, location, text_analytics_acco
credential = AzureKeyCredential(text_analytics_account_key)
client = TextAnalyticsClient(text_analytics_account, credential)
- assert "v3.0" in client._client._client._base_url
+ assert "v3.1-preview.1" in client._client._client._base_url
@GlobalTextAnalyticsAccountPreparer()
def test_v3_0_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
@@ -26,6 +26,6 @@ def test_v3_0_api_version(self, resource_group, location, text_analytics_account
@GlobalTextAnalyticsAccountPreparer()
def test_v3_1_preview_1_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
credential = AzureKeyCredential(text_analytics_account_key)
- client = TextAnalyticsClient(text_analytics_account, credential, api_version=ApiVersion.V3_1_preview_1)
+ client = TextAnalyticsClient(text_analytics_account, credential, api_version=ApiVersion.V3_1_PREVIEW_1)
assert "v3.1-preview.1" in client._client._client._base_url
\ No newline at end of file
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi_async.py
index 5493fdc9087b..dbd20a22218e 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi_async.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi_async.py
@@ -15,7 +15,7 @@ def test_default_api_version(self, resource_group, location, text_analytics_acco
credential = AzureKeyCredential(text_analytics_account_key)
client = TextAnalyticsClient(text_analytics_account, credential)
- assert "v3.0" in client._client._client._base_url
+ assert "v3.1-preview.1" in client._client._client._base_url
@GlobalTextAnalyticsAccountPreparer()
def test_v3_0_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
@@ -27,6 +27,6 @@ def test_v3_0_api_version(self, resource_group, location, text_analytics_account
@GlobalTextAnalyticsAccountPreparer()
def test_v3_1_preview_1_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
credential = AzureKeyCredential(text_analytics_account_key)
- client = TextAnalyticsClient(text_analytics_account, credential, api_version=ApiVersion.V3_1_preview_1)
+ client = TextAnalyticsClient(text_analytics_account, credential, api_version=ApiVersion.V3_1_PREVIEW_1)
assert "v3.1-preview.1" in client._client._client._base_url
\ No newline at end of file
From 629803468df9ffd0c3871019d874c9df4c6473dc Mon Sep 17 00:00:00 2001
From: iscai-msft <43154838+iscai-msft@users.noreply.github.com>
Date: Thu, 30 Jul 2020 11:44:40 -0400
Subject: [PATCH 2/7] [text analytics] add back PII endpoint (#12673)
---
.../azure-ai-textanalytics/CHANGELOG.md | 2 +
.../azure-ai-textanalytics/README.md | 35 +
.../azure/ai/textanalytics/__init__.py | 8 +-
.../azure/ai/textanalytics/_models.py | 79 +-
.../ai/textanalytics/_response_handlers.py | 13 +-
.../textanalytics/_text_analytics_client.py | 75 +-
.../aio/_text_analytics_client_async.py | 74 +-
.../azure-ai-textanalytics/samples/README.md | 1 +
.../sample_recognize_pii_entities_async.py | 68 ++
.../samples/sample_recognize_pii_entities.py | 60 ++
...ties.test_all_successful_passing_dict.yaml | 49 ++
...uccessful_passing_text_document_input.yaml | 49 ++
...ize_pii_entities.test_bad_credentials.yaml | 33 +
...entities.test_bad_model_version_error.yaml | 42 +
...i_entities.test_batch_size_over_limit.yaml | 786 ++++++++++++++++++
...ties.test_batch_size_over_limit_error.yaml | 751 +++++++++++++++++
...t_client_passed_default_language_hint.yaml | 139 ++++
...t_attribute_error_no_result_attribute.yaml | 42 +
...attribute_error_nonexistent_attribute.yaml | 42 +
...ize_pii_entities.test_document_errors.yaml | 51 ++
...e_pii_entities.test_document_warnings.yaml | 43 +
...pii_entities.test_duplicate_ids_error.yaml | 42 +
..._entities.test_empty_credential_class.yaml | 33 +
...i_entities.test_input_with_all_errors.yaml | 47 ++
..._entities.test_input_with_some_errors.yaml | 49 ++
...ities.test_invalid_language_hint_docs.yaml | 43 +
...ies.test_invalid_language_hint_method.yaml | 43 +
..._entities.test_language_kwarg_english.yaml | 44 +
..._entities.test_language_kwarg_spanish.yaml | 43 +
...e_pii_entities.test_length_with_emoji.yaml | 44 +
...ze_pii_entities.test_out_of_order_ids.yaml | 47 ++
...ities.test_output_same_order_as_input.yaml | 45 +
..._recognize_pii_entities.test_pass_cls.yaml | 43 +
...pii_entities.test_passing_only_string.yaml | 52 ++
....test_per_item_dont_use_language_hint.yaml | 45 +
...entities.test_rotate_subscription_key.yaml | 121 +++
...ies.test_show_stats_and_model_version.yaml | 47 ++
..._pii_entities.test_too_many_documents.yaml | 48 ++
...ecognize_pii_entities.test_user_agent.yaml | 45 +
...st_whole_batch_dont_use_language_hint.yaml | 45 +
...tities.test_whole_batch_language_hint.yaml | 49 ++
...language_hint_and_dict_per_item_hints.yaml | 49 ++
...ole_batch_language_hint_and_obj_input.yaml | 49 ++
..._language_hint_and_obj_per_item_hints.yaml | 49 ++
...sync.test_all_successful_passing_dict.yaml | 38 +
...uccessful_passing_text_document_input.yaml | 38 +
...i_entities_async.test_bad_credentials.yaml | 28 +
...es_async.test_bad_model_version_error.yaml | 32 +
...ties_async.test_batch_size_over_limit.yaml | 776 +++++++++++++++++
...sync.test_batch_size_over_limit_error.yaml | 741 +++++++++++++++++
...t_client_passed_default_language_hint.yaml | 108 +++
...t_attribute_error_no_result_attribute.yaml | 32 +
...attribute_error_nonexistent_attribute.yaml | 32 +
...i_entities_async.test_document_errors.yaml | 41 +
...entities_async.test_document_warnings.yaml | 32 +
...tities_async.test_duplicate_ids_error.yaml | 32 +
...ies_async.test_empty_credential_class.yaml | 28 +
...ties_async.test_input_with_all_errors.yaml | 37 +
...ies_async.test_input_with_some_errors.yaml | 38 +
...async.test_invalid_language_hint_docs.yaml | 33 +
...ync.test_invalid_language_hint_method.yaml | 33 +
...ies_async.test_language_kwarg_english.yaml | 33 +
...entities_async.test_length_with_emoji.yaml | 33 +
..._entities_async.test_out_of_order_ids.yaml | 36 +
...async.test_output_same_order_as_input.yaml | 34 +
...nize_pii_entities_async.test_pass_cls.yaml | 32 +
...tities_async.test_passing_only_string.yaml | 41 +
....test_per_item_dont_use_language_hint.yaml | 34 +
...es_async.test_rotate_subscription_key.yaml | 94 +++
...ync.test_show_stats_and_model_version.yaml | 36 +
...ntities_async.test_too_many_documents.yaml | 37 +
...ze_pii_entities_async.test_user_agent.yaml | 34 +
...st_whole_batch_dont_use_language_hint.yaml | 34 +
..._async.test_whole_batch_language_hint.yaml | 39 +
...language_hint_and_dict_per_item_hints.yaml | 38 +
...ole_batch_language_hint_and_obj_input.yaml | 39 +
..._language_hint_and_obj_per_item_hints.yaml | 38 +
.../tests/test_multiapi.py | 22 +-
.../tests/test_multiapi_async.py | 22 +-
.../tests/test_recognize_pii_entities.py | 566 +++++++++++++
.../test_recognize_pii_entities_async.py | 567 +++++++++++++
.../tests/test_text_analytics.py | 17 +
82 files changed, 7454 insertions(+), 35 deletions(-)
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_all_successful_passing_dict.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_all_successful_passing_text_document_input.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_bad_credentials.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_bad_model_version_error.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_batch_size_over_limit.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_batch_size_over_limit_error.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_client_passed_default_language_hint.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_attribute_error_no_result_attribute.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_attribute_error_nonexistent_attribute.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_errors.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_warnings.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_duplicate_ids_error.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_empty_credential_class.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_input_with_all_errors.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_input_with_some_errors.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_invalid_language_hint_docs.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_invalid_language_hint_method.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_language_kwarg_english.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_language_kwarg_spanish.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_length_with_emoji.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_out_of_order_ids.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_output_same_order_as_input.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_pass_cls.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_passing_only_string.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_per_item_dont_use_language_hint.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_rotate_subscription_key.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_show_stats_and_model_version.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_too_many_documents.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_user_agent.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_dont_use_language_hint.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_obj_input.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_all_successful_passing_dict.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_all_successful_passing_text_document_input.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_bad_credentials.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_bad_model_version_error.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_batch_size_over_limit.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_batch_size_over_limit_error.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_client_passed_default_language_hint.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_attribute_error_no_result_attribute.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_errors.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_warnings.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_duplicate_ids_error.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_empty_credential_class.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_input_with_all_errors.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_input_with_some_errors.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_invalid_language_hint_docs.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_invalid_language_hint_method.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_language_kwarg_english.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_length_with_emoji.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_out_of_order_ids.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_output_same_order_as_input.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_pass_cls.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_passing_only_string.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_per_item_dont_use_language_hint.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_rotate_subscription_key.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_show_stats_and_model_version.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_too_many_documents.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_user_agent.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_dont_use_language_hint.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py
create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py
diff --git a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
index ff0619621d9f..8cbe2435b6d8 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
+++ b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
@@ -2,8 +2,10 @@
## 5.0.1 (Unreleased)
+**New features**
- We are now targeting the service's v3.1-preview.1 API as the default. If you would like to still use version v3.0 of the service,
pass in `v3.0` to the kwarg `api_version` when creating your TextAnalyticsClient
+- We have added an API `recognize_pii_entities` which returns entities containing personal information for a batch of documents. Only available for API version v3.1-preview.1 and up.
## 5.0.0 (2020-07-27)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/README.md b/sdk/textanalytics/azure-ai-textanalytics/README.md
index caf4dc27f711..135d48dca39c 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/README.md
+++ b/sdk/textanalytics/azure-ai-textanalytics/README.md
@@ -4,6 +4,7 @@ Text Analytics is a cloud-based service that provides advanced natural language
* Sentiment Analysis
* Named Entity Recognition
* Linked Entity Recognition
+* Personally Identifiable Information (PII) Entity Recognition
* Language Detection
* Key Phrase Extraction
@@ -184,6 +185,7 @@ The following section provides several code snippets covering some of the most c
* [Analyze Sentiment](#analyze-sentiment "Analyze sentiment")
* [Recognize Entities](#recognize-entities "Recognize entities")
* [Recognize Linked Entities](#recognize-linked-entities "Recognize linked entities")
+* [Recognize PII Entities](#recognize-pii-entities "Recognize pii entities")
* [Extract Key Phrases](#extract-key-phrases "Extract key phrases")
* [Detect Language](#detect-language "Detect language")
@@ -290,6 +292,35 @@ The returned response is a heterogeneous list of result and error objects: list[
Please refer to the service documentation for a conceptual discussion of [entity linking][linked_entity_recognition]
and [supported types][linked_entities_categories].
+### Recognize PII entities
+[recognize_pii_entities][recognize_pii_entities] recognizes and categorizes Personally Identifiable Information (PII) entities in its input text, such as
+Social Security Numbers, bank account information, credit card numbers, and more. This endpoint is only available for v3.1-preview.1 and up.
+
+```python
+from azure.core.credentials import AzureKeyCredential
+from azure.ai.textanalytics import TextAnalyticsClient, ApiVersion
+
+credential = AzureKeyCredential("")
+endpoint="https://.api.cognitive.microsoft.com/"
+
+text_analytics_client = TextAnalyticsClient(endpoint, credential)
+
+documents = [
+ "The employee's SSN is 859-98-0987.",
+ "The employee's phone number is 555-555-5555."
+]
+response = text_analytics_client.recognize_pii_entities(documents, language="en")
+result = [doc for doc in response if not doc.is_error]
+for doc in result:
+ for entity in doc.entities:
+ print("Entity: \t", entity.text, "\tCategory: \t", entity.category,
+ "\tConfidence Score: \t", entity.confidence_score)
+```
+
+The returned response is a heterogeneous list of result and error objects: list[[RecognizePiiEntitiesResult][recognize_pii_entities_result], [DocumentError][document_error]]
+
+Please refer to the service documentation for [supported PII entity types][pii_entity_categories].
+
### Extract key phrases
[extract_key_phrases][extract_key_phrases] determines the main talking points in its input text. For example, for the input text "The food was delicious and there were wonderful staff", the API returns: "food" and "wonderful staff".
@@ -412,6 +443,7 @@ Authenticate the client with a Cognitive Services/Text Analytics API key or a to
In a batch of documents:
* Analyze sentiment: [sample_analyze_sentiment.py][analyze_sentiment_sample] ([async version][analyze_sentiment_sample_async])
* Recognize entities: [sample_recognize_entities.py][recognize_entities_sample] ([async version][recognize_entities_sample_async])
+* Recognize personally identifiable information: [sample_recognize_pii_entities.py](`https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py`)([async version](`https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py`))
* Recognize linked entities: [sample_recognize_linked_entities.py][recognize_linked_entities_sample] ([async version][recognize_linked_entities_sample_async])
* Extract key phrases: [sample_extract_key_phrases.py][extract_key_phrases_sample] ([async version][extract_key_phrases_sample_async])
* Detect language: [sample_detect_language.py][detect_language_sample] ([async version][detect_language_sample_async])
@@ -458,6 +490,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[document_error]: https://aka.ms/azsdk-python-textanalytics-documenterror
[detect_language_result]: https://aka.ms/azsdk-python-textanalytics-detectlanguageresult
[recognize_entities_result]: https://aka.ms/azsdk-python-textanalytics-recognizeentitiesresult
+[recognize_pii_entities_result]: https://aka.ms/azsdk-python-textanalytics-recognizepiientitiesresult
[recognize_linked_entities_result]: https://aka.ms/azsdk-python-textanalytics-recognizelinkedentitiesresult
[analyze_sentiment_result]: https://aka.ms/azsdk-python-textanalytics-analyzesentimentresult
[extract_key_phrases_result]: https://aka.ms/azsdk-python-textanalytics-extractkeyphrasesresult
@@ -467,6 +500,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[analyze_sentiment]: https://aka.ms/azsdk-python-textanalytics-analyzesentiment
[recognize_entities]: https://aka.ms/azsdk-python-textanalytics-recognizeentities
+[recognize_pii_entities]: https://aka.ms/azsdk-python-textanalytics-recognizepiientities
[recognize_linked_entities]: https://aka.ms/azsdk-python-textanalytics-recognizelinkedentities
[extract_key_phrases]: https://aka.ms/azsdk-python-textanalytics-extractkeyphrases
[detect_language]: https://aka.ms/azsdk-python-textanalytics-detectlanguage
@@ -477,6 +511,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[key_phrase_extraction]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-keyword-extraction
[linked_entities_categories]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/named-entity-types?tabs=general
[linked_entity_recognition]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-entity-linking
+[pii_entity_categories]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/named-entity-types?tabs=personal
[named_entity_recognition]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-entity-linking
[named_entity_categories]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/named-entity-types?tabs=general
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py
index aff577660a71..e0ac06a728c6 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py
@@ -25,7 +25,9 @@
LinkedEntityMatch,
TextDocumentBatchStatistics,
SentenceSentiment,
- SentimentConfidenceScores
+ SentimentConfidenceScores,
+ RecognizePiiEntitiesResult,
+ PiiEntity
)
__all__ = [
@@ -48,7 +50,9 @@
'LinkedEntityMatch',
'TextDocumentBatchStatistics',
'SentenceSentiment',
- 'SentimentConfidenceScores'
+ 'SentimentConfidenceScores',
+ 'RecognizePiiEntitiesResult',
+ 'PiiEntity',
]
__version__ = VERSION
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py
index a6bdf3e80a14..109c60c5fb95 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py
@@ -102,7 +102,7 @@ class RecognizeEntitiesResult(DictMixin):
:vartype entities:
list[~azure.ai.textanalytics.CategorizedEntity]
:ivar warnings: Warnings encountered while processing document. Results will still be returned
- if there are warnings, but they may not be fully accurate.
+ if there are warnings, but they may not be fully accurate.
:vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
:ivar statistics: If show_stats=true was specified in the request this
field will contain information about the document payload.
@@ -124,6 +124,40 @@ def __repr__(self):
.format(self.id, repr(self.entities), repr(self.warnings), repr(self.statistics), self.is_error)[:1024]
+class RecognizePiiEntitiesResult(DictMixin):
+ """RecognizePiiEntitiesResult is a result object which contains
+ the recognized Personally Identifiable Information (PII) entities
+ from a particular document.
+
+ :ivar str id: Unique, non-empty document identifier that matches the
+ document id that was passed in with the request. If not specified
+ in the request, an id is assigned for the document.
+ :ivar entities: Recognized PII entities in the document.
+ :vartype entities:
+ list[~azure.ai.textanalytics.PiiEntity]
+ :ivar warnings: Warnings encountered while processing document. Results will still be returned
+ if there are warnings, but they may not be fully accurate.
+ :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
+ :ivar statistics: If show_stats=true was specified in the request this
+ field will contain information about the document payload.
+ :vartype statistics:
+ ~azure.ai.textanalytics.TextDocumentStatistics
+ :ivar bool is_error: Boolean check for error item when iterating over list of
+ results. Always False for an instance of a RecognizePiiEntitiesResult.
+ """
+
+ def __init__(self, **kwargs):
+ self.id = kwargs.get("id", None)
+ self.entities = kwargs.get("entities", None)
+ self.warnings = kwargs.get("warnings", [])
+ self.statistics = kwargs.get("statistics", None)
+ self.is_error = False
+
+ def __repr__(self):
+ return "RecognizePiiEntitiesResult(id={}, entities={}, warnings={}, statistics={}, is_error={})" \
+ .format(self.id, repr(self.entities), repr(self.warnings), repr(self.statistics), self.is_error)[:1024]
+
+
class DetectLanguageResult(DictMixin):
"""DetectLanguageResult is a result object which contains
the detected language of a particular document.
@@ -135,7 +169,7 @@ class DetectLanguageResult(DictMixin):
:ivar primary_language: The primary language detected in the document.
:vartype primary_language: ~azure.ai.textanalytics.DetectedLanguage
:ivar warnings: Warnings encountered while processing document. Results will still be returned
- if there are warnings, but they may not be fully accurate.
+ if there are warnings, but they may not be fully accurate.
:vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
:ivar statistics: If show_stats=true was specified in the request this
field will contain information about the document payload.
@@ -193,6 +227,39 @@ def __repr__(self):
self.text, self.category, self.subcategory, self.confidence_score
)[:1024]
+class PiiEntity(DictMixin):
+ """PiiEntity contains information about a Personally Identifiable
+ Information (PII) entity found in text.
+
+ :ivar str text: Entity text as appears in the request.
+ :ivar str category: Entity category, such as Financial Account
+ Identification/Social Security Number/Phone Number, etc.
+ :ivar str subcategory: Entity subcategory, such as Credit Card/EU
+ Phone number/ABA Routing Numbers, etc.
+ :ivar float confidence_score: Confidence score between 0 and 1 of the extracted
+ entity.
+ """
+
+ def __init__(self, **kwargs):
+ self.text = kwargs.get('text', None)
+ self.category = kwargs.get('category', None)
+ self.subcategory = kwargs.get('subcategory', None)
+ self.confidence_score = kwargs.get('confidence_score', None)
+
+ @classmethod
+ def _from_generated(cls, entity):
+ return cls(
+ text=entity.text,
+ category=entity.category,
+ subcategory=entity.subcategory,
+ confidence_score=entity.confidence_score,
+ )
+
+ def __repr__(self):
+ return "PiiEntity(text={}, category={}, subcategory={}, confidence_score={})".format(
+ self.text, self.category, self.subcategory, self.confidence_score
+ )[:1024]
+
class TextAnalyticsError(DictMixin):
"""TextAnalyticsError contains the error code, message, and
@@ -274,7 +341,7 @@ class ExtractKeyPhrasesResult(DictMixin):
in the input document.
:vartype key_phrases: list[str]
:ivar warnings: Warnings encountered while processing document. Results will still be returned
- if there are warnings, but they may not be fully accurate.
+ if there are warnings, but they may not be fully accurate.
:vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
:ivar statistics: If show_stats=true was specified in the request this
field will contain information about the document payload.
@@ -308,7 +375,7 @@ class RecognizeLinkedEntitiesResult(DictMixin):
:vartype entities:
list[~azure.ai.textanalytics.LinkedEntity]
:ivar warnings: Warnings encountered while processing document. Results will still be returned
- if there are warnings, but they may not be fully accurate.
+ if there are warnings, but they may not be fully accurate.
:vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
:ivar statistics: If show_stats=true was specified in the request this
field will contain information about the document payload.
@@ -344,7 +411,7 @@ class AnalyzeSentimentResult(DictMixin):
'neutral', 'negative', 'mixed'
:vartype sentiment: str
:ivar warnings: Warnings encountered while processing document. Results will still be returned
- if there are warnings, but they may not be fully accurate.
+ if there are warnings, but they may not be fully accurate.
:vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
:ivar statistics: If show_stats=true was specified in the request this
field will contain information about the document payload.
@@ -429,7 +496,7 @@ def __init__(self, **kwargs):
def __getattr__(self, attr):
result_set = set()
result_set.update(
- RecognizeEntitiesResult().keys()
+ RecognizeEntitiesResult().keys() + RecognizePiiEntitiesResult().keys()
+ DetectLanguageResult().keys() + RecognizeLinkedEntitiesResult().keys()
+ AnalyzeSentimentResult().keys() + ExtractKeyPhrasesResult().keys()
)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py
index 0bef54fa0c1c..03bf101131fa 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py
@@ -24,7 +24,9 @@
DocumentError,
SentimentConfidenceScores,
TextAnalyticsError,
- TextAnalyticsWarning
+ TextAnalyticsWarning,
+ RecognizePiiEntitiesResult,
+ PiiEntity,
)
def _get_too_many_documents_error(obj):
@@ -162,3 +164,12 @@ def sentiment_result(sentiment):
confidence_scores=SentimentConfidenceScores._from_generated(sentiment.confidence_scores), # pylint: disable=protected-access
sentences=[SentenceSentiment._from_generated(s) for s in sentiment.sentences], # pylint: disable=protected-access
)
+
+@prepare_result
+def pii_entities_result(entity):
+ return RecognizePiiEntitiesResult(
+ id=entity.id,
+ entities=[PiiEntity._from_generated(e) for e in entity.entities], # pylint: disable=protected-access
+ warnings=[TextAnalyticsWarning._from_generated(w) for w in entity.warnings], # pylint: disable=protected-access
+ statistics=TextDocumentStatistics._from_generated(entity.statistics), # pylint: disable=protected-access
+ )
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py
index 15cc197d740c..c3a52be62102 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py
@@ -22,7 +22,8 @@
linked_entities_result,
key_phrases_result,
sentiment_result,
- language_result
+ language_result,
+ pii_entities_result
)
if TYPE_CHECKING:
@@ -36,6 +37,7 @@
ExtractKeyPhrasesResult,
AnalyzeSentimentResult,
DocumentError,
+ RecognizePiiEntitiesResult,
)
@@ -222,6 +224,77 @@ def recognize_entities( # type: ignore
except HttpResponseError as error:
process_batch_error(error)
+ @distributed_trace
+ def recognize_pii_entities( # type: ignore
+ self,
+ documents, # type: Union[List[str], List[TextDocumentInput], List[Dict[str, str]]]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> List[Union[RecognizePiiEntitiesResult, DocumentError]]
+ """Recognize entities containing personal information for a batch of documents.
+
+ Returns a list of personal information entities ("SSN",
+ "Bank Account", etc) in the document. For the list of supported entity types,
+ check https://aka.ms/tanerpii
+
+ See https://docs.microsoft.com/azure/cognitive-services/text-analytics/overview#data-limits
+ for document length limits, maximum batch size, and supported text encoding.
+
+ :param documents: The set of documents to process as part of this batch.
+ If you wish to specify the ID and language on a per-item basis you must
+ use as input a list[:class:`~azure.ai.textanalytics.TextDocumentInput`] or a list of
+ dict representations of :class:`~azure.ai.textanalytics.TextDocumentInput`, like
+ `{"id": "1", "language": "en", "text": "hello world"}`.
+ :type documents:
+ list[str] or list[~azure.ai.textanalytics.TextDocumentInput] or
+ list[dict[str, str]]
+ :keyword str language: The 2 letter ISO 639-1 representation of language for the
+ entire batch. For example, use "en" for English; "es" for Spanish etc.
+ If not set, uses "en" for English as default. Per-document language will
+ take precedence over whole batch language. See https://aka.ms/talangs for
+ supported languages in Text Analytics API.
+ :keyword str model_version: This value indicates which model will
+ be used for scoring, e.g. "latest", "2019-10-01". If a model-version
+ is not specified, the API will default to the latest, non-preview version.
+ :keyword bool show_stats: If set to true, response will contain document level statistics.
+ :return: The combined list of :class:`~azure.ai.textanalytics.RecognizePiiEntitiesResult`
+ and :class:`~azure.ai.textanalytics.DocumentError` in the order the original documents
+ were passed in.
+ :rtype: list[~azure.ai.textanalytics.RecognizePiiEntitiesResult,
+ ~azure.ai.textanalytics.DocumentError]
+ :raises ~azure.core.exceptions.HttpResponseError or TypeError or ValueError or NotImplementedError:
+
+ .. admonition:: Example:
+
+ .. literalinclude:: ../samples/sample_recognize_pii_entities.py
+ :start-after: [START batch_recognize_pii_entities]
+ :end-before: [END batch_recognize_pii_entities]
+ :language: python
+ :dedent: 8
+ :caption: Recognize personally identifiable information entities in a batch of documents.
+ """
+ language_arg = kwargs.pop("language", None)
+ language = language_arg if language_arg is not None else self._default_language
+ docs = _validate_batch_input(documents, "language", language)
+ model_version = kwargs.pop("model_version", None)
+ show_stats = kwargs.pop("show_stats", False)
+ try:
+ return self._client.entities_recognition_pii(
+ documents=docs,
+ model_version=model_version,
+ show_stats=show_stats,
+ cls=kwargs.pop("cls", pii_entities_result),
+ **kwargs
+ )
+ except AttributeError as error:
+ if "'TextAnalyticsClient' object has no attribute 'entities_recognition_pii'" in str(error):
+ raise NotImplementedError(
+ "'recognize_pii_entities' endpoint is only available for API version v3.1-preview.1 and up"
+ )
+ raise error
+ except HttpResponseError as error:
+ process_batch_error(error)
+
@distributed_trace
def recognize_linked_entities( # type: ignore
self,
diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py
index 90f12fb9837d..89ac9fc6c943 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py
@@ -22,7 +22,8 @@
linked_entities_result,
key_phrases_result,
sentiment_result,
- language_result
+ language_result,
+ pii_entities_result,
)
from .._models import (
DetectLanguageInput,
@@ -33,6 +34,7 @@
ExtractKeyPhrasesResult,
AnalyzeSentimentResult,
DocumentError,
+ RecognizePiiEntitiesResult,
)
if TYPE_CHECKING:
@@ -225,6 +227,76 @@ async def recognize_entities( # type: ignore
except HttpResponseError as error:
process_batch_error(error)
+ @distributed_trace_async
+ async def recognize_pii_entities( # type: ignore
+ self,
+ documents: Union[List[str], List[TextDocumentInput], List[Dict[str, str]]],
+ **kwargs: Any
+ ) -> List[Union[RecognizePiiEntitiesResult, DocumentError]]:
+ """Recognize entities containing personal information for a batch of documents.
+
+ Returns a list of personal information entities ("SSN",
+ "Bank Account", etc) in the document. For the list of supported entity types,
+ check https://aka.ms/tanerpii
+
+ See https://docs.microsoft.com/azure/cognitive-services/text-analytics/overview#data-limits
+ for document length limits, maximum batch size, and supported text encoding.
+
+ :param documents: The set of documents to process as part of this batch.
+ If you wish to specify the ID and language on a per-item basis you must
+ use as input a list[:class:`~azure.ai.textanalytics.TextDocumentInput`] or a list of
+ dict representations of :class:`~azure.ai.textanalytics.TextDocumentInput`, like
+ `{"id": "1", "language": "en", "text": "hello world"}`.
+ :type documents:
+ list[str] or list[~azure.ai.textanalytics.TextDocumentInput] or
+ list[dict[str, str]]
+ :keyword str language: The 2 letter ISO 639-1 representation of language for the
+ entire batch. For example, use "en" for English; "es" for Spanish etc.
+ If not set, uses "en" for English as default. Per-document language will
+ take precedence over whole batch language. See https://aka.ms/talangs for
+ supported languages in Text Analytics API.
+ :keyword str model_version: This value indicates which model will
+ be used for scoring, e.g. "latest", "2019-10-01". If a model-version
+ is not specified, the API will default to the latest, non-preview version.
+ :keyword bool show_stats: If set to true, response will contain document level statistics.
+ :return: The combined list of :class:`~azure.ai.textanalytics.RecognizePiiEntitiesResult`
+ and :class:`~azure.ai.textanalytics.DocumentError` in the order the original documents
+ were passed in.
+ :rtype: list[~azure.ai.textanalytics.RecognizePiiEntitiesResult,
+ ~azure.ai.textanalytics.DocumentError]
+ :raises ~azure.core.exceptions.HttpResponseError or TypeError or ValueError or NotImplementedError:
+
+ .. admonition:: Example:
+
+ .. literalinclude:: ../samples/sample_recognize_pii_entities.py
+ :start-after: [START batch_recognize_pii_entities]
+ :end-before: [END batch_recognize_pii_entities]
+ :language: python
+ :dedent: 8
+ :caption: Recognize personally identifiable information entities in a batch of documents.
+ """
+ language_arg = kwargs.pop("language", None)
+ language = language_arg if language_arg is not None else self._default_language
+ docs = _validate_batch_input(documents, "language", language)
+ model_version = kwargs.pop("model_version", None)
+ show_stats = kwargs.pop("show_stats", False)
+ try:
+ return await self._client.entities_recognition_pii(
+ documents=docs,
+ model_version=model_version,
+ show_stats=show_stats,
+ cls=kwargs.pop("cls", pii_entities_result),
+ **kwargs
+ )
+ except AttributeError as error:
+ if "'TextAnalyticsClient' object has no attribute 'entities_recognition_pii'" in str(error):
+ raise NotImplementedError(
+ "'recognize_pii_entities' endpoint is only available for API version v3.1-preview.1 and up"
+ )
+ raise error
+ except HttpResponseError as error:
+ process_batch_error(error)
+
@distributed_trace_async
async def recognize_linked_entities( # type: ignore
self,
diff --git a/sdk/textanalytics/azure-ai-textanalytics/samples/README.md b/sdk/textanalytics/azure-ai-textanalytics/samples/README.md
index 06faea2b664e..fcb2361c8b30 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/samples/README.md
+++ b/sdk/textanalytics/azure-ai-textanalytics/samples/README.md
@@ -24,6 +24,7 @@ These sample programs show common scenarios for the Text Analytics client's offe
|[sample_detect_language.py][detect_language] and [sample_detect_language_async.py][detect_language_async]|Detect language in documents|
|[sample_recognize_entities.py][recognize_entities] and [sample_recognize_entities_async.py][recognize_entities_async]|Recognize named entities in documents|
|[sample_recognize_linked_entities.py][recognize_linked_entities] and [sample_recognize_linked_entities_async.py][recognize_linked_entities_async]|Recognize linked entities in documents|
+|[sample_recognize_pii_entities.py](`https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py`) and [sample_recognize_pii_entities_async.py](`https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py`)|Recognize personally identifiable information in documents|
|[sample_extract_key_phrases.py][extract_key_phrases] and [sample_extract_key_phrases_async.py][extract_key_phrases_async]|Extract key phrases from documents|
|[sample_analyze_sentiment.py][analyze_sentiment] and [sample_analyze_sentiment_async.py][analyze_sentiment_async]|Analyze the sentiment of documents|
|[sample_alternative_document_input.py][sample_alternative_document_input] and [sample_alternative_document_input_async.py][sample_alternative_document_input_async]|Pass documents to an endpoint using dicts|
diff --git a/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py b/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py
new file mode 100644
index 000000000000..aefd69fc2723
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+"""
+FILE: sample_recognize_pii_entities_async.py
+
+DESCRIPTION:
+ This sample demonstrates how to recognize personally identifiable information in a batch of documents.
+ The endpoint recognize_pii_entities is only available for API version v3.1-preview.1 and up.
+
+USAGE:
+ python sample_recognize_pii_entities_async.py
+
+ Set the environment variables with your own values before running the sample:
+ 1) AZURE_TEXT_ANALYTICS_ENDPOINT - the endpoint to your Cognitive Services resource.
+ 2) AZURE_TEXT_ANALYTICS_KEY - your Text Analytics subscription key
+"""
+
+import os
+import asyncio
+
+
+class RecognizePiiEntitiesSampleAsync(object):
+
+ async def recognize_pii_entities_async(self):
+ # [START batch_recognize_pii_entities_async]
+ from azure.core.credentials import AzureKeyCredential
+ from azure.ai.textanalytics import ApiVersion
+ from azure.ai.textanalytics.aio import TextAnalyticsClient
+
+ endpoint = os.environ["AZURE_TEXT_ANALYTICS_ENDPOINT"]
+ key = os.environ["AZURE_TEXT_ANALYTICS_KEY"]
+
+ text_analytics_client = TextAnalyticsClient(
+ endpoint=endpoint, credential=AzureKeyCredential(key)
+ )
+ documents = [
+ "The employee's SSN is 859-98-0987.",
+ "Is 998.214.865-68 your Brazilian CPF number?",
+ "My phone number is 555-555-5555"
+ ]
+
+ async with text_analytics_client:
+ result = await text_analytics_client.recognize_pii_entities(documents)
+
+ docs = [doc for doc in result if not doc.is_error]
+
+ for idx, doc in enumerate(docs):
+ print("Document text: {}".format(documents[idx]))
+ for entity in doc.entities:
+ print("Entity: {}".format(entity.text))
+ print("Category: {}".format(entity.category))
+ print("Confidence Score: {}\n".format(entity.confidence_score))
+ # [END batch_recognize_pii_entities_async]
+
+
+async def main():
+ sample = RecognizePiiEntitiesSampleAsync()
+ await sample.recognize_pii_entities_async()
+
+if __name__ == '__main__':
+ loop = asyncio.get_event_loop()
+ loop.run_until_complete(main())
diff --git a/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py b/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py
new file mode 100644
index 000000000000..9ee9e18b644c
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+"""
+FILE: sample_recognize_pii_entities.py
+
+DESCRIPTION:
+ This sample demonstrates how to recognize personally identifiable information in a batch of documents.
+ The endpoint recognize_pii_entities is only available for API version v3.1-preview.1 and up.
+
+USAGE:
+ python sample_recognize_pii_entities.py
+
+ Set the environment variables with your own values before running the sample:
+ 1) AZURE_TEXT_ANALYTICS_ENDPOINT - the endpoint to your Cognitive Services resource.
+ 2) AZURE_TEXT_ANALYTICS_KEY - your Text Analytics subscription key
+"""
+
+import os
+
+
+class RecognizePiiEntitiesSample(object):
+
+ def recognize_pii_entities(self):
+ # [START batch_recognize_pii_entities]
+ from azure.core.credentials import AzureKeyCredential
+ from azure.ai.textanalytics import TextAnalyticsClient, ApiVersion
+
+ endpoint = os.environ["AZURE_TEXT_ANALYTICS_ENDPOINT"]
+ key = os.environ["AZURE_TEXT_ANALYTICS_KEY"]
+
+ text_analytics_client = TextAnalyticsClient(
+ endpoint=endpoint, credential=AzureKeyCredential(key)
+ )
+ documents = [
+ "The employee's SSN is 859-98-0987.",
+ "Is 998.214.865-68 your Brazilian CPF number?",
+ "My phone number is 555-555-5555"
+ ]
+
+ result = text_analytics_client.recognize_pii_entities(documents)
+ docs = [doc for doc in result if not doc.is_error]
+
+ for idx, doc in enumerate(docs):
+ print("Document text: {}".format(documents[idx]))
+ for entity in doc.entities:
+ print("Entity: {}".format(entity.text))
+ print("Category: {}".format(entity.category))
+ print("Confidence Score: {}\n".format(entity.confidence_score))
+ # [END batch_recognize_pii_entities]
+
+
+if __name__ == '__main__':
+ sample = RecognizePiiEntitiesSample()
+ sample.recognize_pii_entities()
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_all_successful_passing_dict.yaml
new file mode 100644
index 000000000000..6115f8866337
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_all_successful_passing_dict.yaml
@@ -0,0 +1,49 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "My SSN is 859-98-0987.", "language":
+ "en"}, {"id": "2", "text": "Your ABA number - 111000025 - is the first 9 digits
+ in the lower left hand corner of your personal check.", "language": "en"}, {"id":
+ "3", "text": "Is 998.214.865-68 your Brazilian CPF number?", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '315'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","statistics":{"charactersCount":22,"transactionsCount":1},"entities":[{"text":"859-98-0987","category":"U.S.
+ Social Security Number (SSN)","offset":10,"length":11,"confidenceScore":0.65}],"warnings":[]},{"id":"2","statistics":{"charactersCount":105,"transactionsCount":1},"entities":[{"text":"111000025","category":"Phone
+ Number","offset":18,"length":9,"confidenceScore":0.8},{"text":"111000025","category":"ABA
+ Routing Number","offset":18,"length":9,"confidenceScore":0.75}],"warnings":[]},{"id":"3","statistics":{"charactersCount":44,"transactionsCount":1},"entities":[{"text":"998.214.865-68","category":"Brazil
+ CPF Number","offset":3,"length":14,"confidenceScore":0.85}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 13864f85-984d-4a9b-8df3-c1409f0731b2
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:42 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '155'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_all_successful_passing_text_document_input.yaml
new file mode 100644
index 000000000000..83aef7498df7
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_all_successful_passing_text_document_input.yaml
@@ -0,0 +1,49 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "My SSN is 859-98-0987.", "language":
+ "en"}, {"id": "2", "text": "Your ABA number - 111000025 - is the first 9 digits
+ in the lower left hand corner of your personal check.", "language": "en"}, {"id":
+ "3", "text": "Is 998.214.865-68 your Brazilian CPF number?", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '315'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","statistics":{"charactersCount":22,"transactionsCount":1},"entities":[{"text":"859-98-0987","category":"U.S.
+ Social Security Number (SSN)","offset":10,"length":11,"confidenceScore":0.65}],"warnings":[]},{"id":"2","statistics":{"charactersCount":105,"transactionsCount":1},"entities":[{"text":"111000025","category":"Phone
+ Number","offset":18,"length":9,"confidenceScore":0.8},{"text":"111000025","category":"ABA
+ Routing Number","offset":18,"length":9,"confidenceScore":0.75}],"warnings":[]},{"id":"3","statistics":{"charactersCount":44,"transactionsCount":1},"entities":[{"text":"998.214.865-68","category":"Brazil
+ CPF Number","offset":3,"length":14,"confidenceScore":0.85}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 276ffd38-55e9-4b8a-b4c8-a4af7c8286d9
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:42 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '116'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_bad_credentials.yaml
new file mode 100644
index 000000000000..43251cb00dd4
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_bad_credentials.yaml
@@ -0,0 +1,33 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This is written in English.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '85'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
+ key or wrong API endpoint. Make sure to provide a valid key for an active
+ subscription and use a correct regional API endpoint for your resource."}}'
+ headers:
+ content-length:
+ - '224'
+ date:
+ - Thu, 23 Jul 2020 17:18:42 GMT
+ status:
+ code: 401
+ message: PermissionDenied
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_bad_model_version_error.yaml
new file mode 100644
index 000000000000..f1724aa7e308
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_bad_model_version_error.yaml
@@ -0,0 +1,42 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I did not like the hotel we stayed
+ at.", "language": "english"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '101'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=bad&showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
+ model version. Possible values are: latest,2020-04-01,2019-10-01,2020-02-01"}}}'
+ headers:
+ apim-request-id:
+ - c999c1e5-ba3b-4351-b65d-4356362357c6
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:43 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '4'
+ status:
+ code: 400
+ message: Bad Request
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_batch_size_over_limit.yaml
new file mode 100644
index 000000000000..e6d9bfac4ea9
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_batch_size_over_limit.yaml
@@ -0,0 +1,786 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "hello world", "language": "en"}, {"id":
+ "1", "text": "hello world", "language": "en"}, {"id": "2", "text": "hello world",
+ "language": "en"}, {"id": "3", "text": "hello world", "language": "en"}, {"id":
+ "4", "text": "hello world", "language": "en"}, {"id": "5", "text": "hello world",
+ "language": "en"}, {"id": "6", "text": "hello world", "language": "en"}, {"id":
+ "7", "text": "hello world", "language": "en"}, {"id": "8", "text": "hello world",
+ "language": "en"}, {"id": "9", "text": "hello world", "language": "en"}, {"id":
+ "10", "text": "hello world", "language": "en"}, {"id": "11", "text": "hello
+ world", "language": "en"}, {"id": "12", "text": "hello world", "language": "en"},
+ {"id": "13", "text": "hello world", "language": "en"}, {"id": "14", "text":
+ "hello world", "language": "en"}, {"id": "15", "text": "hello world", "language":
+ "en"}, {"id": "16", "text": "hello world", "language": "en"}, {"id": "17", "text":
+ "hello world", "language": "en"}, {"id": "18", "text": "hello world", "language":
+ "en"}, {"id": "19", "text": "hello world", "language": "en"}, {"id": "20", "text":
+ "hello world", "language": "en"}, {"id": "21", "text": "hello world", "language":
+ "en"}, {"id": "22", "text": "hello world", "language": "en"}, {"id": "23", "text":
+ "hello world", "language": "en"}, {"id": "24", "text": "hello world", "language":
+ "en"}, {"id": "25", "text": "hello world", "language": "en"}, {"id": "26", "text":
+ "hello world", "language": "en"}, {"id": "27", "text": "hello world", "language":
+ "en"}, {"id": "28", "text": "hello world", "language": "en"}, {"id": "29", "text":
+ "hello world", "language": "en"}, {"id": "30", "text": "hello world", "language":
+ "en"}, {"id": "31", "text": "hello world", "language": "en"}, {"id": "32", "text":
+ "hello world", "language": "en"}, {"id": "33", "text": "hello world", "language":
+ "en"}, {"id": "34", "text": "hello world", "language": "en"}, {"id": "35", "text":
+ "hello world", "language": "en"}, {"id": "36", "text": "hello world", "language":
+ "en"}, {"id": "37", "text": "hello world", "language": "en"}, {"id": "38", "text":
+ "hello world", "language": "en"}, {"id": "39", "text": "hello world", "language":
+ "en"}, {"id": "40", "text": "hello world", "language": "en"}, {"id": "41", "text":
+ "hello world", "language": "en"}, {"id": "42", "text": "hello world", "language":
+ "en"}, {"id": "43", "text": "hello world", "language": "en"}, {"id": "44", "text":
+ "hello world", "language": "en"}, {"id": "45", "text": "hello world", "language":
+ "en"}, {"id": "46", "text": "hello world", "language": "en"}, {"id": "47", "text":
+ "hello world", "language": "en"}, {"id": "48", "text": "hello world", "language":
+ "en"}, {"id": "49", "text": "hello world", "language": "en"}, {"id": "50", "text":
+ "hello world", "language": "en"}, {"id": "51", "text": "hello world", "language":
+ "en"}, {"id": "52", "text": "hello world", "language": "en"}, {"id": "53", "text":
+ "hello world", "language": "en"}, {"id": "54", "text": "hello world", "language":
+ "en"}, {"id": "55", "text": "hello world", "language": "en"}, {"id": "56", "text":
+ "hello world", "language": "en"}, {"id": "57", "text": "hello world", "language":
+ "en"}, {"id": "58", "text": "hello world", "language": "en"}, {"id": "59", "text":
+ "hello world", "language": "en"}, {"id": "60", "text": "hello world", "language":
+ "en"}, {"id": "61", "text": "hello world", "language": "en"}, {"id": "62", "text":
+ "hello world", "language": "en"}, {"id": "63", "text": "hello world", "language":
+ "en"}, {"id": "64", "text": "hello world", "language": "en"}, {"id": "65", "text":
+ "hello world", "language": "en"}, {"id": "66", "text": "hello world", "language":
+ "en"}, {"id": "67", "text": "hello world", "language": "en"}, {"id": "68", "text":
+ "hello world", "language": "en"}, {"id": "69", "text": "hello world", "language":
+ "en"}, {"id": "70", "text": "hello world", "language": "en"}, {"id": "71", "text":
+ "hello world", "language": "en"}, {"id": "72", "text": "hello world", "language":
+ "en"}, {"id": "73", "text": "hello world", "language": "en"}, {"id": "74", "text":
+ "hello world", "language": "en"}, {"id": "75", "text": "hello world", "language":
+ "en"}, {"id": "76", "text": "hello world", "language": "en"}, {"id": "77", "text":
+ "hello world", "language": "en"}, {"id": "78", "text": "hello world", "language":
+ "en"}, {"id": "79", "text": "hello world", "language": "en"}, {"id": "80", "text":
+ "hello world", "language": "en"}, {"id": "81", "text": "hello world", "language":
+ "en"}, {"id": "82", "text": "hello world", "language": "en"}, {"id": "83", "text":
+ "hello world", "language": "en"}, {"id": "84", "text": "hello world", "language":
+ "en"}, {"id": "85", "text": "hello world", "language": "en"}, {"id": "86", "text":
+ "hello world", "language": "en"}, {"id": "87", "text": "hello world", "language":
+ "en"}, {"id": "88", "text": "hello world", "language": "en"}, {"id": "89", "text":
+ "hello world", "language": "en"}, {"id": "90", "text": "hello world", "language":
+ "en"}, {"id": "91", "text": "hello world", "language": "en"}, {"id": "92", "text":
+ "hello world", "language": "en"}, {"id": "93", "text": "hello world", "language":
+ "en"}, {"id": "94", "text": "hello world", "language": "en"}, {"id": "95", "text":
+ "hello world", "language": "en"}, {"id": "96", "text": "hello world", "language":
+ "en"}, {"id": "97", "text": "hello world", "language": "en"}, {"id": "98", "text":
+ "hello world", "language": "en"}, {"id": "99", "text": "hello world", "language":
+ "en"}, {"id": "100", "text": "hello world", "language": "en"}, {"id": "101",
+ "text": "hello world", "language": "en"}, {"id": "102", "text": "hello world",
+ "language": "en"}, {"id": "103", "text": "hello world", "language": "en"}, {"id":
+ "104", "text": "hello world", "language": "en"}, {"id": "105", "text": "hello
+ world", "language": "en"}, {"id": "106", "text": "hello world", "language":
+ "en"}, {"id": "107", "text": "hello world", "language": "en"}, {"id": "108",
+ "text": "hello world", "language": "en"}, {"id": "109", "text": "hello world",
+ "language": "en"}, {"id": "110", "text": "hello world", "language": "en"}, {"id":
+ "111", "text": "hello world", "language": "en"}, {"id": "112", "text": "hello
+ world", "language": "en"}, {"id": "113", "text": "hello world", "language":
+ "en"}, {"id": "114", "text": "hello world", "language": "en"}, {"id": "115",
+ "text": "hello world", "language": "en"}, {"id": "116", "text": "hello world",
+ "language": "en"}, {"id": "117", "text": "hello world", "language": "en"}, {"id":
+ "118", "text": "hello world", "language": "en"}, {"id": "119", "text": "hello
+ world", "language": "en"}, {"id": "120", "text": "hello world", "language":
+ "en"}, {"id": "121", "text": "hello world", "language": "en"}, {"id": "122",
+ "text": "hello world", "language": "en"}, {"id": "123", "text": "hello world",
+ "language": "en"}, {"id": "124", "text": "hello world", "language": "en"}, {"id":
+ "125", "text": "hello world", "language": "en"}, {"id": "126", "text": "hello
+ world", "language": "en"}, {"id": "127", "text": "hello world", "language":
+ "en"}, {"id": "128", "text": "hello world", "language": "en"}, {"id": "129",
+ "text": "hello world", "language": "en"}, {"id": "130", "text": "hello world",
+ "language": "en"}, {"id": "131", "text": "hello world", "language": "en"}, {"id":
+ "132", "text": "hello world", "language": "en"}, {"id": "133", "text": "hello
+ world", "language": "en"}, {"id": "134", "text": "hello world", "language":
+ "en"}, {"id": "135", "text": "hello world", "language": "en"}, {"id": "136",
+ "text": "hello world", "language": "en"}, {"id": "137", "text": "hello world",
+ "language": "en"}, {"id": "138", "text": "hello world", "language": "en"}, {"id":
+ "139", "text": "hello world", "language": "en"}, {"id": "140", "text": "hello
+ world", "language": "en"}, {"id": "141", "text": "hello world", "language":
+ "en"}, {"id": "142", "text": "hello world", "language": "en"}, {"id": "143",
+ "text": "hello world", "language": "en"}, {"id": "144", "text": "hello world",
+ "language": "en"}, {"id": "145", "text": "hello world", "language": "en"}, {"id":
+ "146", "text": "hello world", "language": "en"}, {"id": "147", "text": "hello
+ world", "language": "en"}, {"id": "148", "text": "hello world", "language":
+ "en"}, {"id": "149", "text": "hello world", "language": "en"}, {"id": "150",
+ "text": "hello world", "language": "en"}, {"id": "151", "text": "hello world",
+ "language": "en"}, {"id": "152", "text": "hello world", "language": "en"}, {"id":
+ "153", "text": "hello world", "language": "en"}, {"id": "154", "text": "hello
+ world", "language": "en"}, {"id": "155", "text": "hello world", "language":
+ "en"}, {"id": "156", "text": "hello world", "language": "en"}, {"id": "157",
+ "text": "hello world", "language": "en"}, {"id": "158", "text": "hello world",
+ "language": "en"}, {"id": "159", "text": "hello world", "language": "en"}, {"id":
+ "160", "text": "hello world", "language": "en"}, {"id": "161", "text": "hello
+ world", "language": "en"}, {"id": "162", "text": "hello world", "language":
+ "en"}, {"id": "163", "text": "hello world", "language": "en"}, {"id": "164",
+ "text": "hello world", "language": "en"}, {"id": "165", "text": "hello world",
+ "language": "en"}, {"id": "166", "text": "hello world", "language": "en"}, {"id":
+ "167", "text": "hello world", "language": "en"}, {"id": "168", "text": "hello
+ world", "language": "en"}, {"id": "169", "text": "hello world", "language":
+ "en"}, {"id": "170", "text": "hello world", "language": "en"}, {"id": "171",
+ "text": "hello world", "language": "en"}, {"id": "172", "text": "hello world",
+ "language": "en"}, {"id": "173", "text": "hello world", "language": "en"}, {"id":
+ "174", "text": "hello world", "language": "en"}, {"id": "175", "text": "hello
+ world", "language": "en"}, {"id": "176", "text": "hello world", "language":
+ "en"}, {"id": "177", "text": "hello world", "language": "en"}, {"id": "178",
+ "text": "hello world", "language": "en"}, {"id": "179", "text": "hello world",
+ "language": "en"}, {"id": "180", "text": "hello world", "language": "en"}, {"id":
+ "181", "text": "hello world", "language": "en"}, {"id": "182", "text": "hello
+ world", "language": "en"}, {"id": "183", "text": "hello world", "language":
+ "en"}, {"id": "184", "text": "hello world", "language": "en"}, {"id": "185",
+ "text": "hello world", "language": "en"}, {"id": "186", "text": "hello world",
+ "language": "en"}, {"id": "187", "text": "hello world", "language": "en"}, {"id":
+ "188", "text": "hello world", "language": "en"}, {"id": "189", "text": "hello
+ world", "language": "en"}, {"id": "190", "text": "hello world", "language":
+ "en"}, {"id": "191", "text": "hello world", "language": "en"}, {"id": "192",
+ "text": "hello world", "language": "en"}, {"id": "193", "text": "hello world",
+ "language": "en"}, {"id": "194", "text": "hello world", "language": "en"}, {"id":
+ "195", "text": "hello world", "language": "en"}, {"id": "196", "text": "hello
+ world", "language": "en"}, {"id": "197", "text": "hello world", "language":
+ "en"}, {"id": "198", "text": "hello world", "language": "en"}, {"id": "199",
+ "text": "hello world", "language": "en"}, {"id": "200", "text": "hello world",
+ "language": "en"}, {"id": "201", "text": "hello world", "language": "en"}, {"id":
+ "202", "text": "hello world", "language": "en"}, {"id": "203", "text": "hello
+ world", "language": "en"}, {"id": "204", "text": "hello world", "language":
+ "en"}, {"id": "205", "text": "hello world", "language": "en"}, {"id": "206",
+ "text": "hello world", "language": "en"}, {"id": "207", "text": "hello world",
+ "language": "en"}, {"id": "208", "text": "hello world", "language": "en"}, {"id":
+ "209", "text": "hello world", "language": "en"}, {"id": "210", "text": "hello
+ world", "language": "en"}, {"id": "211", "text": "hello world", "language":
+ "en"}, {"id": "212", "text": "hello world", "language": "en"}, {"id": "213",
+ "text": "hello world", "language": "en"}, {"id": "214", "text": "hello world",
+ "language": "en"}, {"id": "215", "text": "hello world", "language": "en"}, {"id":
+ "216", "text": "hello world", "language": "en"}, {"id": "217", "text": "hello
+ world", "language": "en"}, {"id": "218", "text": "hello world", "language":
+ "en"}, {"id": "219", "text": "hello world", "language": "en"}, {"id": "220",
+ "text": "hello world", "language": "en"}, {"id": "221", "text": "hello world",
+ "language": "en"}, {"id": "222", "text": "hello world", "language": "en"}, {"id":
+ "223", "text": "hello world", "language": "en"}, {"id": "224", "text": "hello
+ world", "language": "en"}, {"id": "225", "text": "hello world", "language":
+ "en"}, {"id": "226", "text": "hello world", "language": "en"}, {"id": "227",
+ "text": "hello world", "language": "en"}, {"id": "228", "text": "hello world",
+ "language": "en"}, {"id": "229", "text": "hello world", "language": "en"}, {"id":
+ "230", "text": "hello world", "language": "en"}, {"id": "231", "text": "hello
+ world", "language": "en"}, {"id": "232", "text": "hello world", "language":
+ "en"}, {"id": "233", "text": "hello world", "language": "en"}, {"id": "234",
+ "text": "hello world", "language": "en"}, {"id": "235", "text": "hello world",
+ "language": "en"}, {"id": "236", "text": "hello world", "language": "en"}, {"id":
+ "237", "text": "hello world", "language": "en"}, {"id": "238", "text": "hello
+ world", "language": "en"}, {"id": "239", "text": "hello world", "language":
+ "en"}, {"id": "240", "text": "hello world", "language": "en"}, {"id": "241",
+ "text": "hello world", "language": "en"}, {"id": "242", "text": "hello world",
+ "language": "en"}, {"id": "243", "text": "hello world", "language": "en"}, {"id":
+ "244", "text": "hello world", "language": "en"}, {"id": "245", "text": "hello
+ world", "language": "en"}, {"id": "246", "text": "hello world", "language":
+ "en"}, {"id": "247", "text": "hello world", "language": "en"}, {"id": "248",
+ "text": "hello world", "language": "en"}, {"id": "249", "text": "hello world",
+ "language": "en"}, {"id": "250", "text": "hello world", "language": "en"}, {"id":
+ "251", "text": "hello world", "language": "en"}, {"id": "252", "text": "hello
+ world", "language": "en"}, {"id": "253", "text": "hello world", "language":
+ "en"}, {"id": "254", "text": "hello world", "language": "en"}, {"id": "255",
+ "text": "hello world", "language": "en"}, {"id": "256", "text": "hello world",
+ "language": "en"}, {"id": "257", "text": "hello world", "language": "en"}, {"id":
+ "258", "text": "hello world", "language": "en"}, {"id": "259", "text": "hello
+ world", "language": "en"}, {"id": "260", "text": "hello world", "language":
+ "en"}, {"id": "261", "text": "hello world", "language": "en"}, {"id": "262",
+ "text": "hello world", "language": "en"}, {"id": "263", "text": "hello world",
+ "language": "en"}, {"id": "264", "text": "hello world", "language": "en"}, {"id":
+ "265", "text": "hello world", "language": "en"}, {"id": "266", "text": "hello
+ world", "language": "en"}, {"id": "267", "text": "hello world", "language":
+ "en"}, {"id": "268", "text": "hello world", "language": "en"}, {"id": "269",
+ "text": "hello world", "language": "en"}, {"id": "270", "text": "hello world",
+ "language": "en"}, {"id": "271", "text": "hello world", "language": "en"}, {"id":
+ "272", "text": "hello world", "language": "en"}, {"id": "273", "text": "hello
+ world", "language": "en"}, {"id": "274", "text": "hello world", "language":
+ "en"}, {"id": "275", "text": "hello world", "language": "en"}, {"id": "276",
+ "text": "hello world", "language": "en"}, {"id": "277", "text": "hello world",
+ "language": "en"}, {"id": "278", "text": "hello world", "language": "en"}, {"id":
+ "279", "text": "hello world", "language": "en"}, {"id": "280", "text": "hello
+ world", "language": "en"}, {"id": "281", "text": "hello world", "language":
+ "en"}, {"id": "282", "text": "hello world", "language": "en"}, {"id": "283",
+ "text": "hello world", "language": "en"}, {"id": "284", "text": "hello world",
+ "language": "en"}, {"id": "285", "text": "hello world", "language": "en"}, {"id":
+ "286", "text": "hello world", "language": "en"}, {"id": "287", "text": "hello
+ world", "language": "en"}, {"id": "288", "text": "hello world", "language":
+ "en"}, {"id": "289", "text": "hello world", "language": "en"}, {"id": "290",
+ "text": "hello world", "language": "en"}, {"id": "291", "text": "hello world",
+ "language": "en"}, {"id": "292", "text": "hello world", "language": "en"}, {"id":
+ "293", "text": "hello world", "language": "en"}, {"id": "294", "text": "hello
+ world", "language": "en"}, {"id": "295", "text": "hello world", "language":
+ "en"}, {"id": "296", "text": "hello world", "language": "en"}, {"id": "297",
+ "text": "hello world", "language": "en"}, {"id": "298", "text": "hello world",
+ "language": "en"}, {"id": "299", "text": "hello world", "language": "en"}, {"id":
+ "300", "text": "hello world", "language": "en"}, {"id": "301", "text": "hello
+ world", "language": "en"}, {"id": "302", "text": "hello world", "language":
+ "en"}, {"id": "303", "text": "hello world", "language": "en"}, {"id": "304",
+ "text": "hello world", "language": "en"}, {"id": "305", "text": "hello world",
+ "language": "en"}, {"id": "306", "text": "hello world", "language": "en"}, {"id":
+ "307", "text": "hello world", "language": "en"}, {"id": "308", "text": "hello
+ world", "language": "en"}, {"id": "309", "text": "hello world", "language":
+ "en"}, {"id": "310", "text": "hello world", "language": "en"}, {"id": "311",
+ "text": "hello world", "language": "en"}, {"id": "312", "text": "hello world",
+ "language": "en"}, {"id": "313", "text": "hello world", "language": "en"}, {"id":
+ "314", "text": "hello world", "language": "en"}, {"id": "315", "text": "hello
+ world", "language": "en"}, {"id": "316", "text": "hello world", "language":
+ "en"}, {"id": "317", "text": "hello world", "language": "en"}, {"id": "318",
+ "text": "hello world", "language": "en"}, {"id": "319", "text": "hello world",
+ "language": "en"}, {"id": "320", "text": "hello world", "language": "en"}, {"id":
+ "321", "text": "hello world", "language": "en"}, {"id": "322", "text": "hello
+ world", "language": "en"}, {"id": "323", "text": "hello world", "language":
+ "en"}, {"id": "324", "text": "hello world", "language": "en"}, {"id": "325",
+ "text": "hello world", "language": "en"}, {"id": "326", "text": "hello world",
+ "language": "en"}, {"id": "327", "text": "hello world", "language": "en"}, {"id":
+ "328", "text": "hello world", "language": "en"}, {"id": "329", "text": "hello
+ world", "language": "en"}, {"id": "330", "text": "hello world", "language":
+ "en"}, {"id": "331", "text": "hello world", "language": "en"}, {"id": "332",
+ "text": "hello world", "language": "en"}, {"id": "333", "text": "hello world",
+ "language": "en"}, {"id": "334", "text": "hello world", "language": "en"}, {"id":
+ "335", "text": "hello world", "language": "en"}, {"id": "336", "text": "hello
+ world", "language": "en"}, {"id": "337", "text": "hello world", "language":
+ "en"}, {"id": "338", "text": "hello world", "language": "en"}, {"id": "339",
+ "text": "hello world", "language": "en"}, {"id": "340", "text": "hello world",
+ "language": "en"}, {"id": "341", "text": "hello world", "language": "en"}, {"id":
+ "342", "text": "hello world", "language": "en"}, {"id": "343", "text": "hello
+ world", "language": "en"}, {"id": "344", "text": "hello world", "language":
+ "en"}, {"id": "345", "text": "hello world", "language": "en"}, {"id": "346",
+ "text": "hello world", "language": "en"}, {"id": "347", "text": "hello world",
+ "language": "en"}, {"id": "348", "text": "hello world", "language": "en"}, {"id":
+ "349", "text": "hello world", "language": "en"}, {"id": "350", "text": "hello
+ world", "language": "en"}, {"id": "351", "text": "hello world", "language":
+ "en"}, {"id": "352", "text": "hello world", "language": "en"}, {"id": "353",
+ "text": "hello world", "language": "en"}, {"id": "354", "text": "hello world",
+ "language": "en"}, {"id": "355", "text": "hello world", "language": "en"}, {"id":
+ "356", "text": "hello world", "language": "en"}, {"id": "357", "text": "hello
+ world", "language": "en"}, {"id": "358", "text": "hello world", "language":
+ "en"}, {"id": "359", "text": "hello world", "language": "en"}, {"id": "360",
+ "text": "hello world", "language": "en"}, {"id": "361", "text": "hello world",
+ "language": "en"}, {"id": "362", "text": "hello world", "language": "en"}, {"id":
+ "363", "text": "hello world", "language": "en"}, {"id": "364", "text": "hello
+ world", "language": "en"}, {"id": "365", "text": "hello world", "language":
+ "en"}, {"id": "366", "text": "hello world", "language": "en"}, {"id": "367",
+ "text": "hello world", "language": "en"}, {"id": "368", "text": "hello world",
+ "language": "en"}, {"id": "369", "text": "hello world", "language": "en"}, {"id":
+ "370", "text": "hello world", "language": "en"}, {"id": "371", "text": "hello
+ world", "language": "en"}, {"id": "372", "text": "hello world", "language":
+ "en"}, {"id": "373", "text": "hello world", "language": "en"}, {"id": "374",
+ "text": "hello world", "language": "en"}, {"id": "375", "text": "hello world",
+ "language": "en"}, {"id": "376", "text": "hello world", "language": "en"}, {"id":
+ "377", "text": "hello world", "language": "en"}, {"id": "378", "text": "hello
+ world", "language": "en"}, {"id": "379", "text": "hello world", "language":
+ "en"}, {"id": "380", "text": "hello world", "language": "en"}, {"id": "381",
+ "text": "hello world", "language": "en"}, {"id": "382", "text": "hello world",
+ "language": "en"}, {"id": "383", "text": "hello world", "language": "en"}, {"id":
+ "384", "text": "hello world", "language": "en"}, {"id": "385", "text": "hello
+ world", "language": "en"}, {"id": "386", "text": "hello world", "language":
+ "en"}, {"id": "387", "text": "hello world", "language": "en"}, {"id": "388",
+ "text": "hello world", "language": "en"}, {"id": "389", "text": "hello world",
+ "language": "en"}, {"id": "390", "text": "hello world", "language": "en"}, {"id":
+ "391", "text": "hello world", "language": "en"}, {"id": "392", "text": "hello
+ world", "language": "en"}, {"id": "393", "text": "hello world", "language":
+ "en"}, {"id": "394", "text": "hello world", "language": "en"}, {"id": "395",
+ "text": "hello world", "language": "en"}, {"id": "396", "text": "hello world",
+ "language": "en"}, {"id": "397", "text": "hello world", "language": "en"}, {"id":
+ "398", "text": "hello world", "language": "en"}, {"id": "399", "text": "hello
+ world", "language": "en"}, {"id": "400", "text": "hello world", "language":
+ "en"}, {"id": "401", "text": "hello world", "language": "en"}, {"id": "402",
+ "text": "hello world", "language": "en"}, {"id": "403", "text": "hello world",
+ "language": "en"}, {"id": "404", "text": "hello world", "language": "en"}, {"id":
+ "405", "text": "hello world", "language": "en"}, {"id": "406", "text": "hello
+ world", "language": "en"}, {"id": "407", "text": "hello world", "language":
+ "en"}, {"id": "408", "text": "hello world", "language": "en"}, {"id": "409",
+ "text": "hello world", "language": "en"}, {"id": "410", "text": "hello world",
+ "language": "en"}, {"id": "411", "text": "hello world", "language": "en"}, {"id":
+ "412", "text": "hello world", "language": "en"}, {"id": "413", "text": "hello
+ world", "language": "en"}, {"id": "414", "text": "hello world", "language":
+ "en"}, {"id": "415", "text": "hello world", "language": "en"}, {"id": "416",
+ "text": "hello world", "language": "en"}, {"id": "417", "text": "hello world",
+ "language": "en"}, {"id": "418", "text": "hello world", "language": "en"}, {"id":
+ "419", "text": "hello world", "language": "en"}, {"id": "420", "text": "hello
+ world", "language": "en"}, {"id": "421", "text": "hello world", "language":
+ "en"}, {"id": "422", "text": "hello world", "language": "en"}, {"id": "423",
+ "text": "hello world", "language": "en"}, {"id": "424", "text": "hello world",
+ "language": "en"}, {"id": "425", "text": "hello world", "language": "en"}, {"id":
+ "426", "text": "hello world", "language": "en"}, {"id": "427", "text": "hello
+ world", "language": "en"}, {"id": "428", "text": "hello world", "language":
+ "en"}, {"id": "429", "text": "hello world", "language": "en"}, {"id": "430",
+ "text": "hello world", "language": "en"}, {"id": "431", "text": "hello world",
+ "language": "en"}, {"id": "432", "text": "hello world", "language": "en"}, {"id":
+ "433", "text": "hello world", "language": "en"}, {"id": "434", "text": "hello
+ world", "language": "en"}, {"id": "435", "text": "hello world", "language":
+ "en"}, {"id": "436", "text": "hello world", "language": "en"}, {"id": "437",
+ "text": "hello world", "language": "en"}, {"id": "438", "text": "hello world",
+ "language": "en"}, {"id": "439", "text": "hello world", "language": "en"}, {"id":
+ "440", "text": "hello world", "language": "en"}, {"id": "441", "text": "hello
+ world", "language": "en"}, {"id": "442", "text": "hello world", "language":
+ "en"}, {"id": "443", "text": "hello world", "language": "en"}, {"id": "444",
+ "text": "hello world", "language": "en"}, {"id": "445", "text": "hello world",
+ "language": "en"}, {"id": "446", "text": "hello world", "language": "en"}, {"id":
+ "447", "text": "hello world", "language": "en"}, {"id": "448", "text": "hello
+ world", "language": "en"}, {"id": "449", "text": "hello world", "language":
+ "en"}, {"id": "450", "text": "hello world", "language": "en"}, {"id": "451",
+ "text": "hello world", "language": "en"}, {"id": "452", "text": "hello world",
+ "language": "en"}, {"id": "453", "text": "hello world", "language": "en"}, {"id":
+ "454", "text": "hello world", "language": "en"}, {"id": "455", "text": "hello
+ world", "language": "en"}, {"id": "456", "text": "hello world", "language":
+ "en"}, {"id": "457", "text": "hello world", "language": "en"}, {"id": "458",
+ "text": "hello world", "language": "en"}, {"id": "459", "text": "hello world",
+ "language": "en"}, {"id": "460", "text": "hello world", "language": "en"}, {"id":
+ "461", "text": "hello world", "language": "en"}, {"id": "462", "text": "hello
+ world", "language": "en"}, {"id": "463", "text": "hello world", "language":
+ "en"}, {"id": "464", "text": "hello world", "language": "en"}, {"id": "465",
+ "text": "hello world", "language": "en"}, {"id": "466", "text": "hello world",
+ "language": "en"}, {"id": "467", "text": "hello world", "language": "en"}, {"id":
+ "468", "text": "hello world", "language": "en"}, {"id": "469", "text": "hello
+ world", "language": "en"}, {"id": "470", "text": "hello world", "language":
+ "en"}, {"id": "471", "text": "hello world", "language": "en"}, {"id": "472",
+ "text": "hello world", "language": "en"}, {"id": "473", "text": "hello world",
+ "language": "en"}, {"id": "474", "text": "hello world", "language": "en"}, {"id":
+ "475", "text": "hello world", "language": "en"}, {"id": "476", "text": "hello
+ world", "language": "en"}, {"id": "477", "text": "hello world", "language":
+ "en"}, {"id": "478", "text": "hello world", "language": "en"}, {"id": "479",
+ "text": "hello world", "language": "en"}, {"id": "480", "text": "hello world",
+ "language": "en"}, {"id": "481", "text": "hello world", "language": "en"}, {"id":
+ "482", "text": "hello world", "language": "en"}, {"id": "483", "text": "hello
+ world", "language": "en"}, {"id": "484", "text": "hello world", "language":
+ "en"}, {"id": "485", "text": "hello world", "language": "en"}, {"id": "486",
+ "text": "hello world", "language": "en"}, {"id": "487", "text": "hello world",
+ "language": "en"}, {"id": "488", "text": "hello world", "language": "en"}, {"id":
+ "489", "text": "hello world", "language": "en"}, {"id": "490", "text": "hello
+ world", "language": "en"}, {"id": "491", "text": "hello world", "language":
+ "en"}, {"id": "492", "text": "hello world", "language": "en"}, {"id": "493",
+ "text": "hello world", "language": "en"}, {"id": "494", "text": "hello world",
+ "language": "en"}, {"id": "495", "text": "hello world", "language": "en"}, {"id":
+ "496", "text": "hello world", "language": "en"}, {"id": "497", "text": "hello
+ world", "language": "en"}, {"id": "498", "text": "hello world", "language":
+ "en"}, {"id": "499", "text": "hello world", "language": "en"}, {"id": "500",
+ "text": "hello world", "language": "en"}, {"id": "501", "text": "hello world",
+ "language": "en"}, {"id": "502", "text": "hello world", "language": "en"}, {"id":
+ "503", "text": "hello world", "language": "en"}, {"id": "504", "text": "hello
+ world", "language": "en"}, {"id": "505", "text": "hello world", "language":
+ "en"}, {"id": "506", "text": "hello world", "language": "en"}, {"id": "507",
+ "text": "hello world", "language": "en"}, {"id": "508", "text": "hello world",
+ "language": "en"}, {"id": "509", "text": "hello world", "language": "en"}, {"id":
+ "510", "text": "hello world", "language": "en"}, {"id": "511", "text": "hello
+ world", "language": "en"}, {"id": "512", "text": "hello world", "language":
+ "en"}, {"id": "513", "text": "hello world", "language": "en"}, {"id": "514",
+ "text": "hello world", "language": "en"}, {"id": "515", "text": "hello world",
+ "language": "en"}, {"id": "516", "text": "hello world", "language": "en"}, {"id":
+ "517", "text": "hello world", "language": "en"}, {"id": "518", "text": "hello
+ world", "language": "en"}, {"id": "519", "text": "hello world", "language":
+ "en"}, {"id": "520", "text": "hello world", "language": "en"}, {"id": "521",
+ "text": "hello world", "language": "en"}, {"id": "522", "text": "hello world",
+ "language": "en"}, {"id": "523", "text": "hello world", "language": "en"}, {"id":
+ "524", "text": "hello world", "language": "en"}, {"id": "525", "text": "hello
+ world", "language": "en"}, {"id": "526", "text": "hello world", "language":
+ "en"}, {"id": "527", "text": "hello world", "language": "en"}, {"id": "528",
+ "text": "hello world", "language": "en"}, {"id": "529", "text": "hello world",
+ "language": "en"}, {"id": "530", "text": "hello world", "language": "en"}, {"id":
+ "531", "text": "hello world", "language": "en"}, {"id": "532", "text": "hello
+ world", "language": "en"}, {"id": "533", "text": "hello world", "language":
+ "en"}, {"id": "534", "text": "hello world", "language": "en"}, {"id": "535",
+ "text": "hello world", "language": "en"}, {"id": "536", "text": "hello world",
+ "language": "en"}, {"id": "537", "text": "hello world", "language": "en"}, {"id":
+ "538", "text": "hello world", "language": "en"}, {"id": "539", "text": "hello
+ world", "language": "en"}, {"id": "540", "text": "hello world", "language":
+ "en"}, {"id": "541", "text": "hello world", "language": "en"}, {"id": "542",
+ "text": "hello world", "language": "en"}, {"id": "543", "text": "hello world",
+ "language": "en"}, {"id": "544", "text": "hello world", "language": "en"}, {"id":
+ "545", "text": "hello world", "language": "en"}, {"id": "546", "text": "hello
+ world", "language": "en"}, {"id": "547", "text": "hello world", "language":
+ "en"}, {"id": "548", "text": "hello world", "language": "en"}, {"id": "549",
+ "text": "hello world", "language": "en"}, {"id": "550", "text": "hello world",
+ "language": "en"}, {"id": "551", "text": "hello world", "language": "en"}, {"id":
+ "552", "text": "hello world", "language": "en"}, {"id": "553", "text": "hello
+ world", "language": "en"}, {"id": "554", "text": "hello world", "language":
+ "en"}, {"id": "555", "text": "hello world", "language": "en"}, {"id": "556",
+ "text": "hello world", "language": "en"}, {"id": "557", "text": "hello world",
+ "language": "en"}, {"id": "558", "text": "hello world", "language": "en"}, {"id":
+ "559", "text": "hello world", "language": "en"}, {"id": "560", "text": "hello
+ world", "language": "en"}, {"id": "561", "text": "hello world", "language":
+ "en"}, {"id": "562", "text": "hello world", "language": "en"}, {"id": "563",
+ "text": "hello world", "language": "en"}, {"id": "564", "text": "hello world",
+ "language": "en"}, {"id": "565", "text": "hello world", "language": "en"}, {"id":
+ "566", "text": "hello world", "language": "en"}, {"id": "567", "text": "hello
+ world", "language": "en"}, {"id": "568", "text": "hello world", "language":
+ "en"}, {"id": "569", "text": "hello world", "language": "en"}, {"id": "570",
+ "text": "hello world", "language": "en"}, {"id": "571", "text": "hello world",
+ "language": "en"}, {"id": "572", "text": "hello world", "language": "en"}, {"id":
+ "573", "text": "hello world", "language": "en"}, {"id": "574", "text": "hello
+ world", "language": "en"}, {"id": "575", "text": "hello world", "language":
+ "en"}, {"id": "576", "text": "hello world", "language": "en"}, {"id": "577",
+ "text": "hello world", "language": "en"}, {"id": "578", "text": "hello world",
+ "language": "en"}, {"id": "579", "text": "hello world", "language": "en"}, {"id":
+ "580", "text": "hello world", "language": "en"}, {"id": "581", "text": "hello
+ world", "language": "en"}, {"id": "582", "text": "hello world", "language":
+ "en"}, {"id": "583", "text": "hello world", "language": "en"}, {"id": "584",
+ "text": "hello world", "language": "en"}, {"id": "585", "text": "hello world",
+ "language": "en"}, {"id": "586", "text": "hello world", "language": "en"}, {"id":
+ "587", "text": "hello world", "language": "en"}, {"id": "588", "text": "hello
+ world", "language": "en"}, {"id": "589", "text": "hello world", "language":
+ "en"}, {"id": "590", "text": "hello world", "language": "en"}, {"id": "591",
+ "text": "hello world", "language": "en"}, {"id": "592", "text": "hello world",
+ "language": "en"}, {"id": "593", "text": "hello world", "language": "en"}, {"id":
+ "594", "text": "hello world", "language": "en"}, {"id": "595", "text": "hello
+ world", "language": "en"}, {"id": "596", "text": "hello world", "language":
+ "en"}, {"id": "597", "text": "hello world", "language": "en"}, {"id": "598",
+ "text": "hello world", "language": "en"}, {"id": "599", "text": "hello world",
+ "language": "en"}, {"id": "600", "text": "hello world", "language": "en"}, {"id":
+ "601", "text": "hello world", "language": "en"}, {"id": "602", "text": "hello
+ world", "language": "en"}, {"id": "603", "text": "hello world", "language":
+ "en"}, {"id": "604", "text": "hello world", "language": "en"}, {"id": "605",
+ "text": "hello world", "language": "en"}, {"id": "606", "text": "hello world",
+ "language": "en"}, {"id": "607", "text": "hello world", "language": "en"}, {"id":
+ "608", "text": "hello world", "language": "en"}, {"id": "609", "text": "hello
+ world", "language": "en"}, {"id": "610", "text": "hello world", "language":
+ "en"}, {"id": "611", "text": "hello world", "language": "en"}, {"id": "612",
+ "text": "hello world", "language": "en"}, {"id": "613", "text": "hello world",
+ "language": "en"}, {"id": "614", "text": "hello world", "language": "en"}, {"id":
+ "615", "text": "hello world", "language": "en"}, {"id": "616", "text": "hello
+ world", "language": "en"}, {"id": "617", "text": "hello world", "language":
+ "en"}, {"id": "618", "text": "hello world", "language": "en"}, {"id": "619",
+ "text": "hello world", "language": "en"}, {"id": "620", "text": "hello world",
+ "language": "en"}, {"id": "621", "text": "hello world", "language": "en"}, {"id":
+ "622", "text": "hello world", "language": "en"}, {"id": "623", "text": "hello
+ world", "language": "en"}, {"id": "624", "text": "hello world", "language":
+ "en"}, {"id": "625", "text": "hello world", "language": "en"}, {"id": "626",
+ "text": "hello world", "language": "en"}, {"id": "627", "text": "hello world",
+ "language": "en"}, {"id": "628", "text": "hello world", "language": "en"}, {"id":
+ "629", "text": "hello world", "language": "en"}, {"id": "630", "text": "hello
+ world", "language": "en"}, {"id": "631", "text": "hello world", "language":
+ "en"}, {"id": "632", "text": "hello world", "language": "en"}, {"id": "633",
+ "text": "hello world", "language": "en"}, {"id": "634", "text": "hello world",
+ "language": "en"}, {"id": "635", "text": "hello world", "language": "en"}, {"id":
+ "636", "text": "hello world", "language": "en"}, {"id": "637", "text": "hello
+ world", "language": "en"}, {"id": "638", "text": "hello world", "language":
+ "en"}, {"id": "639", "text": "hello world", "language": "en"}, {"id": "640",
+ "text": "hello world", "language": "en"}, {"id": "641", "text": "hello world",
+ "language": "en"}, {"id": "642", "text": "hello world", "language": "en"}, {"id":
+ "643", "text": "hello world", "language": "en"}, {"id": "644", "text": "hello
+ world", "language": "en"}, {"id": "645", "text": "hello world", "language":
+ "en"}, {"id": "646", "text": "hello world", "language": "en"}, {"id": "647",
+ "text": "hello world", "language": "en"}, {"id": "648", "text": "hello world",
+ "language": "en"}, {"id": "649", "text": "hello world", "language": "en"}, {"id":
+ "650", "text": "hello world", "language": "en"}, {"id": "651", "text": "hello
+ world", "language": "en"}, {"id": "652", "text": "hello world", "language":
+ "en"}, {"id": "653", "text": "hello world", "language": "en"}, {"id": "654",
+ "text": "hello world", "language": "en"}, {"id": "655", "text": "hello world",
+ "language": "en"}, {"id": "656", "text": "hello world", "language": "en"}, {"id":
+ "657", "text": "hello world", "language": "en"}, {"id": "658", "text": "hello
+ world", "language": "en"}, {"id": "659", "text": "hello world", "language":
+ "en"}, {"id": "660", "text": "hello world", "language": "en"}, {"id": "661",
+ "text": "hello world", "language": "en"}, {"id": "662", "text": "hello world",
+ "language": "en"}, {"id": "663", "text": "hello world", "language": "en"}, {"id":
+ "664", "text": "hello world", "language": "en"}, {"id": "665", "text": "hello
+ world", "language": "en"}, {"id": "666", "text": "hello world", "language":
+ "en"}, {"id": "667", "text": "hello world", "language": "en"}, {"id": "668",
+ "text": "hello world", "language": "en"}, {"id": "669", "text": "hello world",
+ "language": "en"}, {"id": "670", "text": "hello world", "language": "en"}, {"id":
+ "671", "text": "hello world", "language": "en"}, {"id": "672", "text": "hello
+ world", "language": "en"}, {"id": "673", "text": "hello world", "language":
+ "en"}, {"id": "674", "text": "hello world", "language": "en"}, {"id": "675",
+ "text": "hello world", "language": "en"}, {"id": "676", "text": "hello world",
+ "language": "en"}, {"id": "677", "text": "hello world", "language": "en"}, {"id":
+ "678", "text": "hello world", "language": "en"}, {"id": "679", "text": "hello
+ world", "language": "en"}, {"id": "680", "text": "hello world", "language":
+ "en"}, {"id": "681", "text": "hello world", "language": "en"}, {"id": "682",
+ "text": "hello world", "language": "en"}, {"id": "683", "text": "hello world",
+ "language": "en"}, {"id": "684", "text": "hello world", "language": "en"}, {"id":
+ "685", "text": "hello world", "language": "en"}, {"id": "686", "text": "hello
+ world", "language": "en"}, {"id": "687", "text": "hello world", "language":
+ "en"}, {"id": "688", "text": "hello world", "language": "en"}, {"id": "689",
+ "text": "hello world", "language": "en"}, {"id": "690", "text": "hello world",
+ "language": "en"}, {"id": "691", "text": "hello world", "language": "en"}, {"id":
+ "692", "text": "hello world", "language": "en"}, {"id": "693", "text": "hello
+ world", "language": "en"}, {"id": "694", "text": "hello world", "language":
+ "en"}, {"id": "695", "text": "hello world", "language": "en"}, {"id": "696",
+ "text": "hello world", "language": "en"}, {"id": "697", "text": "hello world",
+ "language": "en"}, {"id": "698", "text": "hello world", "language": "en"}, {"id":
+ "699", "text": "hello world", "language": "en"}, {"id": "700", "text": "hello
+ world", "language": "en"}, {"id": "701", "text": "hello world", "language":
+ "en"}, {"id": "702", "text": "hello world", "language": "en"}, {"id": "703",
+ "text": "hello world", "language": "en"}, {"id": "704", "text": "hello world",
+ "language": "en"}, {"id": "705", "text": "hello world", "language": "en"}, {"id":
+ "706", "text": "hello world", "language": "en"}, {"id": "707", "text": "hello
+ world", "language": "en"}, {"id": "708", "text": "hello world", "language":
+ "en"}, {"id": "709", "text": "hello world", "language": "en"}, {"id": "710",
+ "text": "hello world", "language": "en"}, {"id": "711", "text": "hello world",
+ "language": "en"}, {"id": "712", "text": "hello world", "language": "en"}, {"id":
+ "713", "text": "hello world", "language": "en"}, {"id": "714", "text": "hello
+ world", "language": "en"}, {"id": "715", "text": "hello world", "language":
+ "en"}, {"id": "716", "text": "hello world", "language": "en"}, {"id": "717",
+ "text": "hello world", "language": "en"}, {"id": "718", "text": "hello world",
+ "language": "en"}, {"id": "719", "text": "hello world", "language": "en"}, {"id":
+ "720", "text": "hello world", "language": "en"}, {"id": "721", "text": "hello
+ world", "language": "en"}, {"id": "722", "text": "hello world", "language":
+ "en"}, {"id": "723", "text": "hello world", "language": "en"}, {"id": "724",
+ "text": "hello world", "language": "en"}, {"id": "725", "text": "hello world",
+ "language": "en"}, {"id": "726", "text": "hello world", "language": "en"}, {"id":
+ "727", "text": "hello world", "language": "en"}, {"id": "728", "text": "hello
+ world", "language": "en"}, {"id": "729", "text": "hello world", "language":
+ "en"}, {"id": "730", "text": "hello world", "language": "en"}, {"id": "731",
+ "text": "hello world", "language": "en"}, {"id": "732", "text": "hello world",
+ "language": "en"}, {"id": "733", "text": "hello world", "language": "en"}, {"id":
+ "734", "text": "hello world", "language": "en"}, {"id": "735", "text": "hello
+ world", "language": "en"}, {"id": "736", "text": "hello world", "language":
+ "en"}, {"id": "737", "text": "hello world", "language": "en"}, {"id": "738",
+ "text": "hello world", "language": "en"}, {"id": "739", "text": "hello world",
+ "language": "en"}, {"id": "740", "text": "hello world", "language": "en"}, {"id":
+ "741", "text": "hello world", "language": "en"}, {"id": "742", "text": "hello
+ world", "language": "en"}, {"id": "743", "text": "hello world", "language":
+ "en"}, {"id": "744", "text": "hello world", "language": "en"}, {"id": "745",
+ "text": "hello world", "language": "en"}, {"id": "746", "text": "hello world",
+ "language": "en"}, {"id": "747", "text": "hello world", "language": "en"}, {"id":
+ "748", "text": "hello world", "language": "en"}, {"id": "749", "text": "hello
+ world", "language": "en"}, {"id": "750", "text": "hello world", "language":
+ "en"}, {"id": "751", "text": "hello world", "language": "en"}, {"id": "752",
+ "text": "hello world", "language": "en"}, {"id": "753", "text": "hello world",
+ "language": "en"}, {"id": "754", "text": "hello world", "language": "en"}, {"id":
+ "755", "text": "hello world", "language": "en"}, {"id": "756", "text": "hello
+ world", "language": "en"}, {"id": "757", "text": "hello world", "language":
+ "en"}, {"id": "758", "text": "hello world", "language": "en"}, {"id": "759",
+ "text": "hello world", "language": "en"}, {"id": "760", "text": "hello world",
+ "language": "en"}, {"id": "761", "text": "hello world", "language": "en"}, {"id":
+ "762", "text": "hello world", "language": "en"}, {"id": "763", "text": "hello
+ world", "language": "en"}, {"id": "764", "text": "hello world", "language":
+ "en"}, {"id": "765", "text": "hello world", "language": "en"}, {"id": "766",
+ "text": "hello world", "language": "en"}, {"id": "767", "text": "hello world",
+ "language": "en"}, {"id": "768", "text": "hello world", "language": "en"}, {"id":
+ "769", "text": "hello world", "language": "en"}, {"id": "770", "text": "hello
+ world", "language": "en"}, {"id": "771", "text": "hello world", "language":
+ "en"}, {"id": "772", "text": "hello world", "language": "en"}, {"id": "773",
+ "text": "hello world", "language": "en"}, {"id": "774", "text": "hello world",
+ "language": "en"}, {"id": "775", "text": "hello world", "language": "en"}, {"id":
+ "776", "text": "hello world", "language": "en"}, {"id": "777", "text": "hello
+ world", "language": "en"}, {"id": "778", "text": "hello world", "language":
+ "en"}, {"id": "779", "text": "hello world", "language": "en"}, {"id": "780",
+ "text": "hello world", "language": "en"}, {"id": "781", "text": "hello world",
+ "language": "en"}, {"id": "782", "text": "hello world", "language": "en"}, {"id":
+ "783", "text": "hello world", "language": "en"}, {"id": "784", "text": "hello
+ world", "language": "en"}, {"id": "785", "text": "hello world", "language":
+ "en"}, {"id": "786", "text": "hello world", "language": "en"}, {"id": "787",
+ "text": "hello world", "language": "en"}, {"id": "788", "text": "hello world",
+ "language": "en"}, {"id": "789", "text": "hello world", "language": "en"}, {"id":
+ "790", "text": "hello world", "language": "en"}, {"id": "791", "text": "hello
+ world", "language": "en"}, {"id": "792", "text": "hello world", "language":
+ "en"}, {"id": "793", "text": "hello world", "language": "en"}, {"id": "794",
+ "text": "hello world", "language": "en"}, {"id": "795", "text": "hello world",
+ "language": "en"}, {"id": "796", "text": "hello world", "language": "en"}, {"id":
+ "797", "text": "hello world", "language": "en"}, {"id": "798", "text": "hello
+ world", "language": "en"}, {"id": "799", "text": "hello world", "language":
+ "en"}, {"id": "800", "text": "hello world", "language": "en"}, {"id": "801",
+ "text": "hello world", "language": "en"}, {"id": "802", "text": "hello world",
+ "language": "en"}, {"id": "803", "text": "hello world", "language": "en"}, {"id":
+ "804", "text": "hello world", "language": "en"}, {"id": "805", "text": "hello
+ world", "language": "en"}, {"id": "806", "text": "hello world", "language":
+ "en"}, {"id": "807", "text": "hello world", "language": "en"}, {"id": "808",
+ "text": "hello world", "language": "en"}, {"id": "809", "text": "hello world",
+ "language": "en"}, {"id": "810", "text": "hello world", "language": "en"}, {"id":
+ "811", "text": "hello world", "language": "en"}, {"id": "812", "text": "hello
+ world", "language": "en"}, {"id": "813", "text": "hello world", "language":
+ "en"}, {"id": "814", "text": "hello world", "language": "en"}, {"id": "815",
+ "text": "hello world", "language": "en"}, {"id": "816", "text": "hello world",
+ "language": "en"}, {"id": "817", "text": "hello world", "language": "en"}, {"id":
+ "818", "text": "hello world", "language": "en"}, {"id": "819", "text": "hello
+ world", "language": "en"}, {"id": "820", "text": "hello world", "language":
+ "en"}, {"id": "821", "text": "hello world", "language": "en"}, {"id": "822",
+ "text": "hello world", "language": "en"}, {"id": "823", "text": "hello world",
+ "language": "en"}, {"id": "824", "text": "hello world", "language": "en"}, {"id":
+ "825", "text": "hello world", "language": "en"}, {"id": "826", "text": "hello
+ world", "language": "en"}, {"id": "827", "text": "hello world", "language":
+ "en"}, {"id": "828", "text": "hello world", "language": "en"}, {"id": "829",
+ "text": "hello world", "language": "en"}, {"id": "830", "text": "hello world",
+ "language": "en"}, {"id": "831", "text": "hello world", "language": "en"}, {"id":
+ "832", "text": "hello world", "language": "en"}, {"id": "833", "text": "hello
+ world", "language": "en"}, {"id": "834", "text": "hello world", "language":
+ "en"}, {"id": "835", "text": "hello world", "language": "en"}, {"id": "836",
+ "text": "hello world", "language": "en"}, {"id": "837", "text": "hello world",
+ "language": "en"}, {"id": "838", "text": "hello world", "language": "en"}, {"id":
+ "839", "text": "hello world", "language": "en"}, {"id": "840", "text": "hello
+ world", "language": "en"}, {"id": "841", "text": "hello world", "language":
+ "en"}, {"id": "842", "text": "hello world", "language": "en"}, {"id": "843",
+ "text": "hello world", "language": "en"}, {"id": "844", "text": "hello world",
+ "language": "en"}, {"id": "845", "text": "hello world", "language": "en"}, {"id":
+ "846", "text": "hello world", "language": "en"}, {"id": "847", "text": "hello
+ world", "language": "en"}, {"id": "848", "text": "hello world", "language":
+ "en"}, {"id": "849", "text": "hello world", "language": "en"}, {"id": "850",
+ "text": "hello world", "language": "en"}, {"id": "851", "text": "hello world",
+ "language": "en"}, {"id": "852", "text": "hello world", "language": "en"}, {"id":
+ "853", "text": "hello world", "language": "en"}, {"id": "854", "text": "hello
+ world", "language": "en"}, {"id": "855", "text": "hello world", "language":
+ "en"}, {"id": "856", "text": "hello world", "language": "en"}, {"id": "857",
+ "text": "hello world", "language": "en"}, {"id": "858", "text": "hello world",
+ "language": "en"}, {"id": "859", "text": "hello world", "language": "en"}, {"id":
+ "860", "text": "hello world", "language": "en"}, {"id": "861", "text": "hello
+ world", "language": "en"}, {"id": "862", "text": "hello world", "language":
+ "en"}, {"id": "863", "text": "hello world", "language": "en"}, {"id": "864",
+ "text": "hello world", "language": "en"}, {"id": "865", "text": "hello world",
+ "language": "en"}, {"id": "866", "text": "hello world", "language": "en"}, {"id":
+ "867", "text": "hello world", "language": "en"}, {"id": "868", "text": "hello
+ world", "language": "en"}, {"id": "869", "text": "hello world", "language":
+ "en"}, {"id": "870", "text": "hello world", "language": "en"}, {"id": "871",
+ "text": "hello world", "language": "en"}, {"id": "872", "text": "hello world",
+ "language": "en"}, {"id": "873", "text": "hello world", "language": "en"}, {"id":
+ "874", "text": "hello world", "language": "en"}, {"id": "875", "text": "hello
+ world", "language": "en"}, {"id": "876", "text": "hello world", "language":
+ "en"}, {"id": "877", "text": "hello world", "language": "en"}, {"id": "878",
+ "text": "hello world", "language": "en"}, {"id": "879", "text": "hello world",
+ "language": "en"}, {"id": "880", "text": "hello world", "language": "en"}, {"id":
+ "881", "text": "hello world", "language": "en"}, {"id": "882", "text": "hello
+ world", "language": "en"}, {"id": "883", "text": "hello world", "language":
+ "en"}, {"id": "884", "text": "hello world", "language": "en"}, {"id": "885",
+ "text": "hello world", "language": "en"}, {"id": "886", "text": "hello world",
+ "language": "en"}, {"id": "887", "text": "hello world", "language": "en"}, {"id":
+ "888", "text": "hello world", "language": "en"}, {"id": "889", "text": "hello
+ world", "language": "en"}, {"id": "890", "text": "hello world", "language":
+ "en"}, {"id": "891", "text": "hello world", "language": "en"}, {"id": "892",
+ "text": "hello world", "language": "en"}, {"id": "893", "text": "hello world",
+ "language": "en"}, {"id": "894", "text": "hello world", "language": "en"}, {"id":
+ "895", "text": "hello world", "language": "en"}, {"id": "896", "text": "hello
+ world", "language": "en"}, {"id": "897", "text": "hello world", "language":
+ "en"}, {"id": "898", "text": "hello world", "language": "en"}, {"id": "899",
+ "text": "hello world", "language": "en"}, {"id": "900", "text": "hello world",
+ "language": "en"}, {"id": "901", "text": "hello world", "language": "en"}, {"id":
+ "902", "text": "hello world", "language": "en"}, {"id": "903", "text": "hello
+ world", "language": "en"}, {"id": "904", "text": "hello world", "language":
+ "en"}, {"id": "905", "text": "hello world", "language": "en"}, {"id": "906",
+ "text": "hello world", "language": "en"}, {"id": "907", "text": "hello world",
+ "language": "en"}, {"id": "908", "text": "hello world", "language": "en"}, {"id":
+ "909", "text": "hello world", "language": "en"}, {"id": "910", "text": "hello
+ world", "language": "en"}, {"id": "911", "text": "hello world", "language":
+ "en"}, {"id": "912", "text": "hello world", "language": "en"}, {"id": "913",
+ "text": "hello world", "language": "en"}, {"id": "914", "text": "hello world",
+ "language": "en"}, {"id": "915", "text": "hello world", "language": "en"}, {"id":
+ "916", "text": "hello world", "language": "en"}, {"id": "917", "text": "hello
+ world", "language": "en"}, {"id": "918", "text": "hello world", "language":
+ "en"}, {"id": "919", "text": "hello world", "language": "en"}, {"id": "920",
+ "text": "hello world", "language": "en"}, {"id": "921", "text": "hello world",
+ "language": "en"}, {"id": "922", "text": "hello world", "language": "en"}, {"id":
+ "923", "text": "hello world", "language": "en"}, {"id": "924", "text": "hello
+ world", "language": "en"}, {"id": "925", "text": "hello world", "language":
+ "en"}, {"id": "926", "text": "hello world", "language": "en"}, {"id": "927",
+ "text": "hello world", "language": "en"}, {"id": "928", "text": "hello world",
+ "language": "en"}, {"id": "929", "text": "hello world", "language": "en"}, {"id":
+ "930", "text": "hello world", "language": "en"}, {"id": "931", "text": "hello
+ world", "language": "en"}, {"id": "932", "text": "hello world", "language":
+ "en"}, {"id": "933", "text": "hello world", "language": "en"}, {"id": "934",
+ "text": "hello world", "language": "en"}, {"id": "935", "text": "hello world",
+ "language": "en"}, {"id": "936", "text": "hello world", "language": "en"}, {"id":
+ "937", "text": "hello world", "language": "en"}, {"id": "938", "text": "hello
+ world", "language": "en"}, {"id": "939", "text": "hello world", "language":
+ "en"}, {"id": "940", "text": "hello world", "language": "en"}, {"id": "941",
+ "text": "hello world", "language": "en"}, {"id": "942", "text": "hello world",
+ "language": "en"}, {"id": "943", "text": "hello world", "language": "en"}, {"id":
+ "944", "text": "hello world", "language": "en"}, {"id": "945", "text": "hello
+ world", "language": "en"}, {"id": "946", "text": "hello world", "language":
+ "en"}, {"id": "947", "text": "hello world", "language": "en"}, {"id": "948",
+ "text": "hello world", "language": "en"}, {"id": "949", "text": "hello world",
+ "language": "en"}, {"id": "950", "text": "hello world", "language": "en"}, {"id":
+ "951", "text": "hello world", "language": "en"}, {"id": "952", "text": "hello
+ world", "language": "en"}, {"id": "953", "text": "hello world", "language":
+ "en"}, {"id": "954", "text": "hello world", "language": "en"}, {"id": "955",
+ "text": "hello world", "language": "en"}, {"id": "956", "text": "hello world",
+ "language": "en"}, {"id": "957", "text": "hello world", "language": "en"}, {"id":
+ "958", "text": "hello world", "language": "en"}, {"id": "959", "text": "hello
+ world", "language": "en"}, {"id": "960", "text": "hello world", "language":
+ "en"}, {"id": "961", "text": "hello world", "language": "en"}, {"id": "962",
+ "text": "hello world", "language": "en"}, {"id": "963", "text": "hello world",
+ "language": "en"}, {"id": "964", "text": "hello world", "language": "en"}, {"id":
+ "965", "text": "hello world", "language": "en"}, {"id": "966", "text": "hello
+ world", "language": "en"}, {"id": "967", "text": "hello world", "language":
+ "en"}, {"id": "968", "text": "hello world", "language": "en"}, {"id": "969",
+ "text": "hello world", "language": "en"}, {"id": "970", "text": "hello world",
+ "language": "en"}, {"id": "971", "text": "hello world", "language": "en"}, {"id":
+ "972", "text": "hello world", "language": "en"}, {"id": "973", "text": "hello
+ world", "language": "en"}, {"id": "974", "text": "hello world", "language":
+ "en"}, {"id": "975", "text": "hello world", "language": "en"}, {"id": "976",
+ "text": "hello world", "language": "en"}, {"id": "977", "text": "hello world",
+ "language": "en"}, {"id": "978", "text": "hello world", "language": "en"}, {"id":
+ "979", "text": "hello world", "language": "en"}, {"id": "980", "text": "hello
+ world", "language": "en"}, {"id": "981", "text": "hello world", "language":
+ "en"}, {"id": "982", "text": "hello world", "language": "en"}, {"id": "983",
+ "text": "hello world", "language": "en"}, {"id": "984", "text": "hello world",
+ "language": "en"}, {"id": "985", "text": "hello world", "language": "en"}, {"id":
+ "986", "text": "hello world", "language": "en"}, {"id": "987", "text": "hello
+ world", "language": "en"}, {"id": "988", "text": "hello world", "language":
+ "en"}, {"id": "989", "text": "hello world", "language": "en"}, {"id": "990",
+ "text": "hello world", "language": "en"}, {"id": "991", "text": "hello world",
+ "language": "en"}, {"id": "992", "text": "hello world", "language": "en"}, {"id":
+ "993", "text": "hello world", "language": "en"}, {"id": "994", "text": "hello
+ world", "language": "en"}, {"id": "995", "text": "hello world", "language":
+ "en"}, {"id": "996", "text": "hello world", "language": "en"}, {"id": "997",
+ "text": "hello world", "language": "en"}, {"id": "998", "text": "hello world",
+ "language": "en"}, {"id": "999", "text": "hello world", "language": "en"}, {"id":
+ "1000", "text": "hello world", "language": "en"}, {"id": "1001", "text": "hello
+ world", "language": "en"}, {"id": "1002", "text": "hello world", "language":
+ "en"}, {"id": "1003", "text": "hello world", "language": "en"}, {"id": "1004",
+ "text": "hello world", "language": "en"}, {"id": "1005", "text": "hello world",
+ "language": "en"}, {"id": "1006", "text": "hello world", "language": "en"},
+ {"id": "1007", "text": "hello world", "language": "en"}, {"id": "1008", "text":
+ "hello world", "language": "en"}, {"id": "1009", "text": "hello world", "language":
+ "en"}, {"id": "1010", "text": "hello world", "language": "en"}, {"id": "1011",
+ "text": "hello world", "language": "en"}, {"id": "1012", "text": "hello world",
+ "language": "en"}, {"id": "1013", "text": "hello world", "language": "en"},
+ {"id": "1014", "text": "hello world", "language": "en"}, {"id": "1015", "text":
+ "hello world", "language": "en"}, {"id": "1016", "text": "hello world", "language":
+ "en"}, {"id": "1017", "text": "hello world", "language": "en"}, {"id": "1018",
+ "text": "hello world", "language": "en"}, {"id": "1019", "text": "hello world",
+ "language": "en"}, {"id": "1020", "text": "hello world", "language": "en"},
+ {"id": "1021", "text": "hello world", "language": "en"}, {"id": "1022", "text":
+ "hello world", "language": "en"}, {"id": "1023", "text": "hello world", "language":
+ "en"}, {"id": "1024", "text": "hello world", "language": "en"}, {"id": "1025",
+ "text": "hello world", "language": "en"}, {"id": "1026", "text": "hello world",
+ "language": "en"}, {"id": "1027", "text": "hello world", "language": "en"},
+ {"id": "1028", "text": "hello world", "language": "en"}, {"id": "1029", "text":
+ "hello world", "language": "en"}, {"id": "1030", "text": "hello world", "language":
+ "en"}, {"id": "1031", "text": "hello world", "language": "en"}, {"id": "1032",
+ "text": "hello world", "language": "en"}, {"id": "1033", "text": "hello world",
+ "language": "en"}, {"id": "1034", "text": "hello world", "language": "en"},
+ {"id": "1035", "text": "hello world", "language": "en"}, {"id": "1036", "text":
+ "hello world", "language": "en"}, {"id": "1037", "text": "hello world", "language":
+ "en"}, {"id": "1038", "text": "hello world", "language": "en"}, {"id": "1039",
+ "text": "hello world", "language": "en"}, {"id": "1040", "text": "hello world",
+ "language": "en"}, {"id": "1041", "text": "hello world", "language": "en"},
+ {"id": "1042", "text": "hello world", "language": "en"}, {"id": "1043", "text":
+ "hello world", "language": "en"}, {"id": "1044", "text": "hello world", "language":
+ "en"}, {"id": "1045", "text": "hello world", "language": "en"}, {"id": "1046",
+ "text": "hello world", "language": "en"}, {"id": "1047", "text": "hello world",
+ "language": "en"}, {"id": "1048", "text": "hello world", "language": "en"},
+ {"id": "1049", "text": "hello world", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '58755'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
+ request contains too many records. Max 1000 records are permitted."}}}'
+ headers:
+ apim-request-id:
+ - e5020bb3-4385-4907-a1b3-61723f79cc79
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:44 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '12'
+ status:
+ code: 400
+ message: Bad Request
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_batch_size_over_limit_error.yaml
new file mode 100644
index 000000000000..6df091febc9b
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_batch_size_over_limit_error.yaml
@@ -0,0 +1,751 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "hello world", "language": "en"}, {"id":
+ "1", "text": "hello world", "language": "en"}, {"id": "2", "text": "hello world",
+ "language": "en"}, {"id": "3", "text": "hello world", "language": "en"}, {"id":
+ "4", "text": "hello world", "language": "en"}, {"id": "5", "text": "hello world",
+ "language": "en"}, {"id": "6", "text": "hello world", "language": "en"}, {"id":
+ "7", "text": "hello world", "language": "en"}, {"id": "8", "text": "hello world",
+ "language": "en"}, {"id": "9", "text": "hello world", "language": "en"}, {"id":
+ "10", "text": "hello world", "language": "en"}, {"id": "11", "text": "hello
+ world", "language": "en"}, {"id": "12", "text": "hello world", "language": "en"},
+ {"id": "13", "text": "hello world", "language": "en"}, {"id": "14", "text":
+ "hello world", "language": "en"}, {"id": "15", "text": "hello world", "language":
+ "en"}, {"id": "16", "text": "hello world", "language": "en"}, {"id": "17", "text":
+ "hello world", "language": "en"}, {"id": "18", "text": "hello world", "language":
+ "en"}, {"id": "19", "text": "hello world", "language": "en"}, {"id": "20", "text":
+ "hello world", "language": "en"}, {"id": "21", "text": "hello world", "language":
+ "en"}, {"id": "22", "text": "hello world", "language": "en"}, {"id": "23", "text":
+ "hello world", "language": "en"}, {"id": "24", "text": "hello world", "language":
+ "en"}, {"id": "25", "text": "hello world", "language": "en"}, {"id": "26", "text":
+ "hello world", "language": "en"}, {"id": "27", "text": "hello world", "language":
+ "en"}, {"id": "28", "text": "hello world", "language": "en"}, {"id": "29", "text":
+ "hello world", "language": "en"}, {"id": "30", "text": "hello world", "language":
+ "en"}, {"id": "31", "text": "hello world", "language": "en"}, {"id": "32", "text":
+ "hello world", "language": "en"}, {"id": "33", "text": "hello world", "language":
+ "en"}, {"id": "34", "text": "hello world", "language": "en"}, {"id": "35", "text":
+ "hello world", "language": "en"}, {"id": "36", "text": "hello world", "language":
+ "en"}, {"id": "37", "text": "hello world", "language": "en"}, {"id": "38", "text":
+ "hello world", "language": "en"}, {"id": "39", "text": "hello world", "language":
+ "en"}, {"id": "40", "text": "hello world", "language": "en"}, {"id": "41", "text":
+ "hello world", "language": "en"}, {"id": "42", "text": "hello world", "language":
+ "en"}, {"id": "43", "text": "hello world", "language": "en"}, {"id": "44", "text":
+ "hello world", "language": "en"}, {"id": "45", "text": "hello world", "language":
+ "en"}, {"id": "46", "text": "hello world", "language": "en"}, {"id": "47", "text":
+ "hello world", "language": "en"}, {"id": "48", "text": "hello world", "language":
+ "en"}, {"id": "49", "text": "hello world", "language": "en"}, {"id": "50", "text":
+ "hello world", "language": "en"}, {"id": "51", "text": "hello world", "language":
+ "en"}, {"id": "52", "text": "hello world", "language": "en"}, {"id": "53", "text":
+ "hello world", "language": "en"}, {"id": "54", "text": "hello world", "language":
+ "en"}, {"id": "55", "text": "hello world", "language": "en"}, {"id": "56", "text":
+ "hello world", "language": "en"}, {"id": "57", "text": "hello world", "language":
+ "en"}, {"id": "58", "text": "hello world", "language": "en"}, {"id": "59", "text":
+ "hello world", "language": "en"}, {"id": "60", "text": "hello world", "language":
+ "en"}, {"id": "61", "text": "hello world", "language": "en"}, {"id": "62", "text":
+ "hello world", "language": "en"}, {"id": "63", "text": "hello world", "language":
+ "en"}, {"id": "64", "text": "hello world", "language": "en"}, {"id": "65", "text":
+ "hello world", "language": "en"}, {"id": "66", "text": "hello world", "language":
+ "en"}, {"id": "67", "text": "hello world", "language": "en"}, {"id": "68", "text":
+ "hello world", "language": "en"}, {"id": "69", "text": "hello world", "language":
+ "en"}, {"id": "70", "text": "hello world", "language": "en"}, {"id": "71", "text":
+ "hello world", "language": "en"}, {"id": "72", "text": "hello world", "language":
+ "en"}, {"id": "73", "text": "hello world", "language": "en"}, {"id": "74", "text":
+ "hello world", "language": "en"}, {"id": "75", "text": "hello world", "language":
+ "en"}, {"id": "76", "text": "hello world", "language": "en"}, {"id": "77", "text":
+ "hello world", "language": "en"}, {"id": "78", "text": "hello world", "language":
+ "en"}, {"id": "79", "text": "hello world", "language": "en"}, {"id": "80", "text":
+ "hello world", "language": "en"}, {"id": "81", "text": "hello world", "language":
+ "en"}, {"id": "82", "text": "hello world", "language": "en"}, {"id": "83", "text":
+ "hello world", "language": "en"}, {"id": "84", "text": "hello world", "language":
+ "en"}, {"id": "85", "text": "hello world", "language": "en"}, {"id": "86", "text":
+ "hello world", "language": "en"}, {"id": "87", "text": "hello world", "language":
+ "en"}, {"id": "88", "text": "hello world", "language": "en"}, {"id": "89", "text":
+ "hello world", "language": "en"}, {"id": "90", "text": "hello world", "language":
+ "en"}, {"id": "91", "text": "hello world", "language": "en"}, {"id": "92", "text":
+ "hello world", "language": "en"}, {"id": "93", "text": "hello world", "language":
+ "en"}, {"id": "94", "text": "hello world", "language": "en"}, {"id": "95", "text":
+ "hello world", "language": "en"}, {"id": "96", "text": "hello world", "language":
+ "en"}, {"id": "97", "text": "hello world", "language": "en"}, {"id": "98", "text":
+ "hello world", "language": "en"}, {"id": "99", "text": "hello world", "language":
+ "en"}, {"id": "100", "text": "hello world", "language": "en"}, {"id": "101",
+ "text": "hello world", "language": "en"}, {"id": "102", "text": "hello world",
+ "language": "en"}, {"id": "103", "text": "hello world", "language": "en"}, {"id":
+ "104", "text": "hello world", "language": "en"}, {"id": "105", "text": "hello
+ world", "language": "en"}, {"id": "106", "text": "hello world", "language":
+ "en"}, {"id": "107", "text": "hello world", "language": "en"}, {"id": "108",
+ "text": "hello world", "language": "en"}, {"id": "109", "text": "hello world",
+ "language": "en"}, {"id": "110", "text": "hello world", "language": "en"}, {"id":
+ "111", "text": "hello world", "language": "en"}, {"id": "112", "text": "hello
+ world", "language": "en"}, {"id": "113", "text": "hello world", "language":
+ "en"}, {"id": "114", "text": "hello world", "language": "en"}, {"id": "115",
+ "text": "hello world", "language": "en"}, {"id": "116", "text": "hello world",
+ "language": "en"}, {"id": "117", "text": "hello world", "language": "en"}, {"id":
+ "118", "text": "hello world", "language": "en"}, {"id": "119", "text": "hello
+ world", "language": "en"}, {"id": "120", "text": "hello world", "language":
+ "en"}, {"id": "121", "text": "hello world", "language": "en"}, {"id": "122",
+ "text": "hello world", "language": "en"}, {"id": "123", "text": "hello world",
+ "language": "en"}, {"id": "124", "text": "hello world", "language": "en"}, {"id":
+ "125", "text": "hello world", "language": "en"}, {"id": "126", "text": "hello
+ world", "language": "en"}, {"id": "127", "text": "hello world", "language":
+ "en"}, {"id": "128", "text": "hello world", "language": "en"}, {"id": "129",
+ "text": "hello world", "language": "en"}, {"id": "130", "text": "hello world",
+ "language": "en"}, {"id": "131", "text": "hello world", "language": "en"}, {"id":
+ "132", "text": "hello world", "language": "en"}, {"id": "133", "text": "hello
+ world", "language": "en"}, {"id": "134", "text": "hello world", "language":
+ "en"}, {"id": "135", "text": "hello world", "language": "en"}, {"id": "136",
+ "text": "hello world", "language": "en"}, {"id": "137", "text": "hello world",
+ "language": "en"}, {"id": "138", "text": "hello world", "language": "en"}, {"id":
+ "139", "text": "hello world", "language": "en"}, {"id": "140", "text": "hello
+ world", "language": "en"}, {"id": "141", "text": "hello world", "language":
+ "en"}, {"id": "142", "text": "hello world", "language": "en"}, {"id": "143",
+ "text": "hello world", "language": "en"}, {"id": "144", "text": "hello world",
+ "language": "en"}, {"id": "145", "text": "hello world", "language": "en"}, {"id":
+ "146", "text": "hello world", "language": "en"}, {"id": "147", "text": "hello
+ world", "language": "en"}, {"id": "148", "text": "hello world", "language":
+ "en"}, {"id": "149", "text": "hello world", "language": "en"}, {"id": "150",
+ "text": "hello world", "language": "en"}, {"id": "151", "text": "hello world",
+ "language": "en"}, {"id": "152", "text": "hello world", "language": "en"}, {"id":
+ "153", "text": "hello world", "language": "en"}, {"id": "154", "text": "hello
+ world", "language": "en"}, {"id": "155", "text": "hello world", "language":
+ "en"}, {"id": "156", "text": "hello world", "language": "en"}, {"id": "157",
+ "text": "hello world", "language": "en"}, {"id": "158", "text": "hello world",
+ "language": "en"}, {"id": "159", "text": "hello world", "language": "en"}, {"id":
+ "160", "text": "hello world", "language": "en"}, {"id": "161", "text": "hello
+ world", "language": "en"}, {"id": "162", "text": "hello world", "language":
+ "en"}, {"id": "163", "text": "hello world", "language": "en"}, {"id": "164",
+ "text": "hello world", "language": "en"}, {"id": "165", "text": "hello world",
+ "language": "en"}, {"id": "166", "text": "hello world", "language": "en"}, {"id":
+ "167", "text": "hello world", "language": "en"}, {"id": "168", "text": "hello
+ world", "language": "en"}, {"id": "169", "text": "hello world", "language":
+ "en"}, {"id": "170", "text": "hello world", "language": "en"}, {"id": "171",
+ "text": "hello world", "language": "en"}, {"id": "172", "text": "hello world",
+ "language": "en"}, {"id": "173", "text": "hello world", "language": "en"}, {"id":
+ "174", "text": "hello world", "language": "en"}, {"id": "175", "text": "hello
+ world", "language": "en"}, {"id": "176", "text": "hello world", "language":
+ "en"}, {"id": "177", "text": "hello world", "language": "en"}, {"id": "178",
+ "text": "hello world", "language": "en"}, {"id": "179", "text": "hello world",
+ "language": "en"}, {"id": "180", "text": "hello world", "language": "en"}, {"id":
+ "181", "text": "hello world", "language": "en"}, {"id": "182", "text": "hello
+ world", "language": "en"}, {"id": "183", "text": "hello world", "language":
+ "en"}, {"id": "184", "text": "hello world", "language": "en"}, {"id": "185",
+ "text": "hello world", "language": "en"}, {"id": "186", "text": "hello world",
+ "language": "en"}, {"id": "187", "text": "hello world", "language": "en"}, {"id":
+ "188", "text": "hello world", "language": "en"}, {"id": "189", "text": "hello
+ world", "language": "en"}, {"id": "190", "text": "hello world", "language":
+ "en"}, {"id": "191", "text": "hello world", "language": "en"}, {"id": "192",
+ "text": "hello world", "language": "en"}, {"id": "193", "text": "hello world",
+ "language": "en"}, {"id": "194", "text": "hello world", "language": "en"}, {"id":
+ "195", "text": "hello world", "language": "en"}, {"id": "196", "text": "hello
+ world", "language": "en"}, {"id": "197", "text": "hello world", "language":
+ "en"}, {"id": "198", "text": "hello world", "language": "en"}, {"id": "199",
+ "text": "hello world", "language": "en"}, {"id": "200", "text": "hello world",
+ "language": "en"}, {"id": "201", "text": "hello world", "language": "en"}, {"id":
+ "202", "text": "hello world", "language": "en"}, {"id": "203", "text": "hello
+ world", "language": "en"}, {"id": "204", "text": "hello world", "language":
+ "en"}, {"id": "205", "text": "hello world", "language": "en"}, {"id": "206",
+ "text": "hello world", "language": "en"}, {"id": "207", "text": "hello world",
+ "language": "en"}, {"id": "208", "text": "hello world", "language": "en"}, {"id":
+ "209", "text": "hello world", "language": "en"}, {"id": "210", "text": "hello
+ world", "language": "en"}, {"id": "211", "text": "hello world", "language":
+ "en"}, {"id": "212", "text": "hello world", "language": "en"}, {"id": "213",
+ "text": "hello world", "language": "en"}, {"id": "214", "text": "hello world",
+ "language": "en"}, {"id": "215", "text": "hello world", "language": "en"}, {"id":
+ "216", "text": "hello world", "language": "en"}, {"id": "217", "text": "hello
+ world", "language": "en"}, {"id": "218", "text": "hello world", "language":
+ "en"}, {"id": "219", "text": "hello world", "language": "en"}, {"id": "220",
+ "text": "hello world", "language": "en"}, {"id": "221", "text": "hello world",
+ "language": "en"}, {"id": "222", "text": "hello world", "language": "en"}, {"id":
+ "223", "text": "hello world", "language": "en"}, {"id": "224", "text": "hello
+ world", "language": "en"}, {"id": "225", "text": "hello world", "language":
+ "en"}, {"id": "226", "text": "hello world", "language": "en"}, {"id": "227",
+ "text": "hello world", "language": "en"}, {"id": "228", "text": "hello world",
+ "language": "en"}, {"id": "229", "text": "hello world", "language": "en"}, {"id":
+ "230", "text": "hello world", "language": "en"}, {"id": "231", "text": "hello
+ world", "language": "en"}, {"id": "232", "text": "hello world", "language":
+ "en"}, {"id": "233", "text": "hello world", "language": "en"}, {"id": "234",
+ "text": "hello world", "language": "en"}, {"id": "235", "text": "hello world",
+ "language": "en"}, {"id": "236", "text": "hello world", "language": "en"}, {"id":
+ "237", "text": "hello world", "language": "en"}, {"id": "238", "text": "hello
+ world", "language": "en"}, {"id": "239", "text": "hello world", "language":
+ "en"}, {"id": "240", "text": "hello world", "language": "en"}, {"id": "241",
+ "text": "hello world", "language": "en"}, {"id": "242", "text": "hello world",
+ "language": "en"}, {"id": "243", "text": "hello world", "language": "en"}, {"id":
+ "244", "text": "hello world", "language": "en"}, {"id": "245", "text": "hello
+ world", "language": "en"}, {"id": "246", "text": "hello world", "language":
+ "en"}, {"id": "247", "text": "hello world", "language": "en"}, {"id": "248",
+ "text": "hello world", "language": "en"}, {"id": "249", "text": "hello world",
+ "language": "en"}, {"id": "250", "text": "hello world", "language": "en"}, {"id":
+ "251", "text": "hello world", "language": "en"}, {"id": "252", "text": "hello
+ world", "language": "en"}, {"id": "253", "text": "hello world", "language":
+ "en"}, {"id": "254", "text": "hello world", "language": "en"}, {"id": "255",
+ "text": "hello world", "language": "en"}, {"id": "256", "text": "hello world",
+ "language": "en"}, {"id": "257", "text": "hello world", "language": "en"}, {"id":
+ "258", "text": "hello world", "language": "en"}, {"id": "259", "text": "hello
+ world", "language": "en"}, {"id": "260", "text": "hello world", "language":
+ "en"}, {"id": "261", "text": "hello world", "language": "en"}, {"id": "262",
+ "text": "hello world", "language": "en"}, {"id": "263", "text": "hello world",
+ "language": "en"}, {"id": "264", "text": "hello world", "language": "en"}, {"id":
+ "265", "text": "hello world", "language": "en"}, {"id": "266", "text": "hello
+ world", "language": "en"}, {"id": "267", "text": "hello world", "language":
+ "en"}, {"id": "268", "text": "hello world", "language": "en"}, {"id": "269",
+ "text": "hello world", "language": "en"}, {"id": "270", "text": "hello world",
+ "language": "en"}, {"id": "271", "text": "hello world", "language": "en"}, {"id":
+ "272", "text": "hello world", "language": "en"}, {"id": "273", "text": "hello
+ world", "language": "en"}, {"id": "274", "text": "hello world", "language":
+ "en"}, {"id": "275", "text": "hello world", "language": "en"}, {"id": "276",
+ "text": "hello world", "language": "en"}, {"id": "277", "text": "hello world",
+ "language": "en"}, {"id": "278", "text": "hello world", "language": "en"}, {"id":
+ "279", "text": "hello world", "language": "en"}, {"id": "280", "text": "hello
+ world", "language": "en"}, {"id": "281", "text": "hello world", "language":
+ "en"}, {"id": "282", "text": "hello world", "language": "en"}, {"id": "283",
+ "text": "hello world", "language": "en"}, {"id": "284", "text": "hello world",
+ "language": "en"}, {"id": "285", "text": "hello world", "language": "en"}, {"id":
+ "286", "text": "hello world", "language": "en"}, {"id": "287", "text": "hello
+ world", "language": "en"}, {"id": "288", "text": "hello world", "language":
+ "en"}, {"id": "289", "text": "hello world", "language": "en"}, {"id": "290",
+ "text": "hello world", "language": "en"}, {"id": "291", "text": "hello world",
+ "language": "en"}, {"id": "292", "text": "hello world", "language": "en"}, {"id":
+ "293", "text": "hello world", "language": "en"}, {"id": "294", "text": "hello
+ world", "language": "en"}, {"id": "295", "text": "hello world", "language":
+ "en"}, {"id": "296", "text": "hello world", "language": "en"}, {"id": "297",
+ "text": "hello world", "language": "en"}, {"id": "298", "text": "hello world",
+ "language": "en"}, {"id": "299", "text": "hello world", "language": "en"}, {"id":
+ "300", "text": "hello world", "language": "en"}, {"id": "301", "text": "hello
+ world", "language": "en"}, {"id": "302", "text": "hello world", "language":
+ "en"}, {"id": "303", "text": "hello world", "language": "en"}, {"id": "304",
+ "text": "hello world", "language": "en"}, {"id": "305", "text": "hello world",
+ "language": "en"}, {"id": "306", "text": "hello world", "language": "en"}, {"id":
+ "307", "text": "hello world", "language": "en"}, {"id": "308", "text": "hello
+ world", "language": "en"}, {"id": "309", "text": "hello world", "language":
+ "en"}, {"id": "310", "text": "hello world", "language": "en"}, {"id": "311",
+ "text": "hello world", "language": "en"}, {"id": "312", "text": "hello world",
+ "language": "en"}, {"id": "313", "text": "hello world", "language": "en"}, {"id":
+ "314", "text": "hello world", "language": "en"}, {"id": "315", "text": "hello
+ world", "language": "en"}, {"id": "316", "text": "hello world", "language":
+ "en"}, {"id": "317", "text": "hello world", "language": "en"}, {"id": "318",
+ "text": "hello world", "language": "en"}, {"id": "319", "text": "hello world",
+ "language": "en"}, {"id": "320", "text": "hello world", "language": "en"}, {"id":
+ "321", "text": "hello world", "language": "en"}, {"id": "322", "text": "hello
+ world", "language": "en"}, {"id": "323", "text": "hello world", "language":
+ "en"}, {"id": "324", "text": "hello world", "language": "en"}, {"id": "325",
+ "text": "hello world", "language": "en"}, {"id": "326", "text": "hello world",
+ "language": "en"}, {"id": "327", "text": "hello world", "language": "en"}, {"id":
+ "328", "text": "hello world", "language": "en"}, {"id": "329", "text": "hello
+ world", "language": "en"}, {"id": "330", "text": "hello world", "language":
+ "en"}, {"id": "331", "text": "hello world", "language": "en"}, {"id": "332",
+ "text": "hello world", "language": "en"}, {"id": "333", "text": "hello world",
+ "language": "en"}, {"id": "334", "text": "hello world", "language": "en"}, {"id":
+ "335", "text": "hello world", "language": "en"}, {"id": "336", "text": "hello
+ world", "language": "en"}, {"id": "337", "text": "hello world", "language":
+ "en"}, {"id": "338", "text": "hello world", "language": "en"}, {"id": "339",
+ "text": "hello world", "language": "en"}, {"id": "340", "text": "hello world",
+ "language": "en"}, {"id": "341", "text": "hello world", "language": "en"}, {"id":
+ "342", "text": "hello world", "language": "en"}, {"id": "343", "text": "hello
+ world", "language": "en"}, {"id": "344", "text": "hello world", "language":
+ "en"}, {"id": "345", "text": "hello world", "language": "en"}, {"id": "346",
+ "text": "hello world", "language": "en"}, {"id": "347", "text": "hello world",
+ "language": "en"}, {"id": "348", "text": "hello world", "language": "en"}, {"id":
+ "349", "text": "hello world", "language": "en"}, {"id": "350", "text": "hello
+ world", "language": "en"}, {"id": "351", "text": "hello world", "language":
+ "en"}, {"id": "352", "text": "hello world", "language": "en"}, {"id": "353",
+ "text": "hello world", "language": "en"}, {"id": "354", "text": "hello world",
+ "language": "en"}, {"id": "355", "text": "hello world", "language": "en"}, {"id":
+ "356", "text": "hello world", "language": "en"}, {"id": "357", "text": "hello
+ world", "language": "en"}, {"id": "358", "text": "hello world", "language":
+ "en"}, {"id": "359", "text": "hello world", "language": "en"}, {"id": "360",
+ "text": "hello world", "language": "en"}, {"id": "361", "text": "hello world",
+ "language": "en"}, {"id": "362", "text": "hello world", "language": "en"}, {"id":
+ "363", "text": "hello world", "language": "en"}, {"id": "364", "text": "hello
+ world", "language": "en"}, {"id": "365", "text": "hello world", "language":
+ "en"}, {"id": "366", "text": "hello world", "language": "en"}, {"id": "367",
+ "text": "hello world", "language": "en"}, {"id": "368", "text": "hello world",
+ "language": "en"}, {"id": "369", "text": "hello world", "language": "en"}, {"id":
+ "370", "text": "hello world", "language": "en"}, {"id": "371", "text": "hello
+ world", "language": "en"}, {"id": "372", "text": "hello world", "language":
+ "en"}, {"id": "373", "text": "hello world", "language": "en"}, {"id": "374",
+ "text": "hello world", "language": "en"}, {"id": "375", "text": "hello world",
+ "language": "en"}, {"id": "376", "text": "hello world", "language": "en"}, {"id":
+ "377", "text": "hello world", "language": "en"}, {"id": "378", "text": "hello
+ world", "language": "en"}, {"id": "379", "text": "hello world", "language":
+ "en"}, {"id": "380", "text": "hello world", "language": "en"}, {"id": "381",
+ "text": "hello world", "language": "en"}, {"id": "382", "text": "hello world",
+ "language": "en"}, {"id": "383", "text": "hello world", "language": "en"}, {"id":
+ "384", "text": "hello world", "language": "en"}, {"id": "385", "text": "hello
+ world", "language": "en"}, {"id": "386", "text": "hello world", "language":
+ "en"}, {"id": "387", "text": "hello world", "language": "en"}, {"id": "388",
+ "text": "hello world", "language": "en"}, {"id": "389", "text": "hello world",
+ "language": "en"}, {"id": "390", "text": "hello world", "language": "en"}, {"id":
+ "391", "text": "hello world", "language": "en"}, {"id": "392", "text": "hello
+ world", "language": "en"}, {"id": "393", "text": "hello world", "language":
+ "en"}, {"id": "394", "text": "hello world", "language": "en"}, {"id": "395",
+ "text": "hello world", "language": "en"}, {"id": "396", "text": "hello world",
+ "language": "en"}, {"id": "397", "text": "hello world", "language": "en"}, {"id":
+ "398", "text": "hello world", "language": "en"}, {"id": "399", "text": "hello
+ world", "language": "en"}, {"id": "400", "text": "hello world", "language":
+ "en"}, {"id": "401", "text": "hello world", "language": "en"}, {"id": "402",
+ "text": "hello world", "language": "en"}, {"id": "403", "text": "hello world",
+ "language": "en"}, {"id": "404", "text": "hello world", "language": "en"}, {"id":
+ "405", "text": "hello world", "language": "en"}, {"id": "406", "text": "hello
+ world", "language": "en"}, {"id": "407", "text": "hello world", "language":
+ "en"}, {"id": "408", "text": "hello world", "language": "en"}, {"id": "409",
+ "text": "hello world", "language": "en"}, {"id": "410", "text": "hello world",
+ "language": "en"}, {"id": "411", "text": "hello world", "language": "en"}, {"id":
+ "412", "text": "hello world", "language": "en"}, {"id": "413", "text": "hello
+ world", "language": "en"}, {"id": "414", "text": "hello world", "language":
+ "en"}, {"id": "415", "text": "hello world", "language": "en"}, {"id": "416",
+ "text": "hello world", "language": "en"}, {"id": "417", "text": "hello world",
+ "language": "en"}, {"id": "418", "text": "hello world", "language": "en"}, {"id":
+ "419", "text": "hello world", "language": "en"}, {"id": "420", "text": "hello
+ world", "language": "en"}, {"id": "421", "text": "hello world", "language":
+ "en"}, {"id": "422", "text": "hello world", "language": "en"}, {"id": "423",
+ "text": "hello world", "language": "en"}, {"id": "424", "text": "hello world",
+ "language": "en"}, {"id": "425", "text": "hello world", "language": "en"}, {"id":
+ "426", "text": "hello world", "language": "en"}, {"id": "427", "text": "hello
+ world", "language": "en"}, {"id": "428", "text": "hello world", "language":
+ "en"}, {"id": "429", "text": "hello world", "language": "en"}, {"id": "430",
+ "text": "hello world", "language": "en"}, {"id": "431", "text": "hello world",
+ "language": "en"}, {"id": "432", "text": "hello world", "language": "en"}, {"id":
+ "433", "text": "hello world", "language": "en"}, {"id": "434", "text": "hello
+ world", "language": "en"}, {"id": "435", "text": "hello world", "language":
+ "en"}, {"id": "436", "text": "hello world", "language": "en"}, {"id": "437",
+ "text": "hello world", "language": "en"}, {"id": "438", "text": "hello world",
+ "language": "en"}, {"id": "439", "text": "hello world", "language": "en"}, {"id":
+ "440", "text": "hello world", "language": "en"}, {"id": "441", "text": "hello
+ world", "language": "en"}, {"id": "442", "text": "hello world", "language":
+ "en"}, {"id": "443", "text": "hello world", "language": "en"}, {"id": "444",
+ "text": "hello world", "language": "en"}, {"id": "445", "text": "hello world",
+ "language": "en"}, {"id": "446", "text": "hello world", "language": "en"}, {"id":
+ "447", "text": "hello world", "language": "en"}, {"id": "448", "text": "hello
+ world", "language": "en"}, {"id": "449", "text": "hello world", "language":
+ "en"}, {"id": "450", "text": "hello world", "language": "en"}, {"id": "451",
+ "text": "hello world", "language": "en"}, {"id": "452", "text": "hello world",
+ "language": "en"}, {"id": "453", "text": "hello world", "language": "en"}, {"id":
+ "454", "text": "hello world", "language": "en"}, {"id": "455", "text": "hello
+ world", "language": "en"}, {"id": "456", "text": "hello world", "language":
+ "en"}, {"id": "457", "text": "hello world", "language": "en"}, {"id": "458",
+ "text": "hello world", "language": "en"}, {"id": "459", "text": "hello world",
+ "language": "en"}, {"id": "460", "text": "hello world", "language": "en"}, {"id":
+ "461", "text": "hello world", "language": "en"}, {"id": "462", "text": "hello
+ world", "language": "en"}, {"id": "463", "text": "hello world", "language":
+ "en"}, {"id": "464", "text": "hello world", "language": "en"}, {"id": "465",
+ "text": "hello world", "language": "en"}, {"id": "466", "text": "hello world",
+ "language": "en"}, {"id": "467", "text": "hello world", "language": "en"}, {"id":
+ "468", "text": "hello world", "language": "en"}, {"id": "469", "text": "hello
+ world", "language": "en"}, {"id": "470", "text": "hello world", "language":
+ "en"}, {"id": "471", "text": "hello world", "language": "en"}, {"id": "472",
+ "text": "hello world", "language": "en"}, {"id": "473", "text": "hello world",
+ "language": "en"}, {"id": "474", "text": "hello world", "language": "en"}, {"id":
+ "475", "text": "hello world", "language": "en"}, {"id": "476", "text": "hello
+ world", "language": "en"}, {"id": "477", "text": "hello world", "language":
+ "en"}, {"id": "478", "text": "hello world", "language": "en"}, {"id": "479",
+ "text": "hello world", "language": "en"}, {"id": "480", "text": "hello world",
+ "language": "en"}, {"id": "481", "text": "hello world", "language": "en"}, {"id":
+ "482", "text": "hello world", "language": "en"}, {"id": "483", "text": "hello
+ world", "language": "en"}, {"id": "484", "text": "hello world", "language":
+ "en"}, {"id": "485", "text": "hello world", "language": "en"}, {"id": "486",
+ "text": "hello world", "language": "en"}, {"id": "487", "text": "hello world",
+ "language": "en"}, {"id": "488", "text": "hello world", "language": "en"}, {"id":
+ "489", "text": "hello world", "language": "en"}, {"id": "490", "text": "hello
+ world", "language": "en"}, {"id": "491", "text": "hello world", "language":
+ "en"}, {"id": "492", "text": "hello world", "language": "en"}, {"id": "493",
+ "text": "hello world", "language": "en"}, {"id": "494", "text": "hello world",
+ "language": "en"}, {"id": "495", "text": "hello world", "language": "en"}, {"id":
+ "496", "text": "hello world", "language": "en"}, {"id": "497", "text": "hello
+ world", "language": "en"}, {"id": "498", "text": "hello world", "language":
+ "en"}, {"id": "499", "text": "hello world", "language": "en"}, {"id": "500",
+ "text": "hello world", "language": "en"}, {"id": "501", "text": "hello world",
+ "language": "en"}, {"id": "502", "text": "hello world", "language": "en"}, {"id":
+ "503", "text": "hello world", "language": "en"}, {"id": "504", "text": "hello
+ world", "language": "en"}, {"id": "505", "text": "hello world", "language":
+ "en"}, {"id": "506", "text": "hello world", "language": "en"}, {"id": "507",
+ "text": "hello world", "language": "en"}, {"id": "508", "text": "hello world",
+ "language": "en"}, {"id": "509", "text": "hello world", "language": "en"}, {"id":
+ "510", "text": "hello world", "language": "en"}, {"id": "511", "text": "hello
+ world", "language": "en"}, {"id": "512", "text": "hello world", "language":
+ "en"}, {"id": "513", "text": "hello world", "language": "en"}, {"id": "514",
+ "text": "hello world", "language": "en"}, {"id": "515", "text": "hello world",
+ "language": "en"}, {"id": "516", "text": "hello world", "language": "en"}, {"id":
+ "517", "text": "hello world", "language": "en"}, {"id": "518", "text": "hello
+ world", "language": "en"}, {"id": "519", "text": "hello world", "language":
+ "en"}, {"id": "520", "text": "hello world", "language": "en"}, {"id": "521",
+ "text": "hello world", "language": "en"}, {"id": "522", "text": "hello world",
+ "language": "en"}, {"id": "523", "text": "hello world", "language": "en"}, {"id":
+ "524", "text": "hello world", "language": "en"}, {"id": "525", "text": "hello
+ world", "language": "en"}, {"id": "526", "text": "hello world", "language":
+ "en"}, {"id": "527", "text": "hello world", "language": "en"}, {"id": "528",
+ "text": "hello world", "language": "en"}, {"id": "529", "text": "hello world",
+ "language": "en"}, {"id": "530", "text": "hello world", "language": "en"}, {"id":
+ "531", "text": "hello world", "language": "en"}, {"id": "532", "text": "hello
+ world", "language": "en"}, {"id": "533", "text": "hello world", "language":
+ "en"}, {"id": "534", "text": "hello world", "language": "en"}, {"id": "535",
+ "text": "hello world", "language": "en"}, {"id": "536", "text": "hello world",
+ "language": "en"}, {"id": "537", "text": "hello world", "language": "en"}, {"id":
+ "538", "text": "hello world", "language": "en"}, {"id": "539", "text": "hello
+ world", "language": "en"}, {"id": "540", "text": "hello world", "language":
+ "en"}, {"id": "541", "text": "hello world", "language": "en"}, {"id": "542",
+ "text": "hello world", "language": "en"}, {"id": "543", "text": "hello world",
+ "language": "en"}, {"id": "544", "text": "hello world", "language": "en"}, {"id":
+ "545", "text": "hello world", "language": "en"}, {"id": "546", "text": "hello
+ world", "language": "en"}, {"id": "547", "text": "hello world", "language":
+ "en"}, {"id": "548", "text": "hello world", "language": "en"}, {"id": "549",
+ "text": "hello world", "language": "en"}, {"id": "550", "text": "hello world",
+ "language": "en"}, {"id": "551", "text": "hello world", "language": "en"}, {"id":
+ "552", "text": "hello world", "language": "en"}, {"id": "553", "text": "hello
+ world", "language": "en"}, {"id": "554", "text": "hello world", "language":
+ "en"}, {"id": "555", "text": "hello world", "language": "en"}, {"id": "556",
+ "text": "hello world", "language": "en"}, {"id": "557", "text": "hello world",
+ "language": "en"}, {"id": "558", "text": "hello world", "language": "en"}, {"id":
+ "559", "text": "hello world", "language": "en"}, {"id": "560", "text": "hello
+ world", "language": "en"}, {"id": "561", "text": "hello world", "language":
+ "en"}, {"id": "562", "text": "hello world", "language": "en"}, {"id": "563",
+ "text": "hello world", "language": "en"}, {"id": "564", "text": "hello world",
+ "language": "en"}, {"id": "565", "text": "hello world", "language": "en"}, {"id":
+ "566", "text": "hello world", "language": "en"}, {"id": "567", "text": "hello
+ world", "language": "en"}, {"id": "568", "text": "hello world", "language":
+ "en"}, {"id": "569", "text": "hello world", "language": "en"}, {"id": "570",
+ "text": "hello world", "language": "en"}, {"id": "571", "text": "hello world",
+ "language": "en"}, {"id": "572", "text": "hello world", "language": "en"}, {"id":
+ "573", "text": "hello world", "language": "en"}, {"id": "574", "text": "hello
+ world", "language": "en"}, {"id": "575", "text": "hello world", "language":
+ "en"}, {"id": "576", "text": "hello world", "language": "en"}, {"id": "577",
+ "text": "hello world", "language": "en"}, {"id": "578", "text": "hello world",
+ "language": "en"}, {"id": "579", "text": "hello world", "language": "en"}, {"id":
+ "580", "text": "hello world", "language": "en"}, {"id": "581", "text": "hello
+ world", "language": "en"}, {"id": "582", "text": "hello world", "language":
+ "en"}, {"id": "583", "text": "hello world", "language": "en"}, {"id": "584",
+ "text": "hello world", "language": "en"}, {"id": "585", "text": "hello world",
+ "language": "en"}, {"id": "586", "text": "hello world", "language": "en"}, {"id":
+ "587", "text": "hello world", "language": "en"}, {"id": "588", "text": "hello
+ world", "language": "en"}, {"id": "589", "text": "hello world", "language":
+ "en"}, {"id": "590", "text": "hello world", "language": "en"}, {"id": "591",
+ "text": "hello world", "language": "en"}, {"id": "592", "text": "hello world",
+ "language": "en"}, {"id": "593", "text": "hello world", "language": "en"}, {"id":
+ "594", "text": "hello world", "language": "en"}, {"id": "595", "text": "hello
+ world", "language": "en"}, {"id": "596", "text": "hello world", "language":
+ "en"}, {"id": "597", "text": "hello world", "language": "en"}, {"id": "598",
+ "text": "hello world", "language": "en"}, {"id": "599", "text": "hello world",
+ "language": "en"}, {"id": "600", "text": "hello world", "language": "en"}, {"id":
+ "601", "text": "hello world", "language": "en"}, {"id": "602", "text": "hello
+ world", "language": "en"}, {"id": "603", "text": "hello world", "language":
+ "en"}, {"id": "604", "text": "hello world", "language": "en"}, {"id": "605",
+ "text": "hello world", "language": "en"}, {"id": "606", "text": "hello world",
+ "language": "en"}, {"id": "607", "text": "hello world", "language": "en"}, {"id":
+ "608", "text": "hello world", "language": "en"}, {"id": "609", "text": "hello
+ world", "language": "en"}, {"id": "610", "text": "hello world", "language":
+ "en"}, {"id": "611", "text": "hello world", "language": "en"}, {"id": "612",
+ "text": "hello world", "language": "en"}, {"id": "613", "text": "hello world",
+ "language": "en"}, {"id": "614", "text": "hello world", "language": "en"}, {"id":
+ "615", "text": "hello world", "language": "en"}, {"id": "616", "text": "hello
+ world", "language": "en"}, {"id": "617", "text": "hello world", "language":
+ "en"}, {"id": "618", "text": "hello world", "language": "en"}, {"id": "619",
+ "text": "hello world", "language": "en"}, {"id": "620", "text": "hello world",
+ "language": "en"}, {"id": "621", "text": "hello world", "language": "en"}, {"id":
+ "622", "text": "hello world", "language": "en"}, {"id": "623", "text": "hello
+ world", "language": "en"}, {"id": "624", "text": "hello world", "language":
+ "en"}, {"id": "625", "text": "hello world", "language": "en"}, {"id": "626",
+ "text": "hello world", "language": "en"}, {"id": "627", "text": "hello world",
+ "language": "en"}, {"id": "628", "text": "hello world", "language": "en"}, {"id":
+ "629", "text": "hello world", "language": "en"}, {"id": "630", "text": "hello
+ world", "language": "en"}, {"id": "631", "text": "hello world", "language":
+ "en"}, {"id": "632", "text": "hello world", "language": "en"}, {"id": "633",
+ "text": "hello world", "language": "en"}, {"id": "634", "text": "hello world",
+ "language": "en"}, {"id": "635", "text": "hello world", "language": "en"}, {"id":
+ "636", "text": "hello world", "language": "en"}, {"id": "637", "text": "hello
+ world", "language": "en"}, {"id": "638", "text": "hello world", "language":
+ "en"}, {"id": "639", "text": "hello world", "language": "en"}, {"id": "640",
+ "text": "hello world", "language": "en"}, {"id": "641", "text": "hello world",
+ "language": "en"}, {"id": "642", "text": "hello world", "language": "en"}, {"id":
+ "643", "text": "hello world", "language": "en"}, {"id": "644", "text": "hello
+ world", "language": "en"}, {"id": "645", "text": "hello world", "language":
+ "en"}, {"id": "646", "text": "hello world", "language": "en"}, {"id": "647",
+ "text": "hello world", "language": "en"}, {"id": "648", "text": "hello world",
+ "language": "en"}, {"id": "649", "text": "hello world", "language": "en"}, {"id":
+ "650", "text": "hello world", "language": "en"}, {"id": "651", "text": "hello
+ world", "language": "en"}, {"id": "652", "text": "hello world", "language":
+ "en"}, {"id": "653", "text": "hello world", "language": "en"}, {"id": "654",
+ "text": "hello world", "language": "en"}, {"id": "655", "text": "hello world",
+ "language": "en"}, {"id": "656", "text": "hello world", "language": "en"}, {"id":
+ "657", "text": "hello world", "language": "en"}, {"id": "658", "text": "hello
+ world", "language": "en"}, {"id": "659", "text": "hello world", "language":
+ "en"}, {"id": "660", "text": "hello world", "language": "en"}, {"id": "661",
+ "text": "hello world", "language": "en"}, {"id": "662", "text": "hello world",
+ "language": "en"}, {"id": "663", "text": "hello world", "language": "en"}, {"id":
+ "664", "text": "hello world", "language": "en"}, {"id": "665", "text": "hello
+ world", "language": "en"}, {"id": "666", "text": "hello world", "language":
+ "en"}, {"id": "667", "text": "hello world", "language": "en"}, {"id": "668",
+ "text": "hello world", "language": "en"}, {"id": "669", "text": "hello world",
+ "language": "en"}, {"id": "670", "text": "hello world", "language": "en"}, {"id":
+ "671", "text": "hello world", "language": "en"}, {"id": "672", "text": "hello
+ world", "language": "en"}, {"id": "673", "text": "hello world", "language":
+ "en"}, {"id": "674", "text": "hello world", "language": "en"}, {"id": "675",
+ "text": "hello world", "language": "en"}, {"id": "676", "text": "hello world",
+ "language": "en"}, {"id": "677", "text": "hello world", "language": "en"}, {"id":
+ "678", "text": "hello world", "language": "en"}, {"id": "679", "text": "hello
+ world", "language": "en"}, {"id": "680", "text": "hello world", "language":
+ "en"}, {"id": "681", "text": "hello world", "language": "en"}, {"id": "682",
+ "text": "hello world", "language": "en"}, {"id": "683", "text": "hello world",
+ "language": "en"}, {"id": "684", "text": "hello world", "language": "en"}, {"id":
+ "685", "text": "hello world", "language": "en"}, {"id": "686", "text": "hello
+ world", "language": "en"}, {"id": "687", "text": "hello world", "language":
+ "en"}, {"id": "688", "text": "hello world", "language": "en"}, {"id": "689",
+ "text": "hello world", "language": "en"}, {"id": "690", "text": "hello world",
+ "language": "en"}, {"id": "691", "text": "hello world", "language": "en"}, {"id":
+ "692", "text": "hello world", "language": "en"}, {"id": "693", "text": "hello
+ world", "language": "en"}, {"id": "694", "text": "hello world", "language":
+ "en"}, {"id": "695", "text": "hello world", "language": "en"}, {"id": "696",
+ "text": "hello world", "language": "en"}, {"id": "697", "text": "hello world",
+ "language": "en"}, {"id": "698", "text": "hello world", "language": "en"}, {"id":
+ "699", "text": "hello world", "language": "en"}, {"id": "700", "text": "hello
+ world", "language": "en"}, {"id": "701", "text": "hello world", "language":
+ "en"}, {"id": "702", "text": "hello world", "language": "en"}, {"id": "703",
+ "text": "hello world", "language": "en"}, {"id": "704", "text": "hello world",
+ "language": "en"}, {"id": "705", "text": "hello world", "language": "en"}, {"id":
+ "706", "text": "hello world", "language": "en"}, {"id": "707", "text": "hello
+ world", "language": "en"}, {"id": "708", "text": "hello world", "language":
+ "en"}, {"id": "709", "text": "hello world", "language": "en"}, {"id": "710",
+ "text": "hello world", "language": "en"}, {"id": "711", "text": "hello world",
+ "language": "en"}, {"id": "712", "text": "hello world", "language": "en"}, {"id":
+ "713", "text": "hello world", "language": "en"}, {"id": "714", "text": "hello
+ world", "language": "en"}, {"id": "715", "text": "hello world", "language":
+ "en"}, {"id": "716", "text": "hello world", "language": "en"}, {"id": "717",
+ "text": "hello world", "language": "en"}, {"id": "718", "text": "hello world",
+ "language": "en"}, {"id": "719", "text": "hello world", "language": "en"}, {"id":
+ "720", "text": "hello world", "language": "en"}, {"id": "721", "text": "hello
+ world", "language": "en"}, {"id": "722", "text": "hello world", "language":
+ "en"}, {"id": "723", "text": "hello world", "language": "en"}, {"id": "724",
+ "text": "hello world", "language": "en"}, {"id": "725", "text": "hello world",
+ "language": "en"}, {"id": "726", "text": "hello world", "language": "en"}, {"id":
+ "727", "text": "hello world", "language": "en"}, {"id": "728", "text": "hello
+ world", "language": "en"}, {"id": "729", "text": "hello world", "language":
+ "en"}, {"id": "730", "text": "hello world", "language": "en"}, {"id": "731",
+ "text": "hello world", "language": "en"}, {"id": "732", "text": "hello world",
+ "language": "en"}, {"id": "733", "text": "hello world", "language": "en"}, {"id":
+ "734", "text": "hello world", "language": "en"}, {"id": "735", "text": "hello
+ world", "language": "en"}, {"id": "736", "text": "hello world", "language":
+ "en"}, {"id": "737", "text": "hello world", "language": "en"}, {"id": "738",
+ "text": "hello world", "language": "en"}, {"id": "739", "text": "hello world",
+ "language": "en"}, {"id": "740", "text": "hello world", "language": "en"}, {"id":
+ "741", "text": "hello world", "language": "en"}, {"id": "742", "text": "hello
+ world", "language": "en"}, {"id": "743", "text": "hello world", "language":
+ "en"}, {"id": "744", "text": "hello world", "language": "en"}, {"id": "745",
+ "text": "hello world", "language": "en"}, {"id": "746", "text": "hello world",
+ "language": "en"}, {"id": "747", "text": "hello world", "language": "en"}, {"id":
+ "748", "text": "hello world", "language": "en"}, {"id": "749", "text": "hello
+ world", "language": "en"}, {"id": "750", "text": "hello world", "language":
+ "en"}, {"id": "751", "text": "hello world", "language": "en"}, {"id": "752",
+ "text": "hello world", "language": "en"}, {"id": "753", "text": "hello world",
+ "language": "en"}, {"id": "754", "text": "hello world", "language": "en"}, {"id":
+ "755", "text": "hello world", "language": "en"}, {"id": "756", "text": "hello
+ world", "language": "en"}, {"id": "757", "text": "hello world", "language":
+ "en"}, {"id": "758", "text": "hello world", "language": "en"}, {"id": "759",
+ "text": "hello world", "language": "en"}, {"id": "760", "text": "hello world",
+ "language": "en"}, {"id": "761", "text": "hello world", "language": "en"}, {"id":
+ "762", "text": "hello world", "language": "en"}, {"id": "763", "text": "hello
+ world", "language": "en"}, {"id": "764", "text": "hello world", "language":
+ "en"}, {"id": "765", "text": "hello world", "language": "en"}, {"id": "766",
+ "text": "hello world", "language": "en"}, {"id": "767", "text": "hello world",
+ "language": "en"}, {"id": "768", "text": "hello world", "language": "en"}, {"id":
+ "769", "text": "hello world", "language": "en"}, {"id": "770", "text": "hello
+ world", "language": "en"}, {"id": "771", "text": "hello world", "language":
+ "en"}, {"id": "772", "text": "hello world", "language": "en"}, {"id": "773",
+ "text": "hello world", "language": "en"}, {"id": "774", "text": "hello world",
+ "language": "en"}, {"id": "775", "text": "hello world", "language": "en"}, {"id":
+ "776", "text": "hello world", "language": "en"}, {"id": "777", "text": "hello
+ world", "language": "en"}, {"id": "778", "text": "hello world", "language":
+ "en"}, {"id": "779", "text": "hello world", "language": "en"}, {"id": "780",
+ "text": "hello world", "language": "en"}, {"id": "781", "text": "hello world",
+ "language": "en"}, {"id": "782", "text": "hello world", "language": "en"}, {"id":
+ "783", "text": "hello world", "language": "en"}, {"id": "784", "text": "hello
+ world", "language": "en"}, {"id": "785", "text": "hello world", "language":
+ "en"}, {"id": "786", "text": "hello world", "language": "en"}, {"id": "787",
+ "text": "hello world", "language": "en"}, {"id": "788", "text": "hello world",
+ "language": "en"}, {"id": "789", "text": "hello world", "language": "en"}, {"id":
+ "790", "text": "hello world", "language": "en"}, {"id": "791", "text": "hello
+ world", "language": "en"}, {"id": "792", "text": "hello world", "language":
+ "en"}, {"id": "793", "text": "hello world", "language": "en"}, {"id": "794",
+ "text": "hello world", "language": "en"}, {"id": "795", "text": "hello world",
+ "language": "en"}, {"id": "796", "text": "hello world", "language": "en"}, {"id":
+ "797", "text": "hello world", "language": "en"}, {"id": "798", "text": "hello
+ world", "language": "en"}, {"id": "799", "text": "hello world", "language":
+ "en"}, {"id": "800", "text": "hello world", "language": "en"}, {"id": "801",
+ "text": "hello world", "language": "en"}, {"id": "802", "text": "hello world",
+ "language": "en"}, {"id": "803", "text": "hello world", "language": "en"}, {"id":
+ "804", "text": "hello world", "language": "en"}, {"id": "805", "text": "hello
+ world", "language": "en"}, {"id": "806", "text": "hello world", "language":
+ "en"}, {"id": "807", "text": "hello world", "language": "en"}, {"id": "808",
+ "text": "hello world", "language": "en"}, {"id": "809", "text": "hello world",
+ "language": "en"}, {"id": "810", "text": "hello world", "language": "en"}, {"id":
+ "811", "text": "hello world", "language": "en"}, {"id": "812", "text": "hello
+ world", "language": "en"}, {"id": "813", "text": "hello world", "language":
+ "en"}, {"id": "814", "text": "hello world", "language": "en"}, {"id": "815",
+ "text": "hello world", "language": "en"}, {"id": "816", "text": "hello world",
+ "language": "en"}, {"id": "817", "text": "hello world", "language": "en"}, {"id":
+ "818", "text": "hello world", "language": "en"}, {"id": "819", "text": "hello
+ world", "language": "en"}, {"id": "820", "text": "hello world", "language":
+ "en"}, {"id": "821", "text": "hello world", "language": "en"}, {"id": "822",
+ "text": "hello world", "language": "en"}, {"id": "823", "text": "hello world",
+ "language": "en"}, {"id": "824", "text": "hello world", "language": "en"}, {"id":
+ "825", "text": "hello world", "language": "en"}, {"id": "826", "text": "hello
+ world", "language": "en"}, {"id": "827", "text": "hello world", "language":
+ "en"}, {"id": "828", "text": "hello world", "language": "en"}, {"id": "829",
+ "text": "hello world", "language": "en"}, {"id": "830", "text": "hello world",
+ "language": "en"}, {"id": "831", "text": "hello world", "language": "en"}, {"id":
+ "832", "text": "hello world", "language": "en"}, {"id": "833", "text": "hello
+ world", "language": "en"}, {"id": "834", "text": "hello world", "language":
+ "en"}, {"id": "835", "text": "hello world", "language": "en"}, {"id": "836",
+ "text": "hello world", "language": "en"}, {"id": "837", "text": "hello world",
+ "language": "en"}, {"id": "838", "text": "hello world", "language": "en"}, {"id":
+ "839", "text": "hello world", "language": "en"}, {"id": "840", "text": "hello
+ world", "language": "en"}, {"id": "841", "text": "hello world", "language":
+ "en"}, {"id": "842", "text": "hello world", "language": "en"}, {"id": "843",
+ "text": "hello world", "language": "en"}, {"id": "844", "text": "hello world",
+ "language": "en"}, {"id": "845", "text": "hello world", "language": "en"}, {"id":
+ "846", "text": "hello world", "language": "en"}, {"id": "847", "text": "hello
+ world", "language": "en"}, {"id": "848", "text": "hello world", "language":
+ "en"}, {"id": "849", "text": "hello world", "language": "en"}, {"id": "850",
+ "text": "hello world", "language": "en"}, {"id": "851", "text": "hello world",
+ "language": "en"}, {"id": "852", "text": "hello world", "language": "en"}, {"id":
+ "853", "text": "hello world", "language": "en"}, {"id": "854", "text": "hello
+ world", "language": "en"}, {"id": "855", "text": "hello world", "language":
+ "en"}, {"id": "856", "text": "hello world", "language": "en"}, {"id": "857",
+ "text": "hello world", "language": "en"}, {"id": "858", "text": "hello world",
+ "language": "en"}, {"id": "859", "text": "hello world", "language": "en"}, {"id":
+ "860", "text": "hello world", "language": "en"}, {"id": "861", "text": "hello
+ world", "language": "en"}, {"id": "862", "text": "hello world", "language":
+ "en"}, {"id": "863", "text": "hello world", "language": "en"}, {"id": "864",
+ "text": "hello world", "language": "en"}, {"id": "865", "text": "hello world",
+ "language": "en"}, {"id": "866", "text": "hello world", "language": "en"}, {"id":
+ "867", "text": "hello world", "language": "en"}, {"id": "868", "text": "hello
+ world", "language": "en"}, {"id": "869", "text": "hello world", "language":
+ "en"}, {"id": "870", "text": "hello world", "language": "en"}, {"id": "871",
+ "text": "hello world", "language": "en"}, {"id": "872", "text": "hello world",
+ "language": "en"}, {"id": "873", "text": "hello world", "language": "en"}, {"id":
+ "874", "text": "hello world", "language": "en"}, {"id": "875", "text": "hello
+ world", "language": "en"}, {"id": "876", "text": "hello world", "language":
+ "en"}, {"id": "877", "text": "hello world", "language": "en"}, {"id": "878",
+ "text": "hello world", "language": "en"}, {"id": "879", "text": "hello world",
+ "language": "en"}, {"id": "880", "text": "hello world", "language": "en"}, {"id":
+ "881", "text": "hello world", "language": "en"}, {"id": "882", "text": "hello
+ world", "language": "en"}, {"id": "883", "text": "hello world", "language":
+ "en"}, {"id": "884", "text": "hello world", "language": "en"}, {"id": "885",
+ "text": "hello world", "language": "en"}, {"id": "886", "text": "hello world",
+ "language": "en"}, {"id": "887", "text": "hello world", "language": "en"}, {"id":
+ "888", "text": "hello world", "language": "en"}, {"id": "889", "text": "hello
+ world", "language": "en"}, {"id": "890", "text": "hello world", "language":
+ "en"}, {"id": "891", "text": "hello world", "language": "en"}, {"id": "892",
+ "text": "hello world", "language": "en"}, {"id": "893", "text": "hello world",
+ "language": "en"}, {"id": "894", "text": "hello world", "language": "en"}, {"id":
+ "895", "text": "hello world", "language": "en"}, {"id": "896", "text": "hello
+ world", "language": "en"}, {"id": "897", "text": "hello world", "language":
+ "en"}, {"id": "898", "text": "hello world", "language": "en"}, {"id": "899",
+ "text": "hello world", "language": "en"}, {"id": "900", "text": "hello world",
+ "language": "en"}, {"id": "901", "text": "hello world", "language": "en"}, {"id":
+ "902", "text": "hello world", "language": "en"}, {"id": "903", "text": "hello
+ world", "language": "en"}, {"id": "904", "text": "hello world", "language":
+ "en"}, {"id": "905", "text": "hello world", "language": "en"}, {"id": "906",
+ "text": "hello world", "language": "en"}, {"id": "907", "text": "hello world",
+ "language": "en"}, {"id": "908", "text": "hello world", "language": "en"}, {"id":
+ "909", "text": "hello world", "language": "en"}, {"id": "910", "text": "hello
+ world", "language": "en"}, {"id": "911", "text": "hello world", "language":
+ "en"}, {"id": "912", "text": "hello world", "language": "en"}, {"id": "913",
+ "text": "hello world", "language": "en"}, {"id": "914", "text": "hello world",
+ "language": "en"}, {"id": "915", "text": "hello world", "language": "en"}, {"id":
+ "916", "text": "hello world", "language": "en"}, {"id": "917", "text": "hello
+ world", "language": "en"}, {"id": "918", "text": "hello world", "language":
+ "en"}, {"id": "919", "text": "hello world", "language": "en"}, {"id": "920",
+ "text": "hello world", "language": "en"}, {"id": "921", "text": "hello world",
+ "language": "en"}, {"id": "922", "text": "hello world", "language": "en"}, {"id":
+ "923", "text": "hello world", "language": "en"}, {"id": "924", "text": "hello
+ world", "language": "en"}, {"id": "925", "text": "hello world", "language":
+ "en"}, {"id": "926", "text": "hello world", "language": "en"}, {"id": "927",
+ "text": "hello world", "language": "en"}, {"id": "928", "text": "hello world",
+ "language": "en"}, {"id": "929", "text": "hello world", "language": "en"}, {"id":
+ "930", "text": "hello world", "language": "en"}, {"id": "931", "text": "hello
+ world", "language": "en"}, {"id": "932", "text": "hello world", "language":
+ "en"}, {"id": "933", "text": "hello world", "language": "en"}, {"id": "934",
+ "text": "hello world", "language": "en"}, {"id": "935", "text": "hello world",
+ "language": "en"}, {"id": "936", "text": "hello world", "language": "en"}, {"id":
+ "937", "text": "hello world", "language": "en"}, {"id": "938", "text": "hello
+ world", "language": "en"}, {"id": "939", "text": "hello world", "language":
+ "en"}, {"id": "940", "text": "hello world", "language": "en"}, {"id": "941",
+ "text": "hello world", "language": "en"}, {"id": "942", "text": "hello world",
+ "language": "en"}, {"id": "943", "text": "hello world", "language": "en"}, {"id":
+ "944", "text": "hello world", "language": "en"}, {"id": "945", "text": "hello
+ world", "language": "en"}, {"id": "946", "text": "hello world", "language":
+ "en"}, {"id": "947", "text": "hello world", "language": "en"}, {"id": "948",
+ "text": "hello world", "language": "en"}, {"id": "949", "text": "hello world",
+ "language": "en"}, {"id": "950", "text": "hello world", "language": "en"}, {"id":
+ "951", "text": "hello world", "language": "en"}, {"id": "952", "text": "hello
+ world", "language": "en"}, {"id": "953", "text": "hello world", "language":
+ "en"}, {"id": "954", "text": "hello world", "language": "en"}, {"id": "955",
+ "text": "hello world", "language": "en"}, {"id": "956", "text": "hello world",
+ "language": "en"}, {"id": "957", "text": "hello world", "language": "en"}, {"id":
+ "958", "text": "hello world", "language": "en"}, {"id": "959", "text": "hello
+ world", "language": "en"}, {"id": "960", "text": "hello world", "language":
+ "en"}, {"id": "961", "text": "hello world", "language": "en"}, {"id": "962",
+ "text": "hello world", "language": "en"}, {"id": "963", "text": "hello world",
+ "language": "en"}, {"id": "964", "text": "hello world", "language": "en"}, {"id":
+ "965", "text": "hello world", "language": "en"}, {"id": "966", "text": "hello
+ world", "language": "en"}, {"id": "967", "text": "hello world", "language":
+ "en"}, {"id": "968", "text": "hello world", "language": "en"}, {"id": "969",
+ "text": "hello world", "language": "en"}, {"id": "970", "text": "hello world",
+ "language": "en"}, {"id": "971", "text": "hello world", "language": "en"}, {"id":
+ "972", "text": "hello world", "language": "en"}, {"id": "973", "text": "hello
+ world", "language": "en"}, {"id": "974", "text": "hello world", "language":
+ "en"}, {"id": "975", "text": "hello world", "language": "en"}, {"id": "976",
+ "text": "hello world", "language": "en"}, {"id": "977", "text": "hello world",
+ "language": "en"}, {"id": "978", "text": "hello world", "language": "en"}, {"id":
+ "979", "text": "hello world", "language": "en"}, {"id": "980", "text": "hello
+ world", "language": "en"}, {"id": "981", "text": "hello world", "language":
+ "en"}, {"id": "982", "text": "hello world", "language": "en"}, {"id": "983",
+ "text": "hello world", "language": "en"}, {"id": "984", "text": "hello world",
+ "language": "en"}, {"id": "985", "text": "hello world", "language": "en"}, {"id":
+ "986", "text": "hello world", "language": "en"}, {"id": "987", "text": "hello
+ world", "language": "en"}, {"id": "988", "text": "hello world", "language":
+ "en"}, {"id": "989", "text": "hello world", "language": "en"}, {"id": "990",
+ "text": "hello world", "language": "en"}, {"id": "991", "text": "hello world",
+ "language": "en"}, {"id": "992", "text": "hello world", "language": "en"}, {"id":
+ "993", "text": "hello world", "language": "en"}, {"id": "994", "text": "hello
+ world", "language": "en"}, {"id": "995", "text": "hello world", "language":
+ "en"}, {"id": "996", "text": "hello world", "language": "en"}, {"id": "997",
+ "text": "hello world", "language": "en"}, {"id": "998", "text": "hello world",
+ "language": "en"}, {"id": "999", "text": "hello world", "language": "en"}, {"id":
+ "1000", "text": "hello world", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '55962'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
+ request contains too many records. Max 1000 records are permitted."}}}'
+ headers:
+ apim-request-id:
+ - 6218bc52-cde1-4519-8dc8-4b4092efdf08
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:44 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '12'
+ status:
+ code: 400
+ message: Bad Request
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_client_passed_default_language_hint.yaml
new file mode 100644
index 000000000000..3c9c62ee0c6a
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_client_passed_default_language_hint.yaml
@@ -0,0 +1,139 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "es"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "es"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - e517622a-4ba2-4b27-8be3-ffd90abfb08a
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:44 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 8e0ca8ea-a7f1-4d04-842d-754d62659c85
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:46 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '105'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "es"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "es"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - e78f6c84-2db5-49ed-8225-d4cde4b86ffe
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:46 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_attribute_error_no_result_attribute.yaml
new file mode 100644
index 000000000000..0bb07ba438d7
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_attribute_error_no_result_attribute.yaml
@@ -0,0 +1,42 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '58'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 4dba7af2-29bb-432a-9178-13ef624f7d00
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:45 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_attribute_error_nonexistent_attribute.yaml
new file mode 100644
index 000000000000..bf373a45aa29
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_attribute_error_nonexistent_attribute.yaml
@@ -0,0 +1,42 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '58'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 166e1ed8-b99e-4510-b4d1-5d75ea2f8657
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:46 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_errors.yaml
new file mode 100644
index 000000000000..33172475a45f
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_errors.yaml
@@ -0,0 +1,51 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "", "language": "en"}, {"id": "2", "text":
+ "I did not like the hotel we stayed at.", "language": "english"}, {"id": "3",
+ "text": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+ "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '5308'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"A
+ document within the request was too large to be processed. Limit document
+ size to: 5120 text elements. For additional details on the data limitations
+ see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 860c6f8f-a447-4ec6-9b05-97c5608db3be
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:47 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_warnings.yaml
new file mode 100644
index 000000000000..b71ea37404f9
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_document_warnings.yaml
@@ -0,0 +1,43 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "This won''t actually create a warning
+ :''(", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '98'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - ae9db402-9b0d-4553-b16c-253ece9ed33d
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=1
+ date:
+ - Thu, 23 Jul 2020 17:18:47 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '89'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_duplicate_ids_error.yaml
new file mode 100644
index 000000000000..a99d43e7817f
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_duplicate_ids_error.yaml
@@ -0,0 +1,42 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "hello world", "language": "en"}, {"id":
+ "1", "text": "I did not like the hotel we stayed at.", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '150'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
+ contains duplicated Ids. Make sure each document has a unique Id."}}}'
+ headers:
+ apim-request-id:
+ - 30ffe8c5-5001-4d47-800f-eaabba1d0476
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:47 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '5'
+ status:
+ code: 400
+ message: Bad Request
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_empty_credential_class.yaml
new file mode 100644
index 000000000000..e1b1c1696e6d
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_empty_credential_class.yaml
@@ -0,0 +1,33 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This is written in English.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '85'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
+ key or wrong API endpoint. Make sure to provide a valid key for an active
+ subscription and use a correct regional API endpoint for your resource."}}'
+ headers:
+ content-length:
+ - '224'
+ date:
+ - Thu, 23 Jul 2020 17:18:47 GMT
+ status:
+ code: 401
+ message: PermissionDenied
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_input_with_all_errors.yaml
new file mode 100644
index 000000000000..2cb6dac5da50
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_input_with_all_errors.yaml
@@ -0,0 +1,47 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "", "language": "en"}, {"id": "2", "text":
+ "Hola", "language": "Spanish"}, {"id": "3", "text": "", "language": "de"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '153'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 7fe78d0f-6593-4b2f-9ae1-b60130cd536e
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:48 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_input_with_some_errors.yaml
new file mode 100644
index 000000000000..8919d3d7bcdb
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_input_with_some_errors.yaml
@@ -0,0 +1,49 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "hola", "language": "es"}, {"id": "2",
+ "text": "", "language": "en"}, {"id": "3", "text": "Is 998.214.865-68 your Brazilian
+ CPF number?", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '192'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"3","entities":[{"text":"998.214.865-68","category":"Brazil
+ CPF Number","offset":3,"length":14,"confidenceScore":0.85}],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 51708468-566e-4842-8040-bba767c70b62
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=1
+ date:
+ - Thu, 23 Jul 2020 17:18:49 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '81'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_invalid_language_hint_docs.yaml
new file mode 100644
index 000000000000..9aab4df07b0d
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_invalid_language_hint_docs.yaml
@@ -0,0 +1,43 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "This should fail because we''re passing
+ in an invalid language hint", "language": "notalanguage"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '134'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 12a8aace-0a2e-4d2f-8f8f-eda36292b9c4
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:48 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_invalid_language_hint_method.yaml
new file mode 100644
index 000000000000..e12d677551cf
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_invalid_language_hint_method.yaml
@@ -0,0 +1,43 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This should fail because we''re passing
+ in an invalid language hint", "language": "notalanguage"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '134'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 091a3f26-8289-46b5-84e9-53e768af8099
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:49 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_language_kwarg_english.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_language_kwarg_english.yaml
new file mode 100644
index 000000000000..630dc3868ef0
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_language_kwarg_english.yaml
@@ -0,0 +1,44 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "Bill Gates is the CEO of Microsoft.",
+ "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '93'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=latest&showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","statistics":{"charactersCount":35,"transactionsCount":1},"entities":[{"text":"Bill
+ Gates","category":"Person","offset":0,"length":10,"confidenceScore":0.81},{"text":"Microsoft","category":"Organization","offset":25,"length":9,"confidenceScore":0.64}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 985c402a-0b74-4e08-99b6-c3e7bd65cb6c
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=1
+ date:
+ - Thu, 23 Jul 2020 17:18:50 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '76'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_language_kwarg_spanish.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_language_kwarg_spanish.yaml
new file mode 100644
index 000000000000..16708cb52ae7
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_language_kwarg_spanish.yaml
@@ -0,0 +1,43 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "Bill Gates is the CEO of Microsoft.",
+ "language": "es"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '93'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=latest&showStats=true
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 3e6f5b79-e64a-4267-a8e4-16c9017c5843
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Wed, 22 Jul 2020 14:50:20 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '420'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_length_with_emoji.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_length_with_emoji.yaml
new file mode 100644
index 000000000000..e075ff77154d
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_length_with_emoji.yaml
@@ -0,0 +1,44 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "\ud83d\udc69 SSN: 123-12-1234", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '87'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"0","entities":[{"text":"123-12-1234","category":"U.S.
+ Social Security Number (SSN)","offset":7,"length":11,"confidenceScore":0.85}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - f3e0cf88-545b-44f3-818e-55313dec114e
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=1
+ date:
+ - Thu, 23 Jul 2020 17:18:50 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '82'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_out_of_order_ids.yaml
new file mode 100644
index 000000000000..915900cec00e
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_out_of_order_ids.yaml
@@ -0,0 +1,47 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "56", "text": ":)", "language": "en"}, {"id": "0",
+ "text": ":(", "language": "en"}, {"id": "22", "text": "", "language": "en"},
+ {"id": "19", "text": ":P", "language": "en"}, {"id": "1", "text": ":D", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '241'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"56","entities":[],"warnings":[]},{"id":"0","entities":[],"warnings":[]},{"id":"19","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - f418d976-9a1d-470a-bf54-f651eae438f4
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=4
+ date:
+ - Thu, 23 Jul 2020 17:18:51 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '71'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_output_same_order_as_input.yaml
new file mode 100644
index 000000000000..52010d6d45cd
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_output_same_order_as_input.yaml
@@ -0,0 +1,45 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "one", "language": "en"}, {"id": "2",
+ "text": "two", "language": "en"}, {"id": "3", "text": "three", "language": "en"},
+ {"id": "4", "text": "four", "language": "en"}, {"id": "5", "text": "five", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '249'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"5","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - b73d414c-77b4-4732-985f-8429761f6f6e
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=5
+ date:
+ - Thu, 23 Jul 2020 17:18:51 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '64'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_pass_cls.yaml
new file mode 100644
index 000000000000..8a11ff62aa8b
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_pass_cls.yaml
@@ -0,0 +1,43 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "Test passing cls to endpoint", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '86'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 610f90f1-6b0e-4da9-b901-a49a0446cb6d
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=1
+ date:
+ - Thu, 23 Jul 2020 17:18:52 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '77'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_passing_only_string.yaml
new file mode 100644
index 000000000000..caf22991e8a1
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_passing_only_string.yaml
@@ -0,0 +1,52 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "My SSN is 859-98-0987.", "language":
+ "en"}, {"id": "1", "text": "Your ABA number - 111000025 - is the first 9 digits
+ in the lower left hand corner of your personal check.", "language": "en"}, {"id":
+ "2", "text": "Is 998.214.865-68 your Brazilian CPF number?", "language": "en"},
+ {"id": "3", "text": "", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '358'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":4,"validDocumentsCount":3,"erroneousDocumentsCount":1,"transactionsCount":3},"documents":[{"id":"0","statistics":{"charactersCount":22,"transactionsCount":1},"entities":[{"text":"859-98-0987","category":"U.S.
+ Social Security Number (SSN)","offset":10,"length":11,"confidenceScore":0.65}],"warnings":[]},{"id":"1","statistics":{"charactersCount":105,"transactionsCount":1},"entities":[{"text":"111000025","category":"Phone
+ Number","offset":18,"length":9,"confidenceScore":0.8},{"text":"111000025","category":"ABA
+ Routing Number","offset":18,"length":9,"confidenceScore":0.75}],"warnings":[]},{"id":"2","statistics":{"charactersCount":44,"transactionsCount":1},"entities":[{"text":"998.214.865-68","category":"Brazil
+ CPF Number","offset":3,"length":14,"confidenceScore":0.85}],"warnings":[]}],"errors":[{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 09bb7695-a0b3-4468-8dde-4be27d7a2b82
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:52 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '110'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_per_item_dont_use_language_hint.yaml
new file mode 100644
index 000000000000..4f1f295bfaab
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_per_item_dont_use_language_hint.yaml
@@ -0,0 +1,45 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ ""}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ ""}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '236'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - f3aaa4c2-89dd-49e8-9da7-df2a929da79d
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:53 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '78'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_rotate_subscription_key.yaml
new file mode 100644
index 000000000000..16bc09074252
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_rotate_subscription_key.yaml
@@ -0,0 +1,121 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 62420b86-ba2f-4072-8b84-a38812d95461
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:53 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '77'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
+ key or wrong API endpoint. Make sure to provide a valid key for an active
+ subscription and use a correct regional API endpoint for your resource."}}'
+ headers:
+ content-length:
+ - '224'
+ date:
+ - Thu, 23 Jul 2020 17:18:53 GMT
+ status:
+ code: 401
+ message: PermissionDenied
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 88eb6c1d-7ae6-4cde-b702-c5b9c966fa0d
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:53 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '73'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_show_stats_and_model_version.yaml
new file mode 100644
index 000000000000..a479942ee575
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_show_stats_and_model_version.yaml
@@ -0,0 +1,47 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "56", "text": ":)", "language": "en"}, {"id": "0",
+ "text": ":(", "language": "en"}, {"id": "22", "text": "", "language": "en"},
+ {"id": "19", "text": ":P", "language": "en"}, {"id": "1", "text": ":D", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '241'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=latest&showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 8b7f87bf-9f61-49a9-8922-df3b7eae9483
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=4
+ date:
+ - Thu, 23 Jul 2020 17:18:54 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '61'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_too_many_documents.yaml
new file mode 100644
index 000000000000..420bbcc096da
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_too_many_documents.yaml
@@ -0,0 +1,48 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "One", "language": "en"}, {"id": "1",
+ "text": "Two", "language": "en"}, {"id": "2", "text": "Three", "language": "en"},
+ {"id": "3", "text": "Four", "language": "en"}, {"id": "4", "text": "Five", "language":
+ "en"}, {"id": "5", "text": "Six", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '295'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"5","entities":[],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
+ request has exceeded the allowed document limits.","innererror":{"code":"InvalidDocumentBatch","message":"The
+ number of documents in the request have exceeded the data limitations. See
+ https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 83d12e97-5e75-482f-ac1b-877e700662b8
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=6
+ date:
+ - Thu, 23 Jul 2020 17:18:54 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '69'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_user_agent.yaml
new file mode 100644
index 000000000000..8c49dbc2c0ba
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_user_agent.yaml
@@ -0,0 +1,45 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 739b9ff6-e3f2-4041-b78b-c2d390ca9ed6
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:54 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '77'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_dont_use_language_hint.yaml
new file mode 100644
index 000000000000..ebedb39b5cbb
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_dont_use_language_hint.yaml
@@ -0,0 +1,45 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This was the best day of my life.",
+ "language": ""}, {"id": "1", "text": "I did not like the hotel we stayed at.
+ It was too expensive.", "language": ""}, {"id": "2", "text": "The restaurant
+ was not as good as I hoped.", "language": ""}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '273'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 0f25d1cb-0166-4738-8795-84c423d91cea
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=3
+ date:
+ - Thu, 23 Jul 2020 17:18:55 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '89'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint.yaml
new file mode 100644
index 000000000000..3662a1b3e496
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint.yaml
@@ -0,0 +1,49 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This was the best day of my life.",
+ "language": "fr"}, {"id": "1", "text": "I did not like the hotel we stayed at.
+ It was too expensive.", "language": "fr"}, {"id": "2", "text": "The restaurant
+ was not as good as I hoped.", "language": "fr"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '279'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - cb56e9a0-cd4c-4993-8dfd-73de11e11b05
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:55 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
new file mode 100644
index 000000000000..4ae9d2f8c7b1
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -0,0 +1,49 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "es"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"3","entities":[],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 1fbd838e-78e4-4f31-82ab-a938eadcc52a
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=1
+ date:
+ - Thu, 23 Jul 2020 17:18:55 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '68'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_obj_input.yaml
new file mode 100644
index 000000000000..ce527caa8a66
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_obj_input.yaml
@@ -0,0 +1,49 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I should take my cat to the veterinarian.",
+ "language": "de"}, {"id": "4", "text": "Este es un document escrito en Espa\u00f1ol.",
+ "language": "de"}, {"id": "3", "text": "\u732b\u306f\u5e78\u305b", "language":
+ "de"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '253'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"4","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - bd493308-10ac-4a0c-a559-9f7a74ac4850
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Thu, 23 Jul 2020 17:18:56 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '2'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
new file mode 100644
index 000000000000..c1da00e77783
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -0,0 +1,49 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I should take my cat to the veterinarian.",
+ "language": "es"}, {"id": "2", "text": "Este es un document escrito en Espa\u00f1ol.",
+ "language": "es"}, {"id": "3", "text": "\u732b\u306f\u5e78\u305b", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '253'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"3","entities":[],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id:
+ - 29a834cb-81ac-47dd-951a-5662f273892f
+ content-type:
+ - application/json; charset=utf-8
+ csp-billing-usage:
+ - CognitiveServices.TextAnalytics.BatchScoring=1
+ date:
+ - Thu, 23 Jul 2020 17:18:56 GMT
+ strict-transport-security:
+ - max-age=31536000; includeSubDomains; preload
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-envoy-upstream-service-time:
+ - '60'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_all_successful_passing_dict.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_all_successful_passing_dict.yaml
new file mode 100644
index 000000000000..04a4bc7abfd3
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_all_successful_passing_dict.yaml
@@ -0,0 +1,38 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "My SSN is 859-98-0987.", "language":
+ "en"}, {"id": "2", "text": "Your ABA number - 111000025 - is the first 9 digits
+ in the lower left hand corner of your personal check.", "language": "en"}, {"id":
+ "3", "text": "Is 998.214.865-68 your Brazilian CPF number?", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '315'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","statistics":{"charactersCount":22,"transactionsCount":1},"entities":[{"text":"859-98-0987","category":"U.S.
+ Social Security Number (SSN)","offset":10,"length":11,"confidenceScore":0.65}],"warnings":[]},{"id":"2","statistics":{"charactersCount":105,"transactionsCount":1},"entities":[{"text":"111000025","category":"Phone
+ Number","offset":18,"length":9,"confidenceScore":0.8},{"text":"111000025","category":"ABA
+ Routing Number","offset":18,"length":9,"confidenceScore":0.75}],"warnings":[]},{"id":"3","statistics":{"charactersCount":44,"transactionsCount":1},"entities":[{"text":"998.214.865-68","category":"Brazil
+ CPF Number","offset":3,"length":14,"confidenceScore":0.85}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: c4e0391d-522b-418c-a87e-f72c6c97f98b
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:44 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '108'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_all_successful_passing_text_document_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_all_successful_passing_text_document_input.yaml
new file mode 100644
index 000000000000..6d1ee80da1d7
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_all_successful_passing_text_document_input.yaml
@@ -0,0 +1,38 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "My SSN is 859-98-0987.", "language":
+ "en"}, {"id": "2", "text": "Your ABA number - 111000025 - is the first 9 digits
+ in the lower left hand corner of your personal check.", "language": "en"}, {"id":
+ "3", "text": "Is 998.214.865-68 your Brazilian CPF number?", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '315'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","statistics":{"charactersCount":22,"transactionsCount":1},"entities":[{"text":"859-98-0987","category":"U.S.
+ Social Security Number (SSN)","offset":10,"length":11,"confidenceScore":0.65}],"warnings":[]},{"id":"2","statistics":{"charactersCount":105,"transactionsCount":1},"entities":[{"text":"111000025","category":"Phone
+ Number","offset":18,"length":9,"confidenceScore":0.8},{"text":"111000025","category":"ABA
+ Routing Number","offset":18,"length":9,"confidenceScore":0.75}],"warnings":[]},{"id":"3","statistics":{"charactersCount":44,"transactionsCount":1},"entities":[{"text":"998.214.865-68","category":"Brazil
+ CPF Number","offset":3,"length":14,"confidenceScore":0.85}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 4d0ae1a3-25c0-4790-ab39-081afa0a43a3
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:45 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '109'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_bad_credentials.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_bad_credentials.yaml
new file mode 100644
index 000000000000..96d6c3d4a0b8
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_bad_credentials.yaml
@@ -0,0 +1,28 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This is written in English.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '85'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
+ key or wrong API endpoint. Make sure to provide a valid key for an active
+ subscription and use a correct regional API endpoint for your resource."}}'
+ headers:
+ content-length: '224'
+ date: Thu, 23 Jul 2020 17:19:45 GMT
+ status:
+ code: 401
+ message: PermissionDenied
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_bad_model_version_error.yaml
new file mode 100644
index 000000000000..4e1306e98bde
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_bad_model_version_error.yaml
@@ -0,0 +1,32 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I did not like the hotel we stayed
+ at.", "language": "english"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '101'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=bad&showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"ModelVersionIncorrect","message":"Invalid
+ model version. Possible values are: latest,2020-04-01,2019-10-01,2020-02-01"}}}'
+ headers:
+ apim-request-id: ba42b7a5-d3b0-4c87-a0f5-0436156f76b1
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:45 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '4'
+ status:
+ code: 400
+ message: Bad Request
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=bad&showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_batch_size_over_limit.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_batch_size_over_limit.yaml
new file mode 100644
index 000000000000..0fe34da57c2b
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_batch_size_over_limit.yaml
@@ -0,0 +1,776 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "hello world", "language": "en"}, {"id":
+ "1", "text": "hello world", "language": "en"}, {"id": "2", "text": "hello world",
+ "language": "en"}, {"id": "3", "text": "hello world", "language": "en"}, {"id":
+ "4", "text": "hello world", "language": "en"}, {"id": "5", "text": "hello world",
+ "language": "en"}, {"id": "6", "text": "hello world", "language": "en"}, {"id":
+ "7", "text": "hello world", "language": "en"}, {"id": "8", "text": "hello world",
+ "language": "en"}, {"id": "9", "text": "hello world", "language": "en"}, {"id":
+ "10", "text": "hello world", "language": "en"}, {"id": "11", "text": "hello
+ world", "language": "en"}, {"id": "12", "text": "hello world", "language": "en"},
+ {"id": "13", "text": "hello world", "language": "en"}, {"id": "14", "text":
+ "hello world", "language": "en"}, {"id": "15", "text": "hello world", "language":
+ "en"}, {"id": "16", "text": "hello world", "language": "en"}, {"id": "17", "text":
+ "hello world", "language": "en"}, {"id": "18", "text": "hello world", "language":
+ "en"}, {"id": "19", "text": "hello world", "language": "en"}, {"id": "20", "text":
+ "hello world", "language": "en"}, {"id": "21", "text": "hello world", "language":
+ "en"}, {"id": "22", "text": "hello world", "language": "en"}, {"id": "23", "text":
+ "hello world", "language": "en"}, {"id": "24", "text": "hello world", "language":
+ "en"}, {"id": "25", "text": "hello world", "language": "en"}, {"id": "26", "text":
+ "hello world", "language": "en"}, {"id": "27", "text": "hello world", "language":
+ "en"}, {"id": "28", "text": "hello world", "language": "en"}, {"id": "29", "text":
+ "hello world", "language": "en"}, {"id": "30", "text": "hello world", "language":
+ "en"}, {"id": "31", "text": "hello world", "language": "en"}, {"id": "32", "text":
+ "hello world", "language": "en"}, {"id": "33", "text": "hello world", "language":
+ "en"}, {"id": "34", "text": "hello world", "language": "en"}, {"id": "35", "text":
+ "hello world", "language": "en"}, {"id": "36", "text": "hello world", "language":
+ "en"}, {"id": "37", "text": "hello world", "language": "en"}, {"id": "38", "text":
+ "hello world", "language": "en"}, {"id": "39", "text": "hello world", "language":
+ "en"}, {"id": "40", "text": "hello world", "language": "en"}, {"id": "41", "text":
+ "hello world", "language": "en"}, {"id": "42", "text": "hello world", "language":
+ "en"}, {"id": "43", "text": "hello world", "language": "en"}, {"id": "44", "text":
+ "hello world", "language": "en"}, {"id": "45", "text": "hello world", "language":
+ "en"}, {"id": "46", "text": "hello world", "language": "en"}, {"id": "47", "text":
+ "hello world", "language": "en"}, {"id": "48", "text": "hello world", "language":
+ "en"}, {"id": "49", "text": "hello world", "language": "en"}, {"id": "50", "text":
+ "hello world", "language": "en"}, {"id": "51", "text": "hello world", "language":
+ "en"}, {"id": "52", "text": "hello world", "language": "en"}, {"id": "53", "text":
+ "hello world", "language": "en"}, {"id": "54", "text": "hello world", "language":
+ "en"}, {"id": "55", "text": "hello world", "language": "en"}, {"id": "56", "text":
+ "hello world", "language": "en"}, {"id": "57", "text": "hello world", "language":
+ "en"}, {"id": "58", "text": "hello world", "language": "en"}, {"id": "59", "text":
+ "hello world", "language": "en"}, {"id": "60", "text": "hello world", "language":
+ "en"}, {"id": "61", "text": "hello world", "language": "en"}, {"id": "62", "text":
+ "hello world", "language": "en"}, {"id": "63", "text": "hello world", "language":
+ "en"}, {"id": "64", "text": "hello world", "language": "en"}, {"id": "65", "text":
+ "hello world", "language": "en"}, {"id": "66", "text": "hello world", "language":
+ "en"}, {"id": "67", "text": "hello world", "language": "en"}, {"id": "68", "text":
+ "hello world", "language": "en"}, {"id": "69", "text": "hello world", "language":
+ "en"}, {"id": "70", "text": "hello world", "language": "en"}, {"id": "71", "text":
+ "hello world", "language": "en"}, {"id": "72", "text": "hello world", "language":
+ "en"}, {"id": "73", "text": "hello world", "language": "en"}, {"id": "74", "text":
+ "hello world", "language": "en"}, {"id": "75", "text": "hello world", "language":
+ "en"}, {"id": "76", "text": "hello world", "language": "en"}, {"id": "77", "text":
+ "hello world", "language": "en"}, {"id": "78", "text": "hello world", "language":
+ "en"}, {"id": "79", "text": "hello world", "language": "en"}, {"id": "80", "text":
+ "hello world", "language": "en"}, {"id": "81", "text": "hello world", "language":
+ "en"}, {"id": "82", "text": "hello world", "language": "en"}, {"id": "83", "text":
+ "hello world", "language": "en"}, {"id": "84", "text": "hello world", "language":
+ "en"}, {"id": "85", "text": "hello world", "language": "en"}, {"id": "86", "text":
+ "hello world", "language": "en"}, {"id": "87", "text": "hello world", "language":
+ "en"}, {"id": "88", "text": "hello world", "language": "en"}, {"id": "89", "text":
+ "hello world", "language": "en"}, {"id": "90", "text": "hello world", "language":
+ "en"}, {"id": "91", "text": "hello world", "language": "en"}, {"id": "92", "text":
+ "hello world", "language": "en"}, {"id": "93", "text": "hello world", "language":
+ "en"}, {"id": "94", "text": "hello world", "language": "en"}, {"id": "95", "text":
+ "hello world", "language": "en"}, {"id": "96", "text": "hello world", "language":
+ "en"}, {"id": "97", "text": "hello world", "language": "en"}, {"id": "98", "text":
+ "hello world", "language": "en"}, {"id": "99", "text": "hello world", "language":
+ "en"}, {"id": "100", "text": "hello world", "language": "en"}, {"id": "101",
+ "text": "hello world", "language": "en"}, {"id": "102", "text": "hello world",
+ "language": "en"}, {"id": "103", "text": "hello world", "language": "en"}, {"id":
+ "104", "text": "hello world", "language": "en"}, {"id": "105", "text": "hello
+ world", "language": "en"}, {"id": "106", "text": "hello world", "language":
+ "en"}, {"id": "107", "text": "hello world", "language": "en"}, {"id": "108",
+ "text": "hello world", "language": "en"}, {"id": "109", "text": "hello world",
+ "language": "en"}, {"id": "110", "text": "hello world", "language": "en"}, {"id":
+ "111", "text": "hello world", "language": "en"}, {"id": "112", "text": "hello
+ world", "language": "en"}, {"id": "113", "text": "hello world", "language":
+ "en"}, {"id": "114", "text": "hello world", "language": "en"}, {"id": "115",
+ "text": "hello world", "language": "en"}, {"id": "116", "text": "hello world",
+ "language": "en"}, {"id": "117", "text": "hello world", "language": "en"}, {"id":
+ "118", "text": "hello world", "language": "en"}, {"id": "119", "text": "hello
+ world", "language": "en"}, {"id": "120", "text": "hello world", "language":
+ "en"}, {"id": "121", "text": "hello world", "language": "en"}, {"id": "122",
+ "text": "hello world", "language": "en"}, {"id": "123", "text": "hello world",
+ "language": "en"}, {"id": "124", "text": "hello world", "language": "en"}, {"id":
+ "125", "text": "hello world", "language": "en"}, {"id": "126", "text": "hello
+ world", "language": "en"}, {"id": "127", "text": "hello world", "language":
+ "en"}, {"id": "128", "text": "hello world", "language": "en"}, {"id": "129",
+ "text": "hello world", "language": "en"}, {"id": "130", "text": "hello world",
+ "language": "en"}, {"id": "131", "text": "hello world", "language": "en"}, {"id":
+ "132", "text": "hello world", "language": "en"}, {"id": "133", "text": "hello
+ world", "language": "en"}, {"id": "134", "text": "hello world", "language":
+ "en"}, {"id": "135", "text": "hello world", "language": "en"}, {"id": "136",
+ "text": "hello world", "language": "en"}, {"id": "137", "text": "hello world",
+ "language": "en"}, {"id": "138", "text": "hello world", "language": "en"}, {"id":
+ "139", "text": "hello world", "language": "en"}, {"id": "140", "text": "hello
+ world", "language": "en"}, {"id": "141", "text": "hello world", "language":
+ "en"}, {"id": "142", "text": "hello world", "language": "en"}, {"id": "143",
+ "text": "hello world", "language": "en"}, {"id": "144", "text": "hello world",
+ "language": "en"}, {"id": "145", "text": "hello world", "language": "en"}, {"id":
+ "146", "text": "hello world", "language": "en"}, {"id": "147", "text": "hello
+ world", "language": "en"}, {"id": "148", "text": "hello world", "language":
+ "en"}, {"id": "149", "text": "hello world", "language": "en"}, {"id": "150",
+ "text": "hello world", "language": "en"}, {"id": "151", "text": "hello world",
+ "language": "en"}, {"id": "152", "text": "hello world", "language": "en"}, {"id":
+ "153", "text": "hello world", "language": "en"}, {"id": "154", "text": "hello
+ world", "language": "en"}, {"id": "155", "text": "hello world", "language":
+ "en"}, {"id": "156", "text": "hello world", "language": "en"}, {"id": "157",
+ "text": "hello world", "language": "en"}, {"id": "158", "text": "hello world",
+ "language": "en"}, {"id": "159", "text": "hello world", "language": "en"}, {"id":
+ "160", "text": "hello world", "language": "en"}, {"id": "161", "text": "hello
+ world", "language": "en"}, {"id": "162", "text": "hello world", "language":
+ "en"}, {"id": "163", "text": "hello world", "language": "en"}, {"id": "164",
+ "text": "hello world", "language": "en"}, {"id": "165", "text": "hello world",
+ "language": "en"}, {"id": "166", "text": "hello world", "language": "en"}, {"id":
+ "167", "text": "hello world", "language": "en"}, {"id": "168", "text": "hello
+ world", "language": "en"}, {"id": "169", "text": "hello world", "language":
+ "en"}, {"id": "170", "text": "hello world", "language": "en"}, {"id": "171",
+ "text": "hello world", "language": "en"}, {"id": "172", "text": "hello world",
+ "language": "en"}, {"id": "173", "text": "hello world", "language": "en"}, {"id":
+ "174", "text": "hello world", "language": "en"}, {"id": "175", "text": "hello
+ world", "language": "en"}, {"id": "176", "text": "hello world", "language":
+ "en"}, {"id": "177", "text": "hello world", "language": "en"}, {"id": "178",
+ "text": "hello world", "language": "en"}, {"id": "179", "text": "hello world",
+ "language": "en"}, {"id": "180", "text": "hello world", "language": "en"}, {"id":
+ "181", "text": "hello world", "language": "en"}, {"id": "182", "text": "hello
+ world", "language": "en"}, {"id": "183", "text": "hello world", "language":
+ "en"}, {"id": "184", "text": "hello world", "language": "en"}, {"id": "185",
+ "text": "hello world", "language": "en"}, {"id": "186", "text": "hello world",
+ "language": "en"}, {"id": "187", "text": "hello world", "language": "en"}, {"id":
+ "188", "text": "hello world", "language": "en"}, {"id": "189", "text": "hello
+ world", "language": "en"}, {"id": "190", "text": "hello world", "language":
+ "en"}, {"id": "191", "text": "hello world", "language": "en"}, {"id": "192",
+ "text": "hello world", "language": "en"}, {"id": "193", "text": "hello world",
+ "language": "en"}, {"id": "194", "text": "hello world", "language": "en"}, {"id":
+ "195", "text": "hello world", "language": "en"}, {"id": "196", "text": "hello
+ world", "language": "en"}, {"id": "197", "text": "hello world", "language":
+ "en"}, {"id": "198", "text": "hello world", "language": "en"}, {"id": "199",
+ "text": "hello world", "language": "en"}, {"id": "200", "text": "hello world",
+ "language": "en"}, {"id": "201", "text": "hello world", "language": "en"}, {"id":
+ "202", "text": "hello world", "language": "en"}, {"id": "203", "text": "hello
+ world", "language": "en"}, {"id": "204", "text": "hello world", "language":
+ "en"}, {"id": "205", "text": "hello world", "language": "en"}, {"id": "206",
+ "text": "hello world", "language": "en"}, {"id": "207", "text": "hello world",
+ "language": "en"}, {"id": "208", "text": "hello world", "language": "en"}, {"id":
+ "209", "text": "hello world", "language": "en"}, {"id": "210", "text": "hello
+ world", "language": "en"}, {"id": "211", "text": "hello world", "language":
+ "en"}, {"id": "212", "text": "hello world", "language": "en"}, {"id": "213",
+ "text": "hello world", "language": "en"}, {"id": "214", "text": "hello world",
+ "language": "en"}, {"id": "215", "text": "hello world", "language": "en"}, {"id":
+ "216", "text": "hello world", "language": "en"}, {"id": "217", "text": "hello
+ world", "language": "en"}, {"id": "218", "text": "hello world", "language":
+ "en"}, {"id": "219", "text": "hello world", "language": "en"}, {"id": "220",
+ "text": "hello world", "language": "en"}, {"id": "221", "text": "hello world",
+ "language": "en"}, {"id": "222", "text": "hello world", "language": "en"}, {"id":
+ "223", "text": "hello world", "language": "en"}, {"id": "224", "text": "hello
+ world", "language": "en"}, {"id": "225", "text": "hello world", "language":
+ "en"}, {"id": "226", "text": "hello world", "language": "en"}, {"id": "227",
+ "text": "hello world", "language": "en"}, {"id": "228", "text": "hello world",
+ "language": "en"}, {"id": "229", "text": "hello world", "language": "en"}, {"id":
+ "230", "text": "hello world", "language": "en"}, {"id": "231", "text": "hello
+ world", "language": "en"}, {"id": "232", "text": "hello world", "language":
+ "en"}, {"id": "233", "text": "hello world", "language": "en"}, {"id": "234",
+ "text": "hello world", "language": "en"}, {"id": "235", "text": "hello world",
+ "language": "en"}, {"id": "236", "text": "hello world", "language": "en"}, {"id":
+ "237", "text": "hello world", "language": "en"}, {"id": "238", "text": "hello
+ world", "language": "en"}, {"id": "239", "text": "hello world", "language":
+ "en"}, {"id": "240", "text": "hello world", "language": "en"}, {"id": "241",
+ "text": "hello world", "language": "en"}, {"id": "242", "text": "hello world",
+ "language": "en"}, {"id": "243", "text": "hello world", "language": "en"}, {"id":
+ "244", "text": "hello world", "language": "en"}, {"id": "245", "text": "hello
+ world", "language": "en"}, {"id": "246", "text": "hello world", "language":
+ "en"}, {"id": "247", "text": "hello world", "language": "en"}, {"id": "248",
+ "text": "hello world", "language": "en"}, {"id": "249", "text": "hello world",
+ "language": "en"}, {"id": "250", "text": "hello world", "language": "en"}, {"id":
+ "251", "text": "hello world", "language": "en"}, {"id": "252", "text": "hello
+ world", "language": "en"}, {"id": "253", "text": "hello world", "language":
+ "en"}, {"id": "254", "text": "hello world", "language": "en"}, {"id": "255",
+ "text": "hello world", "language": "en"}, {"id": "256", "text": "hello world",
+ "language": "en"}, {"id": "257", "text": "hello world", "language": "en"}, {"id":
+ "258", "text": "hello world", "language": "en"}, {"id": "259", "text": "hello
+ world", "language": "en"}, {"id": "260", "text": "hello world", "language":
+ "en"}, {"id": "261", "text": "hello world", "language": "en"}, {"id": "262",
+ "text": "hello world", "language": "en"}, {"id": "263", "text": "hello world",
+ "language": "en"}, {"id": "264", "text": "hello world", "language": "en"}, {"id":
+ "265", "text": "hello world", "language": "en"}, {"id": "266", "text": "hello
+ world", "language": "en"}, {"id": "267", "text": "hello world", "language":
+ "en"}, {"id": "268", "text": "hello world", "language": "en"}, {"id": "269",
+ "text": "hello world", "language": "en"}, {"id": "270", "text": "hello world",
+ "language": "en"}, {"id": "271", "text": "hello world", "language": "en"}, {"id":
+ "272", "text": "hello world", "language": "en"}, {"id": "273", "text": "hello
+ world", "language": "en"}, {"id": "274", "text": "hello world", "language":
+ "en"}, {"id": "275", "text": "hello world", "language": "en"}, {"id": "276",
+ "text": "hello world", "language": "en"}, {"id": "277", "text": "hello world",
+ "language": "en"}, {"id": "278", "text": "hello world", "language": "en"}, {"id":
+ "279", "text": "hello world", "language": "en"}, {"id": "280", "text": "hello
+ world", "language": "en"}, {"id": "281", "text": "hello world", "language":
+ "en"}, {"id": "282", "text": "hello world", "language": "en"}, {"id": "283",
+ "text": "hello world", "language": "en"}, {"id": "284", "text": "hello world",
+ "language": "en"}, {"id": "285", "text": "hello world", "language": "en"}, {"id":
+ "286", "text": "hello world", "language": "en"}, {"id": "287", "text": "hello
+ world", "language": "en"}, {"id": "288", "text": "hello world", "language":
+ "en"}, {"id": "289", "text": "hello world", "language": "en"}, {"id": "290",
+ "text": "hello world", "language": "en"}, {"id": "291", "text": "hello world",
+ "language": "en"}, {"id": "292", "text": "hello world", "language": "en"}, {"id":
+ "293", "text": "hello world", "language": "en"}, {"id": "294", "text": "hello
+ world", "language": "en"}, {"id": "295", "text": "hello world", "language":
+ "en"}, {"id": "296", "text": "hello world", "language": "en"}, {"id": "297",
+ "text": "hello world", "language": "en"}, {"id": "298", "text": "hello world",
+ "language": "en"}, {"id": "299", "text": "hello world", "language": "en"}, {"id":
+ "300", "text": "hello world", "language": "en"}, {"id": "301", "text": "hello
+ world", "language": "en"}, {"id": "302", "text": "hello world", "language":
+ "en"}, {"id": "303", "text": "hello world", "language": "en"}, {"id": "304",
+ "text": "hello world", "language": "en"}, {"id": "305", "text": "hello world",
+ "language": "en"}, {"id": "306", "text": "hello world", "language": "en"}, {"id":
+ "307", "text": "hello world", "language": "en"}, {"id": "308", "text": "hello
+ world", "language": "en"}, {"id": "309", "text": "hello world", "language":
+ "en"}, {"id": "310", "text": "hello world", "language": "en"}, {"id": "311",
+ "text": "hello world", "language": "en"}, {"id": "312", "text": "hello world",
+ "language": "en"}, {"id": "313", "text": "hello world", "language": "en"}, {"id":
+ "314", "text": "hello world", "language": "en"}, {"id": "315", "text": "hello
+ world", "language": "en"}, {"id": "316", "text": "hello world", "language":
+ "en"}, {"id": "317", "text": "hello world", "language": "en"}, {"id": "318",
+ "text": "hello world", "language": "en"}, {"id": "319", "text": "hello world",
+ "language": "en"}, {"id": "320", "text": "hello world", "language": "en"}, {"id":
+ "321", "text": "hello world", "language": "en"}, {"id": "322", "text": "hello
+ world", "language": "en"}, {"id": "323", "text": "hello world", "language":
+ "en"}, {"id": "324", "text": "hello world", "language": "en"}, {"id": "325",
+ "text": "hello world", "language": "en"}, {"id": "326", "text": "hello world",
+ "language": "en"}, {"id": "327", "text": "hello world", "language": "en"}, {"id":
+ "328", "text": "hello world", "language": "en"}, {"id": "329", "text": "hello
+ world", "language": "en"}, {"id": "330", "text": "hello world", "language":
+ "en"}, {"id": "331", "text": "hello world", "language": "en"}, {"id": "332",
+ "text": "hello world", "language": "en"}, {"id": "333", "text": "hello world",
+ "language": "en"}, {"id": "334", "text": "hello world", "language": "en"}, {"id":
+ "335", "text": "hello world", "language": "en"}, {"id": "336", "text": "hello
+ world", "language": "en"}, {"id": "337", "text": "hello world", "language":
+ "en"}, {"id": "338", "text": "hello world", "language": "en"}, {"id": "339",
+ "text": "hello world", "language": "en"}, {"id": "340", "text": "hello world",
+ "language": "en"}, {"id": "341", "text": "hello world", "language": "en"}, {"id":
+ "342", "text": "hello world", "language": "en"}, {"id": "343", "text": "hello
+ world", "language": "en"}, {"id": "344", "text": "hello world", "language":
+ "en"}, {"id": "345", "text": "hello world", "language": "en"}, {"id": "346",
+ "text": "hello world", "language": "en"}, {"id": "347", "text": "hello world",
+ "language": "en"}, {"id": "348", "text": "hello world", "language": "en"}, {"id":
+ "349", "text": "hello world", "language": "en"}, {"id": "350", "text": "hello
+ world", "language": "en"}, {"id": "351", "text": "hello world", "language":
+ "en"}, {"id": "352", "text": "hello world", "language": "en"}, {"id": "353",
+ "text": "hello world", "language": "en"}, {"id": "354", "text": "hello world",
+ "language": "en"}, {"id": "355", "text": "hello world", "language": "en"}, {"id":
+ "356", "text": "hello world", "language": "en"}, {"id": "357", "text": "hello
+ world", "language": "en"}, {"id": "358", "text": "hello world", "language":
+ "en"}, {"id": "359", "text": "hello world", "language": "en"}, {"id": "360",
+ "text": "hello world", "language": "en"}, {"id": "361", "text": "hello world",
+ "language": "en"}, {"id": "362", "text": "hello world", "language": "en"}, {"id":
+ "363", "text": "hello world", "language": "en"}, {"id": "364", "text": "hello
+ world", "language": "en"}, {"id": "365", "text": "hello world", "language":
+ "en"}, {"id": "366", "text": "hello world", "language": "en"}, {"id": "367",
+ "text": "hello world", "language": "en"}, {"id": "368", "text": "hello world",
+ "language": "en"}, {"id": "369", "text": "hello world", "language": "en"}, {"id":
+ "370", "text": "hello world", "language": "en"}, {"id": "371", "text": "hello
+ world", "language": "en"}, {"id": "372", "text": "hello world", "language":
+ "en"}, {"id": "373", "text": "hello world", "language": "en"}, {"id": "374",
+ "text": "hello world", "language": "en"}, {"id": "375", "text": "hello world",
+ "language": "en"}, {"id": "376", "text": "hello world", "language": "en"}, {"id":
+ "377", "text": "hello world", "language": "en"}, {"id": "378", "text": "hello
+ world", "language": "en"}, {"id": "379", "text": "hello world", "language":
+ "en"}, {"id": "380", "text": "hello world", "language": "en"}, {"id": "381",
+ "text": "hello world", "language": "en"}, {"id": "382", "text": "hello world",
+ "language": "en"}, {"id": "383", "text": "hello world", "language": "en"}, {"id":
+ "384", "text": "hello world", "language": "en"}, {"id": "385", "text": "hello
+ world", "language": "en"}, {"id": "386", "text": "hello world", "language":
+ "en"}, {"id": "387", "text": "hello world", "language": "en"}, {"id": "388",
+ "text": "hello world", "language": "en"}, {"id": "389", "text": "hello world",
+ "language": "en"}, {"id": "390", "text": "hello world", "language": "en"}, {"id":
+ "391", "text": "hello world", "language": "en"}, {"id": "392", "text": "hello
+ world", "language": "en"}, {"id": "393", "text": "hello world", "language":
+ "en"}, {"id": "394", "text": "hello world", "language": "en"}, {"id": "395",
+ "text": "hello world", "language": "en"}, {"id": "396", "text": "hello world",
+ "language": "en"}, {"id": "397", "text": "hello world", "language": "en"}, {"id":
+ "398", "text": "hello world", "language": "en"}, {"id": "399", "text": "hello
+ world", "language": "en"}, {"id": "400", "text": "hello world", "language":
+ "en"}, {"id": "401", "text": "hello world", "language": "en"}, {"id": "402",
+ "text": "hello world", "language": "en"}, {"id": "403", "text": "hello world",
+ "language": "en"}, {"id": "404", "text": "hello world", "language": "en"}, {"id":
+ "405", "text": "hello world", "language": "en"}, {"id": "406", "text": "hello
+ world", "language": "en"}, {"id": "407", "text": "hello world", "language":
+ "en"}, {"id": "408", "text": "hello world", "language": "en"}, {"id": "409",
+ "text": "hello world", "language": "en"}, {"id": "410", "text": "hello world",
+ "language": "en"}, {"id": "411", "text": "hello world", "language": "en"}, {"id":
+ "412", "text": "hello world", "language": "en"}, {"id": "413", "text": "hello
+ world", "language": "en"}, {"id": "414", "text": "hello world", "language":
+ "en"}, {"id": "415", "text": "hello world", "language": "en"}, {"id": "416",
+ "text": "hello world", "language": "en"}, {"id": "417", "text": "hello world",
+ "language": "en"}, {"id": "418", "text": "hello world", "language": "en"}, {"id":
+ "419", "text": "hello world", "language": "en"}, {"id": "420", "text": "hello
+ world", "language": "en"}, {"id": "421", "text": "hello world", "language":
+ "en"}, {"id": "422", "text": "hello world", "language": "en"}, {"id": "423",
+ "text": "hello world", "language": "en"}, {"id": "424", "text": "hello world",
+ "language": "en"}, {"id": "425", "text": "hello world", "language": "en"}, {"id":
+ "426", "text": "hello world", "language": "en"}, {"id": "427", "text": "hello
+ world", "language": "en"}, {"id": "428", "text": "hello world", "language":
+ "en"}, {"id": "429", "text": "hello world", "language": "en"}, {"id": "430",
+ "text": "hello world", "language": "en"}, {"id": "431", "text": "hello world",
+ "language": "en"}, {"id": "432", "text": "hello world", "language": "en"}, {"id":
+ "433", "text": "hello world", "language": "en"}, {"id": "434", "text": "hello
+ world", "language": "en"}, {"id": "435", "text": "hello world", "language":
+ "en"}, {"id": "436", "text": "hello world", "language": "en"}, {"id": "437",
+ "text": "hello world", "language": "en"}, {"id": "438", "text": "hello world",
+ "language": "en"}, {"id": "439", "text": "hello world", "language": "en"}, {"id":
+ "440", "text": "hello world", "language": "en"}, {"id": "441", "text": "hello
+ world", "language": "en"}, {"id": "442", "text": "hello world", "language":
+ "en"}, {"id": "443", "text": "hello world", "language": "en"}, {"id": "444",
+ "text": "hello world", "language": "en"}, {"id": "445", "text": "hello world",
+ "language": "en"}, {"id": "446", "text": "hello world", "language": "en"}, {"id":
+ "447", "text": "hello world", "language": "en"}, {"id": "448", "text": "hello
+ world", "language": "en"}, {"id": "449", "text": "hello world", "language":
+ "en"}, {"id": "450", "text": "hello world", "language": "en"}, {"id": "451",
+ "text": "hello world", "language": "en"}, {"id": "452", "text": "hello world",
+ "language": "en"}, {"id": "453", "text": "hello world", "language": "en"}, {"id":
+ "454", "text": "hello world", "language": "en"}, {"id": "455", "text": "hello
+ world", "language": "en"}, {"id": "456", "text": "hello world", "language":
+ "en"}, {"id": "457", "text": "hello world", "language": "en"}, {"id": "458",
+ "text": "hello world", "language": "en"}, {"id": "459", "text": "hello world",
+ "language": "en"}, {"id": "460", "text": "hello world", "language": "en"}, {"id":
+ "461", "text": "hello world", "language": "en"}, {"id": "462", "text": "hello
+ world", "language": "en"}, {"id": "463", "text": "hello world", "language":
+ "en"}, {"id": "464", "text": "hello world", "language": "en"}, {"id": "465",
+ "text": "hello world", "language": "en"}, {"id": "466", "text": "hello world",
+ "language": "en"}, {"id": "467", "text": "hello world", "language": "en"}, {"id":
+ "468", "text": "hello world", "language": "en"}, {"id": "469", "text": "hello
+ world", "language": "en"}, {"id": "470", "text": "hello world", "language":
+ "en"}, {"id": "471", "text": "hello world", "language": "en"}, {"id": "472",
+ "text": "hello world", "language": "en"}, {"id": "473", "text": "hello world",
+ "language": "en"}, {"id": "474", "text": "hello world", "language": "en"}, {"id":
+ "475", "text": "hello world", "language": "en"}, {"id": "476", "text": "hello
+ world", "language": "en"}, {"id": "477", "text": "hello world", "language":
+ "en"}, {"id": "478", "text": "hello world", "language": "en"}, {"id": "479",
+ "text": "hello world", "language": "en"}, {"id": "480", "text": "hello world",
+ "language": "en"}, {"id": "481", "text": "hello world", "language": "en"}, {"id":
+ "482", "text": "hello world", "language": "en"}, {"id": "483", "text": "hello
+ world", "language": "en"}, {"id": "484", "text": "hello world", "language":
+ "en"}, {"id": "485", "text": "hello world", "language": "en"}, {"id": "486",
+ "text": "hello world", "language": "en"}, {"id": "487", "text": "hello world",
+ "language": "en"}, {"id": "488", "text": "hello world", "language": "en"}, {"id":
+ "489", "text": "hello world", "language": "en"}, {"id": "490", "text": "hello
+ world", "language": "en"}, {"id": "491", "text": "hello world", "language":
+ "en"}, {"id": "492", "text": "hello world", "language": "en"}, {"id": "493",
+ "text": "hello world", "language": "en"}, {"id": "494", "text": "hello world",
+ "language": "en"}, {"id": "495", "text": "hello world", "language": "en"}, {"id":
+ "496", "text": "hello world", "language": "en"}, {"id": "497", "text": "hello
+ world", "language": "en"}, {"id": "498", "text": "hello world", "language":
+ "en"}, {"id": "499", "text": "hello world", "language": "en"}, {"id": "500",
+ "text": "hello world", "language": "en"}, {"id": "501", "text": "hello world",
+ "language": "en"}, {"id": "502", "text": "hello world", "language": "en"}, {"id":
+ "503", "text": "hello world", "language": "en"}, {"id": "504", "text": "hello
+ world", "language": "en"}, {"id": "505", "text": "hello world", "language":
+ "en"}, {"id": "506", "text": "hello world", "language": "en"}, {"id": "507",
+ "text": "hello world", "language": "en"}, {"id": "508", "text": "hello world",
+ "language": "en"}, {"id": "509", "text": "hello world", "language": "en"}, {"id":
+ "510", "text": "hello world", "language": "en"}, {"id": "511", "text": "hello
+ world", "language": "en"}, {"id": "512", "text": "hello world", "language":
+ "en"}, {"id": "513", "text": "hello world", "language": "en"}, {"id": "514",
+ "text": "hello world", "language": "en"}, {"id": "515", "text": "hello world",
+ "language": "en"}, {"id": "516", "text": "hello world", "language": "en"}, {"id":
+ "517", "text": "hello world", "language": "en"}, {"id": "518", "text": "hello
+ world", "language": "en"}, {"id": "519", "text": "hello world", "language":
+ "en"}, {"id": "520", "text": "hello world", "language": "en"}, {"id": "521",
+ "text": "hello world", "language": "en"}, {"id": "522", "text": "hello world",
+ "language": "en"}, {"id": "523", "text": "hello world", "language": "en"}, {"id":
+ "524", "text": "hello world", "language": "en"}, {"id": "525", "text": "hello
+ world", "language": "en"}, {"id": "526", "text": "hello world", "language":
+ "en"}, {"id": "527", "text": "hello world", "language": "en"}, {"id": "528",
+ "text": "hello world", "language": "en"}, {"id": "529", "text": "hello world",
+ "language": "en"}, {"id": "530", "text": "hello world", "language": "en"}, {"id":
+ "531", "text": "hello world", "language": "en"}, {"id": "532", "text": "hello
+ world", "language": "en"}, {"id": "533", "text": "hello world", "language":
+ "en"}, {"id": "534", "text": "hello world", "language": "en"}, {"id": "535",
+ "text": "hello world", "language": "en"}, {"id": "536", "text": "hello world",
+ "language": "en"}, {"id": "537", "text": "hello world", "language": "en"}, {"id":
+ "538", "text": "hello world", "language": "en"}, {"id": "539", "text": "hello
+ world", "language": "en"}, {"id": "540", "text": "hello world", "language":
+ "en"}, {"id": "541", "text": "hello world", "language": "en"}, {"id": "542",
+ "text": "hello world", "language": "en"}, {"id": "543", "text": "hello world",
+ "language": "en"}, {"id": "544", "text": "hello world", "language": "en"}, {"id":
+ "545", "text": "hello world", "language": "en"}, {"id": "546", "text": "hello
+ world", "language": "en"}, {"id": "547", "text": "hello world", "language":
+ "en"}, {"id": "548", "text": "hello world", "language": "en"}, {"id": "549",
+ "text": "hello world", "language": "en"}, {"id": "550", "text": "hello world",
+ "language": "en"}, {"id": "551", "text": "hello world", "language": "en"}, {"id":
+ "552", "text": "hello world", "language": "en"}, {"id": "553", "text": "hello
+ world", "language": "en"}, {"id": "554", "text": "hello world", "language":
+ "en"}, {"id": "555", "text": "hello world", "language": "en"}, {"id": "556",
+ "text": "hello world", "language": "en"}, {"id": "557", "text": "hello world",
+ "language": "en"}, {"id": "558", "text": "hello world", "language": "en"}, {"id":
+ "559", "text": "hello world", "language": "en"}, {"id": "560", "text": "hello
+ world", "language": "en"}, {"id": "561", "text": "hello world", "language":
+ "en"}, {"id": "562", "text": "hello world", "language": "en"}, {"id": "563",
+ "text": "hello world", "language": "en"}, {"id": "564", "text": "hello world",
+ "language": "en"}, {"id": "565", "text": "hello world", "language": "en"}, {"id":
+ "566", "text": "hello world", "language": "en"}, {"id": "567", "text": "hello
+ world", "language": "en"}, {"id": "568", "text": "hello world", "language":
+ "en"}, {"id": "569", "text": "hello world", "language": "en"}, {"id": "570",
+ "text": "hello world", "language": "en"}, {"id": "571", "text": "hello world",
+ "language": "en"}, {"id": "572", "text": "hello world", "language": "en"}, {"id":
+ "573", "text": "hello world", "language": "en"}, {"id": "574", "text": "hello
+ world", "language": "en"}, {"id": "575", "text": "hello world", "language":
+ "en"}, {"id": "576", "text": "hello world", "language": "en"}, {"id": "577",
+ "text": "hello world", "language": "en"}, {"id": "578", "text": "hello world",
+ "language": "en"}, {"id": "579", "text": "hello world", "language": "en"}, {"id":
+ "580", "text": "hello world", "language": "en"}, {"id": "581", "text": "hello
+ world", "language": "en"}, {"id": "582", "text": "hello world", "language":
+ "en"}, {"id": "583", "text": "hello world", "language": "en"}, {"id": "584",
+ "text": "hello world", "language": "en"}, {"id": "585", "text": "hello world",
+ "language": "en"}, {"id": "586", "text": "hello world", "language": "en"}, {"id":
+ "587", "text": "hello world", "language": "en"}, {"id": "588", "text": "hello
+ world", "language": "en"}, {"id": "589", "text": "hello world", "language":
+ "en"}, {"id": "590", "text": "hello world", "language": "en"}, {"id": "591",
+ "text": "hello world", "language": "en"}, {"id": "592", "text": "hello world",
+ "language": "en"}, {"id": "593", "text": "hello world", "language": "en"}, {"id":
+ "594", "text": "hello world", "language": "en"}, {"id": "595", "text": "hello
+ world", "language": "en"}, {"id": "596", "text": "hello world", "language":
+ "en"}, {"id": "597", "text": "hello world", "language": "en"}, {"id": "598",
+ "text": "hello world", "language": "en"}, {"id": "599", "text": "hello world",
+ "language": "en"}, {"id": "600", "text": "hello world", "language": "en"}, {"id":
+ "601", "text": "hello world", "language": "en"}, {"id": "602", "text": "hello
+ world", "language": "en"}, {"id": "603", "text": "hello world", "language":
+ "en"}, {"id": "604", "text": "hello world", "language": "en"}, {"id": "605",
+ "text": "hello world", "language": "en"}, {"id": "606", "text": "hello world",
+ "language": "en"}, {"id": "607", "text": "hello world", "language": "en"}, {"id":
+ "608", "text": "hello world", "language": "en"}, {"id": "609", "text": "hello
+ world", "language": "en"}, {"id": "610", "text": "hello world", "language":
+ "en"}, {"id": "611", "text": "hello world", "language": "en"}, {"id": "612",
+ "text": "hello world", "language": "en"}, {"id": "613", "text": "hello world",
+ "language": "en"}, {"id": "614", "text": "hello world", "language": "en"}, {"id":
+ "615", "text": "hello world", "language": "en"}, {"id": "616", "text": "hello
+ world", "language": "en"}, {"id": "617", "text": "hello world", "language":
+ "en"}, {"id": "618", "text": "hello world", "language": "en"}, {"id": "619",
+ "text": "hello world", "language": "en"}, {"id": "620", "text": "hello world",
+ "language": "en"}, {"id": "621", "text": "hello world", "language": "en"}, {"id":
+ "622", "text": "hello world", "language": "en"}, {"id": "623", "text": "hello
+ world", "language": "en"}, {"id": "624", "text": "hello world", "language":
+ "en"}, {"id": "625", "text": "hello world", "language": "en"}, {"id": "626",
+ "text": "hello world", "language": "en"}, {"id": "627", "text": "hello world",
+ "language": "en"}, {"id": "628", "text": "hello world", "language": "en"}, {"id":
+ "629", "text": "hello world", "language": "en"}, {"id": "630", "text": "hello
+ world", "language": "en"}, {"id": "631", "text": "hello world", "language":
+ "en"}, {"id": "632", "text": "hello world", "language": "en"}, {"id": "633",
+ "text": "hello world", "language": "en"}, {"id": "634", "text": "hello world",
+ "language": "en"}, {"id": "635", "text": "hello world", "language": "en"}, {"id":
+ "636", "text": "hello world", "language": "en"}, {"id": "637", "text": "hello
+ world", "language": "en"}, {"id": "638", "text": "hello world", "language":
+ "en"}, {"id": "639", "text": "hello world", "language": "en"}, {"id": "640",
+ "text": "hello world", "language": "en"}, {"id": "641", "text": "hello world",
+ "language": "en"}, {"id": "642", "text": "hello world", "language": "en"}, {"id":
+ "643", "text": "hello world", "language": "en"}, {"id": "644", "text": "hello
+ world", "language": "en"}, {"id": "645", "text": "hello world", "language":
+ "en"}, {"id": "646", "text": "hello world", "language": "en"}, {"id": "647",
+ "text": "hello world", "language": "en"}, {"id": "648", "text": "hello world",
+ "language": "en"}, {"id": "649", "text": "hello world", "language": "en"}, {"id":
+ "650", "text": "hello world", "language": "en"}, {"id": "651", "text": "hello
+ world", "language": "en"}, {"id": "652", "text": "hello world", "language":
+ "en"}, {"id": "653", "text": "hello world", "language": "en"}, {"id": "654",
+ "text": "hello world", "language": "en"}, {"id": "655", "text": "hello world",
+ "language": "en"}, {"id": "656", "text": "hello world", "language": "en"}, {"id":
+ "657", "text": "hello world", "language": "en"}, {"id": "658", "text": "hello
+ world", "language": "en"}, {"id": "659", "text": "hello world", "language":
+ "en"}, {"id": "660", "text": "hello world", "language": "en"}, {"id": "661",
+ "text": "hello world", "language": "en"}, {"id": "662", "text": "hello world",
+ "language": "en"}, {"id": "663", "text": "hello world", "language": "en"}, {"id":
+ "664", "text": "hello world", "language": "en"}, {"id": "665", "text": "hello
+ world", "language": "en"}, {"id": "666", "text": "hello world", "language":
+ "en"}, {"id": "667", "text": "hello world", "language": "en"}, {"id": "668",
+ "text": "hello world", "language": "en"}, {"id": "669", "text": "hello world",
+ "language": "en"}, {"id": "670", "text": "hello world", "language": "en"}, {"id":
+ "671", "text": "hello world", "language": "en"}, {"id": "672", "text": "hello
+ world", "language": "en"}, {"id": "673", "text": "hello world", "language":
+ "en"}, {"id": "674", "text": "hello world", "language": "en"}, {"id": "675",
+ "text": "hello world", "language": "en"}, {"id": "676", "text": "hello world",
+ "language": "en"}, {"id": "677", "text": "hello world", "language": "en"}, {"id":
+ "678", "text": "hello world", "language": "en"}, {"id": "679", "text": "hello
+ world", "language": "en"}, {"id": "680", "text": "hello world", "language":
+ "en"}, {"id": "681", "text": "hello world", "language": "en"}, {"id": "682",
+ "text": "hello world", "language": "en"}, {"id": "683", "text": "hello world",
+ "language": "en"}, {"id": "684", "text": "hello world", "language": "en"}, {"id":
+ "685", "text": "hello world", "language": "en"}, {"id": "686", "text": "hello
+ world", "language": "en"}, {"id": "687", "text": "hello world", "language":
+ "en"}, {"id": "688", "text": "hello world", "language": "en"}, {"id": "689",
+ "text": "hello world", "language": "en"}, {"id": "690", "text": "hello world",
+ "language": "en"}, {"id": "691", "text": "hello world", "language": "en"}, {"id":
+ "692", "text": "hello world", "language": "en"}, {"id": "693", "text": "hello
+ world", "language": "en"}, {"id": "694", "text": "hello world", "language":
+ "en"}, {"id": "695", "text": "hello world", "language": "en"}, {"id": "696",
+ "text": "hello world", "language": "en"}, {"id": "697", "text": "hello world",
+ "language": "en"}, {"id": "698", "text": "hello world", "language": "en"}, {"id":
+ "699", "text": "hello world", "language": "en"}, {"id": "700", "text": "hello
+ world", "language": "en"}, {"id": "701", "text": "hello world", "language":
+ "en"}, {"id": "702", "text": "hello world", "language": "en"}, {"id": "703",
+ "text": "hello world", "language": "en"}, {"id": "704", "text": "hello world",
+ "language": "en"}, {"id": "705", "text": "hello world", "language": "en"}, {"id":
+ "706", "text": "hello world", "language": "en"}, {"id": "707", "text": "hello
+ world", "language": "en"}, {"id": "708", "text": "hello world", "language":
+ "en"}, {"id": "709", "text": "hello world", "language": "en"}, {"id": "710",
+ "text": "hello world", "language": "en"}, {"id": "711", "text": "hello world",
+ "language": "en"}, {"id": "712", "text": "hello world", "language": "en"}, {"id":
+ "713", "text": "hello world", "language": "en"}, {"id": "714", "text": "hello
+ world", "language": "en"}, {"id": "715", "text": "hello world", "language":
+ "en"}, {"id": "716", "text": "hello world", "language": "en"}, {"id": "717",
+ "text": "hello world", "language": "en"}, {"id": "718", "text": "hello world",
+ "language": "en"}, {"id": "719", "text": "hello world", "language": "en"}, {"id":
+ "720", "text": "hello world", "language": "en"}, {"id": "721", "text": "hello
+ world", "language": "en"}, {"id": "722", "text": "hello world", "language":
+ "en"}, {"id": "723", "text": "hello world", "language": "en"}, {"id": "724",
+ "text": "hello world", "language": "en"}, {"id": "725", "text": "hello world",
+ "language": "en"}, {"id": "726", "text": "hello world", "language": "en"}, {"id":
+ "727", "text": "hello world", "language": "en"}, {"id": "728", "text": "hello
+ world", "language": "en"}, {"id": "729", "text": "hello world", "language":
+ "en"}, {"id": "730", "text": "hello world", "language": "en"}, {"id": "731",
+ "text": "hello world", "language": "en"}, {"id": "732", "text": "hello world",
+ "language": "en"}, {"id": "733", "text": "hello world", "language": "en"}, {"id":
+ "734", "text": "hello world", "language": "en"}, {"id": "735", "text": "hello
+ world", "language": "en"}, {"id": "736", "text": "hello world", "language":
+ "en"}, {"id": "737", "text": "hello world", "language": "en"}, {"id": "738",
+ "text": "hello world", "language": "en"}, {"id": "739", "text": "hello world",
+ "language": "en"}, {"id": "740", "text": "hello world", "language": "en"}, {"id":
+ "741", "text": "hello world", "language": "en"}, {"id": "742", "text": "hello
+ world", "language": "en"}, {"id": "743", "text": "hello world", "language":
+ "en"}, {"id": "744", "text": "hello world", "language": "en"}, {"id": "745",
+ "text": "hello world", "language": "en"}, {"id": "746", "text": "hello world",
+ "language": "en"}, {"id": "747", "text": "hello world", "language": "en"}, {"id":
+ "748", "text": "hello world", "language": "en"}, {"id": "749", "text": "hello
+ world", "language": "en"}, {"id": "750", "text": "hello world", "language":
+ "en"}, {"id": "751", "text": "hello world", "language": "en"}, {"id": "752",
+ "text": "hello world", "language": "en"}, {"id": "753", "text": "hello world",
+ "language": "en"}, {"id": "754", "text": "hello world", "language": "en"}, {"id":
+ "755", "text": "hello world", "language": "en"}, {"id": "756", "text": "hello
+ world", "language": "en"}, {"id": "757", "text": "hello world", "language":
+ "en"}, {"id": "758", "text": "hello world", "language": "en"}, {"id": "759",
+ "text": "hello world", "language": "en"}, {"id": "760", "text": "hello world",
+ "language": "en"}, {"id": "761", "text": "hello world", "language": "en"}, {"id":
+ "762", "text": "hello world", "language": "en"}, {"id": "763", "text": "hello
+ world", "language": "en"}, {"id": "764", "text": "hello world", "language":
+ "en"}, {"id": "765", "text": "hello world", "language": "en"}, {"id": "766",
+ "text": "hello world", "language": "en"}, {"id": "767", "text": "hello world",
+ "language": "en"}, {"id": "768", "text": "hello world", "language": "en"}, {"id":
+ "769", "text": "hello world", "language": "en"}, {"id": "770", "text": "hello
+ world", "language": "en"}, {"id": "771", "text": "hello world", "language":
+ "en"}, {"id": "772", "text": "hello world", "language": "en"}, {"id": "773",
+ "text": "hello world", "language": "en"}, {"id": "774", "text": "hello world",
+ "language": "en"}, {"id": "775", "text": "hello world", "language": "en"}, {"id":
+ "776", "text": "hello world", "language": "en"}, {"id": "777", "text": "hello
+ world", "language": "en"}, {"id": "778", "text": "hello world", "language":
+ "en"}, {"id": "779", "text": "hello world", "language": "en"}, {"id": "780",
+ "text": "hello world", "language": "en"}, {"id": "781", "text": "hello world",
+ "language": "en"}, {"id": "782", "text": "hello world", "language": "en"}, {"id":
+ "783", "text": "hello world", "language": "en"}, {"id": "784", "text": "hello
+ world", "language": "en"}, {"id": "785", "text": "hello world", "language":
+ "en"}, {"id": "786", "text": "hello world", "language": "en"}, {"id": "787",
+ "text": "hello world", "language": "en"}, {"id": "788", "text": "hello world",
+ "language": "en"}, {"id": "789", "text": "hello world", "language": "en"}, {"id":
+ "790", "text": "hello world", "language": "en"}, {"id": "791", "text": "hello
+ world", "language": "en"}, {"id": "792", "text": "hello world", "language":
+ "en"}, {"id": "793", "text": "hello world", "language": "en"}, {"id": "794",
+ "text": "hello world", "language": "en"}, {"id": "795", "text": "hello world",
+ "language": "en"}, {"id": "796", "text": "hello world", "language": "en"}, {"id":
+ "797", "text": "hello world", "language": "en"}, {"id": "798", "text": "hello
+ world", "language": "en"}, {"id": "799", "text": "hello world", "language":
+ "en"}, {"id": "800", "text": "hello world", "language": "en"}, {"id": "801",
+ "text": "hello world", "language": "en"}, {"id": "802", "text": "hello world",
+ "language": "en"}, {"id": "803", "text": "hello world", "language": "en"}, {"id":
+ "804", "text": "hello world", "language": "en"}, {"id": "805", "text": "hello
+ world", "language": "en"}, {"id": "806", "text": "hello world", "language":
+ "en"}, {"id": "807", "text": "hello world", "language": "en"}, {"id": "808",
+ "text": "hello world", "language": "en"}, {"id": "809", "text": "hello world",
+ "language": "en"}, {"id": "810", "text": "hello world", "language": "en"}, {"id":
+ "811", "text": "hello world", "language": "en"}, {"id": "812", "text": "hello
+ world", "language": "en"}, {"id": "813", "text": "hello world", "language":
+ "en"}, {"id": "814", "text": "hello world", "language": "en"}, {"id": "815",
+ "text": "hello world", "language": "en"}, {"id": "816", "text": "hello world",
+ "language": "en"}, {"id": "817", "text": "hello world", "language": "en"}, {"id":
+ "818", "text": "hello world", "language": "en"}, {"id": "819", "text": "hello
+ world", "language": "en"}, {"id": "820", "text": "hello world", "language":
+ "en"}, {"id": "821", "text": "hello world", "language": "en"}, {"id": "822",
+ "text": "hello world", "language": "en"}, {"id": "823", "text": "hello world",
+ "language": "en"}, {"id": "824", "text": "hello world", "language": "en"}, {"id":
+ "825", "text": "hello world", "language": "en"}, {"id": "826", "text": "hello
+ world", "language": "en"}, {"id": "827", "text": "hello world", "language":
+ "en"}, {"id": "828", "text": "hello world", "language": "en"}, {"id": "829",
+ "text": "hello world", "language": "en"}, {"id": "830", "text": "hello world",
+ "language": "en"}, {"id": "831", "text": "hello world", "language": "en"}, {"id":
+ "832", "text": "hello world", "language": "en"}, {"id": "833", "text": "hello
+ world", "language": "en"}, {"id": "834", "text": "hello world", "language":
+ "en"}, {"id": "835", "text": "hello world", "language": "en"}, {"id": "836",
+ "text": "hello world", "language": "en"}, {"id": "837", "text": "hello world",
+ "language": "en"}, {"id": "838", "text": "hello world", "language": "en"}, {"id":
+ "839", "text": "hello world", "language": "en"}, {"id": "840", "text": "hello
+ world", "language": "en"}, {"id": "841", "text": "hello world", "language":
+ "en"}, {"id": "842", "text": "hello world", "language": "en"}, {"id": "843",
+ "text": "hello world", "language": "en"}, {"id": "844", "text": "hello world",
+ "language": "en"}, {"id": "845", "text": "hello world", "language": "en"}, {"id":
+ "846", "text": "hello world", "language": "en"}, {"id": "847", "text": "hello
+ world", "language": "en"}, {"id": "848", "text": "hello world", "language":
+ "en"}, {"id": "849", "text": "hello world", "language": "en"}, {"id": "850",
+ "text": "hello world", "language": "en"}, {"id": "851", "text": "hello world",
+ "language": "en"}, {"id": "852", "text": "hello world", "language": "en"}, {"id":
+ "853", "text": "hello world", "language": "en"}, {"id": "854", "text": "hello
+ world", "language": "en"}, {"id": "855", "text": "hello world", "language":
+ "en"}, {"id": "856", "text": "hello world", "language": "en"}, {"id": "857",
+ "text": "hello world", "language": "en"}, {"id": "858", "text": "hello world",
+ "language": "en"}, {"id": "859", "text": "hello world", "language": "en"}, {"id":
+ "860", "text": "hello world", "language": "en"}, {"id": "861", "text": "hello
+ world", "language": "en"}, {"id": "862", "text": "hello world", "language":
+ "en"}, {"id": "863", "text": "hello world", "language": "en"}, {"id": "864",
+ "text": "hello world", "language": "en"}, {"id": "865", "text": "hello world",
+ "language": "en"}, {"id": "866", "text": "hello world", "language": "en"}, {"id":
+ "867", "text": "hello world", "language": "en"}, {"id": "868", "text": "hello
+ world", "language": "en"}, {"id": "869", "text": "hello world", "language":
+ "en"}, {"id": "870", "text": "hello world", "language": "en"}, {"id": "871",
+ "text": "hello world", "language": "en"}, {"id": "872", "text": "hello world",
+ "language": "en"}, {"id": "873", "text": "hello world", "language": "en"}, {"id":
+ "874", "text": "hello world", "language": "en"}, {"id": "875", "text": "hello
+ world", "language": "en"}, {"id": "876", "text": "hello world", "language":
+ "en"}, {"id": "877", "text": "hello world", "language": "en"}, {"id": "878",
+ "text": "hello world", "language": "en"}, {"id": "879", "text": "hello world",
+ "language": "en"}, {"id": "880", "text": "hello world", "language": "en"}, {"id":
+ "881", "text": "hello world", "language": "en"}, {"id": "882", "text": "hello
+ world", "language": "en"}, {"id": "883", "text": "hello world", "language":
+ "en"}, {"id": "884", "text": "hello world", "language": "en"}, {"id": "885",
+ "text": "hello world", "language": "en"}, {"id": "886", "text": "hello world",
+ "language": "en"}, {"id": "887", "text": "hello world", "language": "en"}, {"id":
+ "888", "text": "hello world", "language": "en"}, {"id": "889", "text": "hello
+ world", "language": "en"}, {"id": "890", "text": "hello world", "language":
+ "en"}, {"id": "891", "text": "hello world", "language": "en"}, {"id": "892",
+ "text": "hello world", "language": "en"}, {"id": "893", "text": "hello world",
+ "language": "en"}, {"id": "894", "text": "hello world", "language": "en"}, {"id":
+ "895", "text": "hello world", "language": "en"}, {"id": "896", "text": "hello
+ world", "language": "en"}, {"id": "897", "text": "hello world", "language":
+ "en"}, {"id": "898", "text": "hello world", "language": "en"}, {"id": "899",
+ "text": "hello world", "language": "en"}, {"id": "900", "text": "hello world",
+ "language": "en"}, {"id": "901", "text": "hello world", "language": "en"}, {"id":
+ "902", "text": "hello world", "language": "en"}, {"id": "903", "text": "hello
+ world", "language": "en"}, {"id": "904", "text": "hello world", "language":
+ "en"}, {"id": "905", "text": "hello world", "language": "en"}, {"id": "906",
+ "text": "hello world", "language": "en"}, {"id": "907", "text": "hello world",
+ "language": "en"}, {"id": "908", "text": "hello world", "language": "en"}, {"id":
+ "909", "text": "hello world", "language": "en"}, {"id": "910", "text": "hello
+ world", "language": "en"}, {"id": "911", "text": "hello world", "language":
+ "en"}, {"id": "912", "text": "hello world", "language": "en"}, {"id": "913",
+ "text": "hello world", "language": "en"}, {"id": "914", "text": "hello world",
+ "language": "en"}, {"id": "915", "text": "hello world", "language": "en"}, {"id":
+ "916", "text": "hello world", "language": "en"}, {"id": "917", "text": "hello
+ world", "language": "en"}, {"id": "918", "text": "hello world", "language":
+ "en"}, {"id": "919", "text": "hello world", "language": "en"}, {"id": "920",
+ "text": "hello world", "language": "en"}, {"id": "921", "text": "hello world",
+ "language": "en"}, {"id": "922", "text": "hello world", "language": "en"}, {"id":
+ "923", "text": "hello world", "language": "en"}, {"id": "924", "text": "hello
+ world", "language": "en"}, {"id": "925", "text": "hello world", "language":
+ "en"}, {"id": "926", "text": "hello world", "language": "en"}, {"id": "927",
+ "text": "hello world", "language": "en"}, {"id": "928", "text": "hello world",
+ "language": "en"}, {"id": "929", "text": "hello world", "language": "en"}, {"id":
+ "930", "text": "hello world", "language": "en"}, {"id": "931", "text": "hello
+ world", "language": "en"}, {"id": "932", "text": "hello world", "language":
+ "en"}, {"id": "933", "text": "hello world", "language": "en"}, {"id": "934",
+ "text": "hello world", "language": "en"}, {"id": "935", "text": "hello world",
+ "language": "en"}, {"id": "936", "text": "hello world", "language": "en"}, {"id":
+ "937", "text": "hello world", "language": "en"}, {"id": "938", "text": "hello
+ world", "language": "en"}, {"id": "939", "text": "hello world", "language":
+ "en"}, {"id": "940", "text": "hello world", "language": "en"}, {"id": "941",
+ "text": "hello world", "language": "en"}, {"id": "942", "text": "hello world",
+ "language": "en"}, {"id": "943", "text": "hello world", "language": "en"}, {"id":
+ "944", "text": "hello world", "language": "en"}, {"id": "945", "text": "hello
+ world", "language": "en"}, {"id": "946", "text": "hello world", "language":
+ "en"}, {"id": "947", "text": "hello world", "language": "en"}, {"id": "948",
+ "text": "hello world", "language": "en"}, {"id": "949", "text": "hello world",
+ "language": "en"}, {"id": "950", "text": "hello world", "language": "en"}, {"id":
+ "951", "text": "hello world", "language": "en"}, {"id": "952", "text": "hello
+ world", "language": "en"}, {"id": "953", "text": "hello world", "language":
+ "en"}, {"id": "954", "text": "hello world", "language": "en"}, {"id": "955",
+ "text": "hello world", "language": "en"}, {"id": "956", "text": "hello world",
+ "language": "en"}, {"id": "957", "text": "hello world", "language": "en"}, {"id":
+ "958", "text": "hello world", "language": "en"}, {"id": "959", "text": "hello
+ world", "language": "en"}, {"id": "960", "text": "hello world", "language":
+ "en"}, {"id": "961", "text": "hello world", "language": "en"}, {"id": "962",
+ "text": "hello world", "language": "en"}, {"id": "963", "text": "hello world",
+ "language": "en"}, {"id": "964", "text": "hello world", "language": "en"}, {"id":
+ "965", "text": "hello world", "language": "en"}, {"id": "966", "text": "hello
+ world", "language": "en"}, {"id": "967", "text": "hello world", "language":
+ "en"}, {"id": "968", "text": "hello world", "language": "en"}, {"id": "969",
+ "text": "hello world", "language": "en"}, {"id": "970", "text": "hello world",
+ "language": "en"}, {"id": "971", "text": "hello world", "language": "en"}, {"id":
+ "972", "text": "hello world", "language": "en"}, {"id": "973", "text": "hello
+ world", "language": "en"}, {"id": "974", "text": "hello world", "language":
+ "en"}, {"id": "975", "text": "hello world", "language": "en"}, {"id": "976",
+ "text": "hello world", "language": "en"}, {"id": "977", "text": "hello world",
+ "language": "en"}, {"id": "978", "text": "hello world", "language": "en"}, {"id":
+ "979", "text": "hello world", "language": "en"}, {"id": "980", "text": "hello
+ world", "language": "en"}, {"id": "981", "text": "hello world", "language":
+ "en"}, {"id": "982", "text": "hello world", "language": "en"}, {"id": "983",
+ "text": "hello world", "language": "en"}, {"id": "984", "text": "hello world",
+ "language": "en"}, {"id": "985", "text": "hello world", "language": "en"}, {"id":
+ "986", "text": "hello world", "language": "en"}, {"id": "987", "text": "hello
+ world", "language": "en"}, {"id": "988", "text": "hello world", "language":
+ "en"}, {"id": "989", "text": "hello world", "language": "en"}, {"id": "990",
+ "text": "hello world", "language": "en"}, {"id": "991", "text": "hello world",
+ "language": "en"}, {"id": "992", "text": "hello world", "language": "en"}, {"id":
+ "993", "text": "hello world", "language": "en"}, {"id": "994", "text": "hello
+ world", "language": "en"}, {"id": "995", "text": "hello world", "language":
+ "en"}, {"id": "996", "text": "hello world", "language": "en"}, {"id": "997",
+ "text": "hello world", "language": "en"}, {"id": "998", "text": "hello world",
+ "language": "en"}, {"id": "999", "text": "hello world", "language": "en"}, {"id":
+ "1000", "text": "hello world", "language": "en"}, {"id": "1001", "text": "hello
+ world", "language": "en"}, {"id": "1002", "text": "hello world", "language":
+ "en"}, {"id": "1003", "text": "hello world", "language": "en"}, {"id": "1004",
+ "text": "hello world", "language": "en"}, {"id": "1005", "text": "hello world",
+ "language": "en"}, {"id": "1006", "text": "hello world", "language": "en"},
+ {"id": "1007", "text": "hello world", "language": "en"}, {"id": "1008", "text":
+ "hello world", "language": "en"}, {"id": "1009", "text": "hello world", "language":
+ "en"}, {"id": "1010", "text": "hello world", "language": "en"}, {"id": "1011",
+ "text": "hello world", "language": "en"}, {"id": "1012", "text": "hello world",
+ "language": "en"}, {"id": "1013", "text": "hello world", "language": "en"},
+ {"id": "1014", "text": "hello world", "language": "en"}, {"id": "1015", "text":
+ "hello world", "language": "en"}, {"id": "1016", "text": "hello world", "language":
+ "en"}, {"id": "1017", "text": "hello world", "language": "en"}, {"id": "1018",
+ "text": "hello world", "language": "en"}, {"id": "1019", "text": "hello world",
+ "language": "en"}, {"id": "1020", "text": "hello world", "language": "en"},
+ {"id": "1021", "text": "hello world", "language": "en"}, {"id": "1022", "text":
+ "hello world", "language": "en"}, {"id": "1023", "text": "hello world", "language":
+ "en"}, {"id": "1024", "text": "hello world", "language": "en"}, {"id": "1025",
+ "text": "hello world", "language": "en"}, {"id": "1026", "text": "hello world",
+ "language": "en"}, {"id": "1027", "text": "hello world", "language": "en"},
+ {"id": "1028", "text": "hello world", "language": "en"}, {"id": "1029", "text":
+ "hello world", "language": "en"}, {"id": "1030", "text": "hello world", "language":
+ "en"}, {"id": "1031", "text": "hello world", "language": "en"}, {"id": "1032",
+ "text": "hello world", "language": "en"}, {"id": "1033", "text": "hello world",
+ "language": "en"}, {"id": "1034", "text": "hello world", "language": "en"},
+ {"id": "1035", "text": "hello world", "language": "en"}, {"id": "1036", "text":
+ "hello world", "language": "en"}, {"id": "1037", "text": "hello world", "language":
+ "en"}, {"id": "1038", "text": "hello world", "language": "en"}, {"id": "1039",
+ "text": "hello world", "language": "en"}, {"id": "1040", "text": "hello world",
+ "language": "en"}, {"id": "1041", "text": "hello world", "language": "en"},
+ {"id": "1042", "text": "hello world", "language": "en"}, {"id": "1043", "text":
+ "hello world", "language": "en"}, {"id": "1044", "text": "hello world", "language":
+ "en"}, {"id": "1045", "text": "hello world", "language": "en"}, {"id": "1046",
+ "text": "hello world", "language": "en"}, {"id": "1047", "text": "hello world",
+ "language": "en"}, {"id": "1048", "text": "hello world", "language": "en"},
+ {"id": "1049", "text": "hello world", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '58755'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
+ request contains too many records. Max 1000 records are permitted."}}}'
+ headers:
+ apim-request-id: 995c6d23-0bc5-4396-b3af-96c997a2e97c
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:46 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '11'
+ status:
+ code: 400
+ message: Bad Request
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_batch_size_over_limit_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_batch_size_over_limit_error.yaml
new file mode 100644
index 000000000000..3f1f1d23f729
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_batch_size_over_limit_error.yaml
@@ -0,0 +1,741 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "hello world", "language": "en"}, {"id":
+ "1", "text": "hello world", "language": "en"}, {"id": "2", "text": "hello world",
+ "language": "en"}, {"id": "3", "text": "hello world", "language": "en"}, {"id":
+ "4", "text": "hello world", "language": "en"}, {"id": "5", "text": "hello world",
+ "language": "en"}, {"id": "6", "text": "hello world", "language": "en"}, {"id":
+ "7", "text": "hello world", "language": "en"}, {"id": "8", "text": "hello world",
+ "language": "en"}, {"id": "9", "text": "hello world", "language": "en"}, {"id":
+ "10", "text": "hello world", "language": "en"}, {"id": "11", "text": "hello
+ world", "language": "en"}, {"id": "12", "text": "hello world", "language": "en"},
+ {"id": "13", "text": "hello world", "language": "en"}, {"id": "14", "text":
+ "hello world", "language": "en"}, {"id": "15", "text": "hello world", "language":
+ "en"}, {"id": "16", "text": "hello world", "language": "en"}, {"id": "17", "text":
+ "hello world", "language": "en"}, {"id": "18", "text": "hello world", "language":
+ "en"}, {"id": "19", "text": "hello world", "language": "en"}, {"id": "20", "text":
+ "hello world", "language": "en"}, {"id": "21", "text": "hello world", "language":
+ "en"}, {"id": "22", "text": "hello world", "language": "en"}, {"id": "23", "text":
+ "hello world", "language": "en"}, {"id": "24", "text": "hello world", "language":
+ "en"}, {"id": "25", "text": "hello world", "language": "en"}, {"id": "26", "text":
+ "hello world", "language": "en"}, {"id": "27", "text": "hello world", "language":
+ "en"}, {"id": "28", "text": "hello world", "language": "en"}, {"id": "29", "text":
+ "hello world", "language": "en"}, {"id": "30", "text": "hello world", "language":
+ "en"}, {"id": "31", "text": "hello world", "language": "en"}, {"id": "32", "text":
+ "hello world", "language": "en"}, {"id": "33", "text": "hello world", "language":
+ "en"}, {"id": "34", "text": "hello world", "language": "en"}, {"id": "35", "text":
+ "hello world", "language": "en"}, {"id": "36", "text": "hello world", "language":
+ "en"}, {"id": "37", "text": "hello world", "language": "en"}, {"id": "38", "text":
+ "hello world", "language": "en"}, {"id": "39", "text": "hello world", "language":
+ "en"}, {"id": "40", "text": "hello world", "language": "en"}, {"id": "41", "text":
+ "hello world", "language": "en"}, {"id": "42", "text": "hello world", "language":
+ "en"}, {"id": "43", "text": "hello world", "language": "en"}, {"id": "44", "text":
+ "hello world", "language": "en"}, {"id": "45", "text": "hello world", "language":
+ "en"}, {"id": "46", "text": "hello world", "language": "en"}, {"id": "47", "text":
+ "hello world", "language": "en"}, {"id": "48", "text": "hello world", "language":
+ "en"}, {"id": "49", "text": "hello world", "language": "en"}, {"id": "50", "text":
+ "hello world", "language": "en"}, {"id": "51", "text": "hello world", "language":
+ "en"}, {"id": "52", "text": "hello world", "language": "en"}, {"id": "53", "text":
+ "hello world", "language": "en"}, {"id": "54", "text": "hello world", "language":
+ "en"}, {"id": "55", "text": "hello world", "language": "en"}, {"id": "56", "text":
+ "hello world", "language": "en"}, {"id": "57", "text": "hello world", "language":
+ "en"}, {"id": "58", "text": "hello world", "language": "en"}, {"id": "59", "text":
+ "hello world", "language": "en"}, {"id": "60", "text": "hello world", "language":
+ "en"}, {"id": "61", "text": "hello world", "language": "en"}, {"id": "62", "text":
+ "hello world", "language": "en"}, {"id": "63", "text": "hello world", "language":
+ "en"}, {"id": "64", "text": "hello world", "language": "en"}, {"id": "65", "text":
+ "hello world", "language": "en"}, {"id": "66", "text": "hello world", "language":
+ "en"}, {"id": "67", "text": "hello world", "language": "en"}, {"id": "68", "text":
+ "hello world", "language": "en"}, {"id": "69", "text": "hello world", "language":
+ "en"}, {"id": "70", "text": "hello world", "language": "en"}, {"id": "71", "text":
+ "hello world", "language": "en"}, {"id": "72", "text": "hello world", "language":
+ "en"}, {"id": "73", "text": "hello world", "language": "en"}, {"id": "74", "text":
+ "hello world", "language": "en"}, {"id": "75", "text": "hello world", "language":
+ "en"}, {"id": "76", "text": "hello world", "language": "en"}, {"id": "77", "text":
+ "hello world", "language": "en"}, {"id": "78", "text": "hello world", "language":
+ "en"}, {"id": "79", "text": "hello world", "language": "en"}, {"id": "80", "text":
+ "hello world", "language": "en"}, {"id": "81", "text": "hello world", "language":
+ "en"}, {"id": "82", "text": "hello world", "language": "en"}, {"id": "83", "text":
+ "hello world", "language": "en"}, {"id": "84", "text": "hello world", "language":
+ "en"}, {"id": "85", "text": "hello world", "language": "en"}, {"id": "86", "text":
+ "hello world", "language": "en"}, {"id": "87", "text": "hello world", "language":
+ "en"}, {"id": "88", "text": "hello world", "language": "en"}, {"id": "89", "text":
+ "hello world", "language": "en"}, {"id": "90", "text": "hello world", "language":
+ "en"}, {"id": "91", "text": "hello world", "language": "en"}, {"id": "92", "text":
+ "hello world", "language": "en"}, {"id": "93", "text": "hello world", "language":
+ "en"}, {"id": "94", "text": "hello world", "language": "en"}, {"id": "95", "text":
+ "hello world", "language": "en"}, {"id": "96", "text": "hello world", "language":
+ "en"}, {"id": "97", "text": "hello world", "language": "en"}, {"id": "98", "text":
+ "hello world", "language": "en"}, {"id": "99", "text": "hello world", "language":
+ "en"}, {"id": "100", "text": "hello world", "language": "en"}, {"id": "101",
+ "text": "hello world", "language": "en"}, {"id": "102", "text": "hello world",
+ "language": "en"}, {"id": "103", "text": "hello world", "language": "en"}, {"id":
+ "104", "text": "hello world", "language": "en"}, {"id": "105", "text": "hello
+ world", "language": "en"}, {"id": "106", "text": "hello world", "language":
+ "en"}, {"id": "107", "text": "hello world", "language": "en"}, {"id": "108",
+ "text": "hello world", "language": "en"}, {"id": "109", "text": "hello world",
+ "language": "en"}, {"id": "110", "text": "hello world", "language": "en"}, {"id":
+ "111", "text": "hello world", "language": "en"}, {"id": "112", "text": "hello
+ world", "language": "en"}, {"id": "113", "text": "hello world", "language":
+ "en"}, {"id": "114", "text": "hello world", "language": "en"}, {"id": "115",
+ "text": "hello world", "language": "en"}, {"id": "116", "text": "hello world",
+ "language": "en"}, {"id": "117", "text": "hello world", "language": "en"}, {"id":
+ "118", "text": "hello world", "language": "en"}, {"id": "119", "text": "hello
+ world", "language": "en"}, {"id": "120", "text": "hello world", "language":
+ "en"}, {"id": "121", "text": "hello world", "language": "en"}, {"id": "122",
+ "text": "hello world", "language": "en"}, {"id": "123", "text": "hello world",
+ "language": "en"}, {"id": "124", "text": "hello world", "language": "en"}, {"id":
+ "125", "text": "hello world", "language": "en"}, {"id": "126", "text": "hello
+ world", "language": "en"}, {"id": "127", "text": "hello world", "language":
+ "en"}, {"id": "128", "text": "hello world", "language": "en"}, {"id": "129",
+ "text": "hello world", "language": "en"}, {"id": "130", "text": "hello world",
+ "language": "en"}, {"id": "131", "text": "hello world", "language": "en"}, {"id":
+ "132", "text": "hello world", "language": "en"}, {"id": "133", "text": "hello
+ world", "language": "en"}, {"id": "134", "text": "hello world", "language":
+ "en"}, {"id": "135", "text": "hello world", "language": "en"}, {"id": "136",
+ "text": "hello world", "language": "en"}, {"id": "137", "text": "hello world",
+ "language": "en"}, {"id": "138", "text": "hello world", "language": "en"}, {"id":
+ "139", "text": "hello world", "language": "en"}, {"id": "140", "text": "hello
+ world", "language": "en"}, {"id": "141", "text": "hello world", "language":
+ "en"}, {"id": "142", "text": "hello world", "language": "en"}, {"id": "143",
+ "text": "hello world", "language": "en"}, {"id": "144", "text": "hello world",
+ "language": "en"}, {"id": "145", "text": "hello world", "language": "en"}, {"id":
+ "146", "text": "hello world", "language": "en"}, {"id": "147", "text": "hello
+ world", "language": "en"}, {"id": "148", "text": "hello world", "language":
+ "en"}, {"id": "149", "text": "hello world", "language": "en"}, {"id": "150",
+ "text": "hello world", "language": "en"}, {"id": "151", "text": "hello world",
+ "language": "en"}, {"id": "152", "text": "hello world", "language": "en"}, {"id":
+ "153", "text": "hello world", "language": "en"}, {"id": "154", "text": "hello
+ world", "language": "en"}, {"id": "155", "text": "hello world", "language":
+ "en"}, {"id": "156", "text": "hello world", "language": "en"}, {"id": "157",
+ "text": "hello world", "language": "en"}, {"id": "158", "text": "hello world",
+ "language": "en"}, {"id": "159", "text": "hello world", "language": "en"}, {"id":
+ "160", "text": "hello world", "language": "en"}, {"id": "161", "text": "hello
+ world", "language": "en"}, {"id": "162", "text": "hello world", "language":
+ "en"}, {"id": "163", "text": "hello world", "language": "en"}, {"id": "164",
+ "text": "hello world", "language": "en"}, {"id": "165", "text": "hello world",
+ "language": "en"}, {"id": "166", "text": "hello world", "language": "en"}, {"id":
+ "167", "text": "hello world", "language": "en"}, {"id": "168", "text": "hello
+ world", "language": "en"}, {"id": "169", "text": "hello world", "language":
+ "en"}, {"id": "170", "text": "hello world", "language": "en"}, {"id": "171",
+ "text": "hello world", "language": "en"}, {"id": "172", "text": "hello world",
+ "language": "en"}, {"id": "173", "text": "hello world", "language": "en"}, {"id":
+ "174", "text": "hello world", "language": "en"}, {"id": "175", "text": "hello
+ world", "language": "en"}, {"id": "176", "text": "hello world", "language":
+ "en"}, {"id": "177", "text": "hello world", "language": "en"}, {"id": "178",
+ "text": "hello world", "language": "en"}, {"id": "179", "text": "hello world",
+ "language": "en"}, {"id": "180", "text": "hello world", "language": "en"}, {"id":
+ "181", "text": "hello world", "language": "en"}, {"id": "182", "text": "hello
+ world", "language": "en"}, {"id": "183", "text": "hello world", "language":
+ "en"}, {"id": "184", "text": "hello world", "language": "en"}, {"id": "185",
+ "text": "hello world", "language": "en"}, {"id": "186", "text": "hello world",
+ "language": "en"}, {"id": "187", "text": "hello world", "language": "en"}, {"id":
+ "188", "text": "hello world", "language": "en"}, {"id": "189", "text": "hello
+ world", "language": "en"}, {"id": "190", "text": "hello world", "language":
+ "en"}, {"id": "191", "text": "hello world", "language": "en"}, {"id": "192",
+ "text": "hello world", "language": "en"}, {"id": "193", "text": "hello world",
+ "language": "en"}, {"id": "194", "text": "hello world", "language": "en"}, {"id":
+ "195", "text": "hello world", "language": "en"}, {"id": "196", "text": "hello
+ world", "language": "en"}, {"id": "197", "text": "hello world", "language":
+ "en"}, {"id": "198", "text": "hello world", "language": "en"}, {"id": "199",
+ "text": "hello world", "language": "en"}, {"id": "200", "text": "hello world",
+ "language": "en"}, {"id": "201", "text": "hello world", "language": "en"}, {"id":
+ "202", "text": "hello world", "language": "en"}, {"id": "203", "text": "hello
+ world", "language": "en"}, {"id": "204", "text": "hello world", "language":
+ "en"}, {"id": "205", "text": "hello world", "language": "en"}, {"id": "206",
+ "text": "hello world", "language": "en"}, {"id": "207", "text": "hello world",
+ "language": "en"}, {"id": "208", "text": "hello world", "language": "en"}, {"id":
+ "209", "text": "hello world", "language": "en"}, {"id": "210", "text": "hello
+ world", "language": "en"}, {"id": "211", "text": "hello world", "language":
+ "en"}, {"id": "212", "text": "hello world", "language": "en"}, {"id": "213",
+ "text": "hello world", "language": "en"}, {"id": "214", "text": "hello world",
+ "language": "en"}, {"id": "215", "text": "hello world", "language": "en"}, {"id":
+ "216", "text": "hello world", "language": "en"}, {"id": "217", "text": "hello
+ world", "language": "en"}, {"id": "218", "text": "hello world", "language":
+ "en"}, {"id": "219", "text": "hello world", "language": "en"}, {"id": "220",
+ "text": "hello world", "language": "en"}, {"id": "221", "text": "hello world",
+ "language": "en"}, {"id": "222", "text": "hello world", "language": "en"}, {"id":
+ "223", "text": "hello world", "language": "en"}, {"id": "224", "text": "hello
+ world", "language": "en"}, {"id": "225", "text": "hello world", "language":
+ "en"}, {"id": "226", "text": "hello world", "language": "en"}, {"id": "227",
+ "text": "hello world", "language": "en"}, {"id": "228", "text": "hello world",
+ "language": "en"}, {"id": "229", "text": "hello world", "language": "en"}, {"id":
+ "230", "text": "hello world", "language": "en"}, {"id": "231", "text": "hello
+ world", "language": "en"}, {"id": "232", "text": "hello world", "language":
+ "en"}, {"id": "233", "text": "hello world", "language": "en"}, {"id": "234",
+ "text": "hello world", "language": "en"}, {"id": "235", "text": "hello world",
+ "language": "en"}, {"id": "236", "text": "hello world", "language": "en"}, {"id":
+ "237", "text": "hello world", "language": "en"}, {"id": "238", "text": "hello
+ world", "language": "en"}, {"id": "239", "text": "hello world", "language":
+ "en"}, {"id": "240", "text": "hello world", "language": "en"}, {"id": "241",
+ "text": "hello world", "language": "en"}, {"id": "242", "text": "hello world",
+ "language": "en"}, {"id": "243", "text": "hello world", "language": "en"}, {"id":
+ "244", "text": "hello world", "language": "en"}, {"id": "245", "text": "hello
+ world", "language": "en"}, {"id": "246", "text": "hello world", "language":
+ "en"}, {"id": "247", "text": "hello world", "language": "en"}, {"id": "248",
+ "text": "hello world", "language": "en"}, {"id": "249", "text": "hello world",
+ "language": "en"}, {"id": "250", "text": "hello world", "language": "en"}, {"id":
+ "251", "text": "hello world", "language": "en"}, {"id": "252", "text": "hello
+ world", "language": "en"}, {"id": "253", "text": "hello world", "language":
+ "en"}, {"id": "254", "text": "hello world", "language": "en"}, {"id": "255",
+ "text": "hello world", "language": "en"}, {"id": "256", "text": "hello world",
+ "language": "en"}, {"id": "257", "text": "hello world", "language": "en"}, {"id":
+ "258", "text": "hello world", "language": "en"}, {"id": "259", "text": "hello
+ world", "language": "en"}, {"id": "260", "text": "hello world", "language":
+ "en"}, {"id": "261", "text": "hello world", "language": "en"}, {"id": "262",
+ "text": "hello world", "language": "en"}, {"id": "263", "text": "hello world",
+ "language": "en"}, {"id": "264", "text": "hello world", "language": "en"}, {"id":
+ "265", "text": "hello world", "language": "en"}, {"id": "266", "text": "hello
+ world", "language": "en"}, {"id": "267", "text": "hello world", "language":
+ "en"}, {"id": "268", "text": "hello world", "language": "en"}, {"id": "269",
+ "text": "hello world", "language": "en"}, {"id": "270", "text": "hello world",
+ "language": "en"}, {"id": "271", "text": "hello world", "language": "en"}, {"id":
+ "272", "text": "hello world", "language": "en"}, {"id": "273", "text": "hello
+ world", "language": "en"}, {"id": "274", "text": "hello world", "language":
+ "en"}, {"id": "275", "text": "hello world", "language": "en"}, {"id": "276",
+ "text": "hello world", "language": "en"}, {"id": "277", "text": "hello world",
+ "language": "en"}, {"id": "278", "text": "hello world", "language": "en"}, {"id":
+ "279", "text": "hello world", "language": "en"}, {"id": "280", "text": "hello
+ world", "language": "en"}, {"id": "281", "text": "hello world", "language":
+ "en"}, {"id": "282", "text": "hello world", "language": "en"}, {"id": "283",
+ "text": "hello world", "language": "en"}, {"id": "284", "text": "hello world",
+ "language": "en"}, {"id": "285", "text": "hello world", "language": "en"}, {"id":
+ "286", "text": "hello world", "language": "en"}, {"id": "287", "text": "hello
+ world", "language": "en"}, {"id": "288", "text": "hello world", "language":
+ "en"}, {"id": "289", "text": "hello world", "language": "en"}, {"id": "290",
+ "text": "hello world", "language": "en"}, {"id": "291", "text": "hello world",
+ "language": "en"}, {"id": "292", "text": "hello world", "language": "en"}, {"id":
+ "293", "text": "hello world", "language": "en"}, {"id": "294", "text": "hello
+ world", "language": "en"}, {"id": "295", "text": "hello world", "language":
+ "en"}, {"id": "296", "text": "hello world", "language": "en"}, {"id": "297",
+ "text": "hello world", "language": "en"}, {"id": "298", "text": "hello world",
+ "language": "en"}, {"id": "299", "text": "hello world", "language": "en"}, {"id":
+ "300", "text": "hello world", "language": "en"}, {"id": "301", "text": "hello
+ world", "language": "en"}, {"id": "302", "text": "hello world", "language":
+ "en"}, {"id": "303", "text": "hello world", "language": "en"}, {"id": "304",
+ "text": "hello world", "language": "en"}, {"id": "305", "text": "hello world",
+ "language": "en"}, {"id": "306", "text": "hello world", "language": "en"}, {"id":
+ "307", "text": "hello world", "language": "en"}, {"id": "308", "text": "hello
+ world", "language": "en"}, {"id": "309", "text": "hello world", "language":
+ "en"}, {"id": "310", "text": "hello world", "language": "en"}, {"id": "311",
+ "text": "hello world", "language": "en"}, {"id": "312", "text": "hello world",
+ "language": "en"}, {"id": "313", "text": "hello world", "language": "en"}, {"id":
+ "314", "text": "hello world", "language": "en"}, {"id": "315", "text": "hello
+ world", "language": "en"}, {"id": "316", "text": "hello world", "language":
+ "en"}, {"id": "317", "text": "hello world", "language": "en"}, {"id": "318",
+ "text": "hello world", "language": "en"}, {"id": "319", "text": "hello world",
+ "language": "en"}, {"id": "320", "text": "hello world", "language": "en"}, {"id":
+ "321", "text": "hello world", "language": "en"}, {"id": "322", "text": "hello
+ world", "language": "en"}, {"id": "323", "text": "hello world", "language":
+ "en"}, {"id": "324", "text": "hello world", "language": "en"}, {"id": "325",
+ "text": "hello world", "language": "en"}, {"id": "326", "text": "hello world",
+ "language": "en"}, {"id": "327", "text": "hello world", "language": "en"}, {"id":
+ "328", "text": "hello world", "language": "en"}, {"id": "329", "text": "hello
+ world", "language": "en"}, {"id": "330", "text": "hello world", "language":
+ "en"}, {"id": "331", "text": "hello world", "language": "en"}, {"id": "332",
+ "text": "hello world", "language": "en"}, {"id": "333", "text": "hello world",
+ "language": "en"}, {"id": "334", "text": "hello world", "language": "en"}, {"id":
+ "335", "text": "hello world", "language": "en"}, {"id": "336", "text": "hello
+ world", "language": "en"}, {"id": "337", "text": "hello world", "language":
+ "en"}, {"id": "338", "text": "hello world", "language": "en"}, {"id": "339",
+ "text": "hello world", "language": "en"}, {"id": "340", "text": "hello world",
+ "language": "en"}, {"id": "341", "text": "hello world", "language": "en"}, {"id":
+ "342", "text": "hello world", "language": "en"}, {"id": "343", "text": "hello
+ world", "language": "en"}, {"id": "344", "text": "hello world", "language":
+ "en"}, {"id": "345", "text": "hello world", "language": "en"}, {"id": "346",
+ "text": "hello world", "language": "en"}, {"id": "347", "text": "hello world",
+ "language": "en"}, {"id": "348", "text": "hello world", "language": "en"}, {"id":
+ "349", "text": "hello world", "language": "en"}, {"id": "350", "text": "hello
+ world", "language": "en"}, {"id": "351", "text": "hello world", "language":
+ "en"}, {"id": "352", "text": "hello world", "language": "en"}, {"id": "353",
+ "text": "hello world", "language": "en"}, {"id": "354", "text": "hello world",
+ "language": "en"}, {"id": "355", "text": "hello world", "language": "en"}, {"id":
+ "356", "text": "hello world", "language": "en"}, {"id": "357", "text": "hello
+ world", "language": "en"}, {"id": "358", "text": "hello world", "language":
+ "en"}, {"id": "359", "text": "hello world", "language": "en"}, {"id": "360",
+ "text": "hello world", "language": "en"}, {"id": "361", "text": "hello world",
+ "language": "en"}, {"id": "362", "text": "hello world", "language": "en"}, {"id":
+ "363", "text": "hello world", "language": "en"}, {"id": "364", "text": "hello
+ world", "language": "en"}, {"id": "365", "text": "hello world", "language":
+ "en"}, {"id": "366", "text": "hello world", "language": "en"}, {"id": "367",
+ "text": "hello world", "language": "en"}, {"id": "368", "text": "hello world",
+ "language": "en"}, {"id": "369", "text": "hello world", "language": "en"}, {"id":
+ "370", "text": "hello world", "language": "en"}, {"id": "371", "text": "hello
+ world", "language": "en"}, {"id": "372", "text": "hello world", "language":
+ "en"}, {"id": "373", "text": "hello world", "language": "en"}, {"id": "374",
+ "text": "hello world", "language": "en"}, {"id": "375", "text": "hello world",
+ "language": "en"}, {"id": "376", "text": "hello world", "language": "en"}, {"id":
+ "377", "text": "hello world", "language": "en"}, {"id": "378", "text": "hello
+ world", "language": "en"}, {"id": "379", "text": "hello world", "language":
+ "en"}, {"id": "380", "text": "hello world", "language": "en"}, {"id": "381",
+ "text": "hello world", "language": "en"}, {"id": "382", "text": "hello world",
+ "language": "en"}, {"id": "383", "text": "hello world", "language": "en"}, {"id":
+ "384", "text": "hello world", "language": "en"}, {"id": "385", "text": "hello
+ world", "language": "en"}, {"id": "386", "text": "hello world", "language":
+ "en"}, {"id": "387", "text": "hello world", "language": "en"}, {"id": "388",
+ "text": "hello world", "language": "en"}, {"id": "389", "text": "hello world",
+ "language": "en"}, {"id": "390", "text": "hello world", "language": "en"}, {"id":
+ "391", "text": "hello world", "language": "en"}, {"id": "392", "text": "hello
+ world", "language": "en"}, {"id": "393", "text": "hello world", "language":
+ "en"}, {"id": "394", "text": "hello world", "language": "en"}, {"id": "395",
+ "text": "hello world", "language": "en"}, {"id": "396", "text": "hello world",
+ "language": "en"}, {"id": "397", "text": "hello world", "language": "en"}, {"id":
+ "398", "text": "hello world", "language": "en"}, {"id": "399", "text": "hello
+ world", "language": "en"}, {"id": "400", "text": "hello world", "language":
+ "en"}, {"id": "401", "text": "hello world", "language": "en"}, {"id": "402",
+ "text": "hello world", "language": "en"}, {"id": "403", "text": "hello world",
+ "language": "en"}, {"id": "404", "text": "hello world", "language": "en"}, {"id":
+ "405", "text": "hello world", "language": "en"}, {"id": "406", "text": "hello
+ world", "language": "en"}, {"id": "407", "text": "hello world", "language":
+ "en"}, {"id": "408", "text": "hello world", "language": "en"}, {"id": "409",
+ "text": "hello world", "language": "en"}, {"id": "410", "text": "hello world",
+ "language": "en"}, {"id": "411", "text": "hello world", "language": "en"}, {"id":
+ "412", "text": "hello world", "language": "en"}, {"id": "413", "text": "hello
+ world", "language": "en"}, {"id": "414", "text": "hello world", "language":
+ "en"}, {"id": "415", "text": "hello world", "language": "en"}, {"id": "416",
+ "text": "hello world", "language": "en"}, {"id": "417", "text": "hello world",
+ "language": "en"}, {"id": "418", "text": "hello world", "language": "en"}, {"id":
+ "419", "text": "hello world", "language": "en"}, {"id": "420", "text": "hello
+ world", "language": "en"}, {"id": "421", "text": "hello world", "language":
+ "en"}, {"id": "422", "text": "hello world", "language": "en"}, {"id": "423",
+ "text": "hello world", "language": "en"}, {"id": "424", "text": "hello world",
+ "language": "en"}, {"id": "425", "text": "hello world", "language": "en"}, {"id":
+ "426", "text": "hello world", "language": "en"}, {"id": "427", "text": "hello
+ world", "language": "en"}, {"id": "428", "text": "hello world", "language":
+ "en"}, {"id": "429", "text": "hello world", "language": "en"}, {"id": "430",
+ "text": "hello world", "language": "en"}, {"id": "431", "text": "hello world",
+ "language": "en"}, {"id": "432", "text": "hello world", "language": "en"}, {"id":
+ "433", "text": "hello world", "language": "en"}, {"id": "434", "text": "hello
+ world", "language": "en"}, {"id": "435", "text": "hello world", "language":
+ "en"}, {"id": "436", "text": "hello world", "language": "en"}, {"id": "437",
+ "text": "hello world", "language": "en"}, {"id": "438", "text": "hello world",
+ "language": "en"}, {"id": "439", "text": "hello world", "language": "en"}, {"id":
+ "440", "text": "hello world", "language": "en"}, {"id": "441", "text": "hello
+ world", "language": "en"}, {"id": "442", "text": "hello world", "language":
+ "en"}, {"id": "443", "text": "hello world", "language": "en"}, {"id": "444",
+ "text": "hello world", "language": "en"}, {"id": "445", "text": "hello world",
+ "language": "en"}, {"id": "446", "text": "hello world", "language": "en"}, {"id":
+ "447", "text": "hello world", "language": "en"}, {"id": "448", "text": "hello
+ world", "language": "en"}, {"id": "449", "text": "hello world", "language":
+ "en"}, {"id": "450", "text": "hello world", "language": "en"}, {"id": "451",
+ "text": "hello world", "language": "en"}, {"id": "452", "text": "hello world",
+ "language": "en"}, {"id": "453", "text": "hello world", "language": "en"}, {"id":
+ "454", "text": "hello world", "language": "en"}, {"id": "455", "text": "hello
+ world", "language": "en"}, {"id": "456", "text": "hello world", "language":
+ "en"}, {"id": "457", "text": "hello world", "language": "en"}, {"id": "458",
+ "text": "hello world", "language": "en"}, {"id": "459", "text": "hello world",
+ "language": "en"}, {"id": "460", "text": "hello world", "language": "en"}, {"id":
+ "461", "text": "hello world", "language": "en"}, {"id": "462", "text": "hello
+ world", "language": "en"}, {"id": "463", "text": "hello world", "language":
+ "en"}, {"id": "464", "text": "hello world", "language": "en"}, {"id": "465",
+ "text": "hello world", "language": "en"}, {"id": "466", "text": "hello world",
+ "language": "en"}, {"id": "467", "text": "hello world", "language": "en"}, {"id":
+ "468", "text": "hello world", "language": "en"}, {"id": "469", "text": "hello
+ world", "language": "en"}, {"id": "470", "text": "hello world", "language":
+ "en"}, {"id": "471", "text": "hello world", "language": "en"}, {"id": "472",
+ "text": "hello world", "language": "en"}, {"id": "473", "text": "hello world",
+ "language": "en"}, {"id": "474", "text": "hello world", "language": "en"}, {"id":
+ "475", "text": "hello world", "language": "en"}, {"id": "476", "text": "hello
+ world", "language": "en"}, {"id": "477", "text": "hello world", "language":
+ "en"}, {"id": "478", "text": "hello world", "language": "en"}, {"id": "479",
+ "text": "hello world", "language": "en"}, {"id": "480", "text": "hello world",
+ "language": "en"}, {"id": "481", "text": "hello world", "language": "en"}, {"id":
+ "482", "text": "hello world", "language": "en"}, {"id": "483", "text": "hello
+ world", "language": "en"}, {"id": "484", "text": "hello world", "language":
+ "en"}, {"id": "485", "text": "hello world", "language": "en"}, {"id": "486",
+ "text": "hello world", "language": "en"}, {"id": "487", "text": "hello world",
+ "language": "en"}, {"id": "488", "text": "hello world", "language": "en"}, {"id":
+ "489", "text": "hello world", "language": "en"}, {"id": "490", "text": "hello
+ world", "language": "en"}, {"id": "491", "text": "hello world", "language":
+ "en"}, {"id": "492", "text": "hello world", "language": "en"}, {"id": "493",
+ "text": "hello world", "language": "en"}, {"id": "494", "text": "hello world",
+ "language": "en"}, {"id": "495", "text": "hello world", "language": "en"}, {"id":
+ "496", "text": "hello world", "language": "en"}, {"id": "497", "text": "hello
+ world", "language": "en"}, {"id": "498", "text": "hello world", "language":
+ "en"}, {"id": "499", "text": "hello world", "language": "en"}, {"id": "500",
+ "text": "hello world", "language": "en"}, {"id": "501", "text": "hello world",
+ "language": "en"}, {"id": "502", "text": "hello world", "language": "en"}, {"id":
+ "503", "text": "hello world", "language": "en"}, {"id": "504", "text": "hello
+ world", "language": "en"}, {"id": "505", "text": "hello world", "language":
+ "en"}, {"id": "506", "text": "hello world", "language": "en"}, {"id": "507",
+ "text": "hello world", "language": "en"}, {"id": "508", "text": "hello world",
+ "language": "en"}, {"id": "509", "text": "hello world", "language": "en"}, {"id":
+ "510", "text": "hello world", "language": "en"}, {"id": "511", "text": "hello
+ world", "language": "en"}, {"id": "512", "text": "hello world", "language":
+ "en"}, {"id": "513", "text": "hello world", "language": "en"}, {"id": "514",
+ "text": "hello world", "language": "en"}, {"id": "515", "text": "hello world",
+ "language": "en"}, {"id": "516", "text": "hello world", "language": "en"}, {"id":
+ "517", "text": "hello world", "language": "en"}, {"id": "518", "text": "hello
+ world", "language": "en"}, {"id": "519", "text": "hello world", "language":
+ "en"}, {"id": "520", "text": "hello world", "language": "en"}, {"id": "521",
+ "text": "hello world", "language": "en"}, {"id": "522", "text": "hello world",
+ "language": "en"}, {"id": "523", "text": "hello world", "language": "en"}, {"id":
+ "524", "text": "hello world", "language": "en"}, {"id": "525", "text": "hello
+ world", "language": "en"}, {"id": "526", "text": "hello world", "language":
+ "en"}, {"id": "527", "text": "hello world", "language": "en"}, {"id": "528",
+ "text": "hello world", "language": "en"}, {"id": "529", "text": "hello world",
+ "language": "en"}, {"id": "530", "text": "hello world", "language": "en"}, {"id":
+ "531", "text": "hello world", "language": "en"}, {"id": "532", "text": "hello
+ world", "language": "en"}, {"id": "533", "text": "hello world", "language":
+ "en"}, {"id": "534", "text": "hello world", "language": "en"}, {"id": "535",
+ "text": "hello world", "language": "en"}, {"id": "536", "text": "hello world",
+ "language": "en"}, {"id": "537", "text": "hello world", "language": "en"}, {"id":
+ "538", "text": "hello world", "language": "en"}, {"id": "539", "text": "hello
+ world", "language": "en"}, {"id": "540", "text": "hello world", "language":
+ "en"}, {"id": "541", "text": "hello world", "language": "en"}, {"id": "542",
+ "text": "hello world", "language": "en"}, {"id": "543", "text": "hello world",
+ "language": "en"}, {"id": "544", "text": "hello world", "language": "en"}, {"id":
+ "545", "text": "hello world", "language": "en"}, {"id": "546", "text": "hello
+ world", "language": "en"}, {"id": "547", "text": "hello world", "language":
+ "en"}, {"id": "548", "text": "hello world", "language": "en"}, {"id": "549",
+ "text": "hello world", "language": "en"}, {"id": "550", "text": "hello world",
+ "language": "en"}, {"id": "551", "text": "hello world", "language": "en"}, {"id":
+ "552", "text": "hello world", "language": "en"}, {"id": "553", "text": "hello
+ world", "language": "en"}, {"id": "554", "text": "hello world", "language":
+ "en"}, {"id": "555", "text": "hello world", "language": "en"}, {"id": "556",
+ "text": "hello world", "language": "en"}, {"id": "557", "text": "hello world",
+ "language": "en"}, {"id": "558", "text": "hello world", "language": "en"}, {"id":
+ "559", "text": "hello world", "language": "en"}, {"id": "560", "text": "hello
+ world", "language": "en"}, {"id": "561", "text": "hello world", "language":
+ "en"}, {"id": "562", "text": "hello world", "language": "en"}, {"id": "563",
+ "text": "hello world", "language": "en"}, {"id": "564", "text": "hello world",
+ "language": "en"}, {"id": "565", "text": "hello world", "language": "en"}, {"id":
+ "566", "text": "hello world", "language": "en"}, {"id": "567", "text": "hello
+ world", "language": "en"}, {"id": "568", "text": "hello world", "language":
+ "en"}, {"id": "569", "text": "hello world", "language": "en"}, {"id": "570",
+ "text": "hello world", "language": "en"}, {"id": "571", "text": "hello world",
+ "language": "en"}, {"id": "572", "text": "hello world", "language": "en"}, {"id":
+ "573", "text": "hello world", "language": "en"}, {"id": "574", "text": "hello
+ world", "language": "en"}, {"id": "575", "text": "hello world", "language":
+ "en"}, {"id": "576", "text": "hello world", "language": "en"}, {"id": "577",
+ "text": "hello world", "language": "en"}, {"id": "578", "text": "hello world",
+ "language": "en"}, {"id": "579", "text": "hello world", "language": "en"}, {"id":
+ "580", "text": "hello world", "language": "en"}, {"id": "581", "text": "hello
+ world", "language": "en"}, {"id": "582", "text": "hello world", "language":
+ "en"}, {"id": "583", "text": "hello world", "language": "en"}, {"id": "584",
+ "text": "hello world", "language": "en"}, {"id": "585", "text": "hello world",
+ "language": "en"}, {"id": "586", "text": "hello world", "language": "en"}, {"id":
+ "587", "text": "hello world", "language": "en"}, {"id": "588", "text": "hello
+ world", "language": "en"}, {"id": "589", "text": "hello world", "language":
+ "en"}, {"id": "590", "text": "hello world", "language": "en"}, {"id": "591",
+ "text": "hello world", "language": "en"}, {"id": "592", "text": "hello world",
+ "language": "en"}, {"id": "593", "text": "hello world", "language": "en"}, {"id":
+ "594", "text": "hello world", "language": "en"}, {"id": "595", "text": "hello
+ world", "language": "en"}, {"id": "596", "text": "hello world", "language":
+ "en"}, {"id": "597", "text": "hello world", "language": "en"}, {"id": "598",
+ "text": "hello world", "language": "en"}, {"id": "599", "text": "hello world",
+ "language": "en"}, {"id": "600", "text": "hello world", "language": "en"}, {"id":
+ "601", "text": "hello world", "language": "en"}, {"id": "602", "text": "hello
+ world", "language": "en"}, {"id": "603", "text": "hello world", "language":
+ "en"}, {"id": "604", "text": "hello world", "language": "en"}, {"id": "605",
+ "text": "hello world", "language": "en"}, {"id": "606", "text": "hello world",
+ "language": "en"}, {"id": "607", "text": "hello world", "language": "en"}, {"id":
+ "608", "text": "hello world", "language": "en"}, {"id": "609", "text": "hello
+ world", "language": "en"}, {"id": "610", "text": "hello world", "language":
+ "en"}, {"id": "611", "text": "hello world", "language": "en"}, {"id": "612",
+ "text": "hello world", "language": "en"}, {"id": "613", "text": "hello world",
+ "language": "en"}, {"id": "614", "text": "hello world", "language": "en"}, {"id":
+ "615", "text": "hello world", "language": "en"}, {"id": "616", "text": "hello
+ world", "language": "en"}, {"id": "617", "text": "hello world", "language":
+ "en"}, {"id": "618", "text": "hello world", "language": "en"}, {"id": "619",
+ "text": "hello world", "language": "en"}, {"id": "620", "text": "hello world",
+ "language": "en"}, {"id": "621", "text": "hello world", "language": "en"}, {"id":
+ "622", "text": "hello world", "language": "en"}, {"id": "623", "text": "hello
+ world", "language": "en"}, {"id": "624", "text": "hello world", "language":
+ "en"}, {"id": "625", "text": "hello world", "language": "en"}, {"id": "626",
+ "text": "hello world", "language": "en"}, {"id": "627", "text": "hello world",
+ "language": "en"}, {"id": "628", "text": "hello world", "language": "en"}, {"id":
+ "629", "text": "hello world", "language": "en"}, {"id": "630", "text": "hello
+ world", "language": "en"}, {"id": "631", "text": "hello world", "language":
+ "en"}, {"id": "632", "text": "hello world", "language": "en"}, {"id": "633",
+ "text": "hello world", "language": "en"}, {"id": "634", "text": "hello world",
+ "language": "en"}, {"id": "635", "text": "hello world", "language": "en"}, {"id":
+ "636", "text": "hello world", "language": "en"}, {"id": "637", "text": "hello
+ world", "language": "en"}, {"id": "638", "text": "hello world", "language":
+ "en"}, {"id": "639", "text": "hello world", "language": "en"}, {"id": "640",
+ "text": "hello world", "language": "en"}, {"id": "641", "text": "hello world",
+ "language": "en"}, {"id": "642", "text": "hello world", "language": "en"}, {"id":
+ "643", "text": "hello world", "language": "en"}, {"id": "644", "text": "hello
+ world", "language": "en"}, {"id": "645", "text": "hello world", "language":
+ "en"}, {"id": "646", "text": "hello world", "language": "en"}, {"id": "647",
+ "text": "hello world", "language": "en"}, {"id": "648", "text": "hello world",
+ "language": "en"}, {"id": "649", "text": "hello world", "language": "en"}, {"id":
+ "650", "text": "hello world", "language": "en"}, {"id": "651", "text": "hello
+ world", "language": "en"}, {"id": "652", "text": "hello world", "language":
+ "en"}, {"id": "653", "text": "hello world", "language": "en"}, {"id": "654",
+ "text": "hello world", "language": "en"}, {"id": "655", "text": "hello world",
+ "language": "en"}, {"id": "656", "text": "hello world", "language": "en"}, {"id":
+ "657", "text": "hello world", "language": "en"}, {"id": "658", "text": "hello
+ world", "language": "en"}, {"id": "659", "text": "hello world", "language":
+ "en"}, {"id": "660", "text": "hello world", "language": "en"}, {"id": "661",
+ "text": "hello world", "language": "en"}, {"id": "662", "text": "hello world",
+ "language": "en"}, {"id": "663", "text": "hello world", "language": "en"}, {"id":
+ "664", "text": "hello world", "language": "en"}, {"id": "665", "text": "hello
+ world", "language": "en"}, {"id": "666", "text": "hello world", "language":
+ "en"}, {"id": "667", "text": "hello world", "language": "en"}, {"id": "668",
+ "text": "hello world", "language": "en"}, {"id": "669", "text": "hello world",
+ "language": "en"}, {"id": "670", "text": "hello world", "language": "en"}, {"id":
+ "671", "text": "hello world", "language": "en"}, {"id": "672", "text": "hello
+ world", "language": "en"}, {"id": "673", "text": "hello world", "language":
+ "en"}, {"id": "674", "text": "hello world", "language": "en"}, {"id": "675",
+ "text": "hello world", "language": "en"}, {"id": "676", "text": "hello world",
+ "language": "en"}, {"id": "677", "text": "hello world", "language": "en"}, {"id":
+ "678", "text": "hello world", "language": "en"}, {"id": "679", "text": "hello
+ world", "language": "en"}, {"id": "680", "text": "hello world", "language":
+ "en"}, {"id": "681", "text": "hello world", "language": "en"}, {"id": "682",
+ "text": "hello world", "language": "en"}, {"id": "683", "text": "hello world",
+ "language": "en"}, {"id": "684", "text": "hello world", "language": "en"}, {"id":
+ "685", "text": "hello world", "language": "en"}, {"id": "686", "text": "hello
+ world", "language": "en"}, {"id": "687", "text": "hello world", "language":
+ "en"}, {"id": "688", "text": "hello world", "language": "en"}, {"id": "689",
+ "text": "hello world", "language": "en"}, {"id": "690", "text": "hello world",
+ "language": "en"}, {"id": "691", "text": "hello world", "language": "en"}, {"id":
+ "692", "text": "hello world", "language": "en"}, {"id": "693", "text": "hello
+ world", "language": "en"}, {"id": "694", "text": "hello world", "language":
+ "en"}, {"id": "695", "text": "hello world", "language": "en"}, {"id": "696",
+ "text": "hello world", "language": "en"}, {"id": "697", "text": "hello world",
+ "language": "en"}, {"id": "698", "text": "hello world", "language": "en"}, {"id":
+ "699", "text": "hello world", "language": "en"}, {"id": "700", "text": "hello
+ world", "language": "en"}, {"id": "701", "text": "hello world", "language":
+ "en"}, {"id": "702", "text": "hello world", "language": "en"}, {"id": "703",
+ "text": "hello world", "language": "en"}, {"id": "704", "text": "hello world",
+ "language": "en"}, {"id": "705", "text": "hello world", "language": "en"}, {"id":
+ "706", "text": "hello world", "language": "en"}, {"id": "707", "text": "hello
+ world", "language": "en"}, {"id": "708", "text": "hello world", "language":
+ "en"}, {"id": "709", "text": "hello world", "language": "en"}, {"id": "710",
+ "text": "hello world", "language": "en"}, {"id": "711", "text": "hello world",
+ "language": "en"}, {"id": "712", "text": "hello world", "language": "en"}, {"id":
+ "713", "text": "hello world", "language": "en"}, {"id": "714", "text": "hello
+ world", "language": "en"}, {"id": "715", "text": "hello world", "language":
+ "en"}, {"id": "716", "text": "hello world", "language": "en"}, {"id": "717",
+ "text": "hello world", "language": "en"}, {"id": "718", "text": "hello world",
+ "language": "en"}, {"id": "719", "text": "hello world", "language": "en"}, {"id":
+ "720", "text": "hello world", "language": "en"}, {"id": "721", "text": "hello
+ world", "language": "en"}, {"id": "722", "text": "hello world", "language":
+ "en"}, {"id": "723", "text": "hello world", "language": "en"}, {"id": "724",
+ "text": "hello world", "language": "en"}, {"id": "725", "text": "hello world",
+ "language": "en"}, {"id": "726", "text": "hello world", "language": "en"}, {"id":
+ "727", "text": "hello world", "language": "en"}, {"id": "728", "text": "hello
+ world", "language": "en"}, {"id": "729", "text": "hello world", "language":
+ "en"}, {"id": "730", "text": "hello world", "language": "en"}, {"id": "731",
+ "text": "hello world", "language": "en"}, {"id": "732", "text": "hello world",
+ "language": "en"}, {"id": "733", "text": "hello world", "language": "en"}, {"id":
+ "734", "text": "hello world", "language": "en"}, {"id": "735", "text": "hello
+ world", "language": "en"}, {"id": "736", "text": "hello world", "language":
+ "en"}, {"id": "737", "text": "hello world", "language": "en"}, {"id": "738",
+ "text": "hello world", "language": "en"}, {"id": "739", "text": "hello world",
+ "language": "en"}, {"id": "740", "text": "hello world", "language": "en"}, {"id":
+ "741", "text": "hello world", "language": "en"}, {"id": "742", "text": "hello
+ world", "language": "en"}, {"id": "743", "text": "hello world", "language":
+ "en"}, {"id": "744", "text": "hello world", "language": "en"}, {"id": "745",
+ "text": "hello world", "language": "en"}, {"id": "746", "text": "hello world",
+ "language": "en"}, {"id": "747", "text": "hello world", "language": "en"}, {"id":
+ "748", "text": "hello world", "language": "en"}, {"id": "749", "text": "hello
+ world", "language": "en"}, {"id": "750", "text": "hello world", "language":
+ "en"}, {"id": "751", "text": "hello world", "language": "en"}, {"id": "752",
+ "text": "hello world", "language": "en"}, {"id": "753", "text": "hello world",
+ "language": "en"}, {"id": "754", "text": "hello world", "language": "en"}, {"id":
+ "755", "text": "hello world", "language": "en"}, {"id": "756", "text": "hello
+ world", "language": "en"}, {"id": "757", "text": "hello world", "language":
+ "en"}, {"id": "758", "text": "hello world", "language": "en"}, {"id": "759",
+ "text": "hello world", "language": "en"}, {"id": "760", "text": "hello world",
+ "language": "en"}, {"id": "761", "text": "hello world", "language": "en"}, {"id":
+ "762", "text": "hello world", "language": "en"}, {"id": "763", "text": "hello
+ world", "language": "en"}, {"id": "764", "text": "hello world", "language":
+ "en"}, {"id": "765", "text": "hello world", "language": "en"}, {"id": "766",
+ "text": "hello world", "language": "en"}, {"id": "767", "text": "hello world",
+ "language": "en"}, {"id": "768", "text": "hello world", "language": "en"}, {"id":
+ "769", "text": "hello world", "language": "en"}, {"id": "770", "text": "hello
+ world", "language": "en"}, {"id": "771", "text": "hello world", "language":
+ "en"}, {"id": "772", "text": "hello world", "language": "en"}, {"id": "773",
+ "text": "hello world", "language": "en"}, {"id": "774", "text": "hello world",
+ "language": "en"}, {"id": "775", "text": "hello world", "language": "en"}, {"id":
+ "776", "text": "hello world", "language": "en"}, {"id": "777", "text": "hello
+ world", "language": "en"}, {"id": "778", "text": "hello world", "language":
+ "en"}, {"id": "779", "text": "hello world", "language": "en"}, {"id": "780",
+ "text": "hello world", "language": "en"}, {"id": "781", "text": "hello world",
+ "language": "en"}, {"id": "782", "text": "hello world", "language": "en"}, {"id":
+ "783", "text": "hello world", "language": "en"}, {"id": "784", "text": "hello
+ world", "language": "en"}, {"id": "785", "text": "hello world", "language":
+ "en"}, {"id": "786", "text": "hello world", "language": "en"}, {"id": "787",
+ "text": "hello world", "language": "en"}, {"id": "788", "text": "hello world",
+ "language": "en"}, {"id": "789", "text": "hello world", "language": "en"}, {"id":
+ "790", "text": "hello world", "language": "en"}, {"id": "791", "text": "hello
+ world", "language": "en"}, {"id": "792", "text": "hello world", "language":
+ "en"}, {"id": "793", "text": "hello world", "language": "en"}, {"id": "794",
+ "text": "hello world", "language": "en"}, {"id": "795", "text": "hello world",
+ "language": "en"}, {"id": "796", "text": "hello world", "language": "en"}, {"id":
+ "797", "text": "hello world", "language": "en"}, {"id": "798", "text": "hello
+ world", "language": "en"}, {"id": "799", "text": "hello world", "language":
+ "en"}, {"id": "800", "text": "hello world", "language": "en"}, {"id": "801",
+ "text": "hello world", "language": "en"}, {"id": "802", "text": "hello world",
+ "language": "en"}, {"id": "803", "text": "hello world", "language": "en"}, {"id":
+ "804", "text": "hello world", "language": "en"}, {"id": "805", "text": "hello
+ world", "language": "en"}, {"id": "806", "text": "hello world", "language":
+ "en"}, {"id": "807", "text": "hello world", "language": "en"}, {"id": "808",
+ "text": "hello world", "language": "en"}, {"id": "809", "text": "hello world",
+ "language": "en"}, {"id": "810", "text": "hello world", "language": "en"}, {"id":
+ "811", "text": "hello world", "language": "en"}, {"id": "812", "text": "hello
+ world", "language": "en"}, {"id": "813", "text": "hello world", "language":
+ "en"}, {"id": "814", "text": "hello world", "language": "en"}, {"id": "815",
+ "text": "hello world", "language": "en"}, {"id": "816", "text": "hello world",
+ "language": "en"}, {"id": "817", "text": "hello world", "language": "en"}, {"id":
+ "818", "text": "hello world", "language": "en"}, {"id": "819", "text": "hello
+ world", "language": "en"}, {"id": "820", "text": "hello world", "language":
+ "en"}, {"id": "821", "text": "hello world", "language": "en"}, {"id": "822",
+ "text": "hello world", "language": "en"}, {"id": "823", "text": "hello world",
+ "language": "en"}, {"id": "824", "text": "hello world", "language": "en"}, {"id":
+ "825", "text": "hello world", "language": "en"}, {"id": "826", "text": "hello
+ world", "language": "en"}, {"id": "827", "text": "hello world", "language":
+ "en"}, {"id": "828", "text": "hello world", "language": "en"}, {"id": "829",
+ "text": "hello world", "language": "en"}, {"id": "830", "text": "hello world",
+ "language": "en"}, {"id": "831", "text": "hello world", "language": "en"}, {"id":
+ "832", "text": "hello world", "language": "en"}, {"id": "833", "text": "hello
+ world", "language": "en"}, {"id": "834", "text": "hello world", "language":
+ "en"}, {"id": "835", "text": "hello world", "language": "en"}, {"id": "836",
+ "text": "hello world", "language": "en"}, {"id": "837", "text": "hello world",
+ "language": "en"}, {"id": "838", "text": "hello world", "language": "en"}, {"id":
+ "839", "text": "hello world", "language": "en"}, {"id": "840", "text": "hello
+ world", "language": "en"}, {"id": "841", "text": "hello world", "language":
+ "en"}, {"id": "842", "text": "hello world", "language": "en"}, {"id": "843",
+ "text": "hello world", "language": "en"}, {"id": "844", "text": "hello world",
+ "language": "en"}, {"id": "845", "text": "hello world", "language": "en"}, {"id":
+ "846", "text": "hello world", "language": "en"}, {"id": "847", "text": "hello
+ world", "language": "en"}, {"id": "848", "text": "hello world", "language":
+ "en"}, {"id": "849", "text": "hello world", "language": "en"}, {"id": "850",
+ "text": "hello world", "language": "en"}, {"id": "851", "text": "hello world",
+ "language": "en"}, {"id": "852", "text": "hello world", "language": "en"}, {"id":
+ "853", "text": "hello world", "language": "en"}, {"id": "854", "text": "hello
+ world", "language": "en"}, {"id": "855", "text": "hello world", "language":
+ "en"}, {"id": "856", "text": "hello world", "language": "en"}, {"id": "857",
+ "text": "hello world", "language": "en"}, {"id": "858", "text": "hello world",
+ "language": "en"}, {"id": "859", "text": "hello world", "language": "en"}, {"id":
+ "860", "text": "hello world", "language": "en"}, {"id": "861", "text": "hello
+ world", "language": "en"}, {"id": "862", "text": "hello world", "language":
+ "en"}, {"id": "863", "text": "hello world", "language": "en"}, {"id": "864",
+ "text": "hello world", "language": "en"}, {"id": "865", "text": "hello world",
+ "language": "en"}, {"id": "866", "text": "hello world", "language": "en"}, {"id":
+ "867", "text": "hello world", "language": "en"}, {"id": "868", "text": "hello
+ world", "language": "en"}, {"id": "869", "text": "hello world", "language":
+ "en"}, {"id": "870", "text": "hello world", "language": "en"}, {"id": "871",
+ "text": "hello world", "language": "en"}, {"id": "872", "text": "hello world",
+ "language": "en"}, {"id": "873", "text": "hello world", "language": "en"}, {"id":
+ "874", "text": "hello world", "language": "en"}, {"id": "875", "text": "hello
+ world", "language": "en"}, {"id": "876", "text": "hello world", "language":
+ "en"}, {"id": "877", "text": "hello world", "language": "en"}, {"id": "878",
+ "text": "hello world", "language": "en"}, {"id": "879", "text": "hello world",
+ "language": "en"}, {"id": "880", "text": "hello world", "language": "en"}, {"id":
+ "881", "text": "hello world", "language": "en"}, {"id": "882", "text": "hello
+ world", "language": "en"}, {"id": "883", "text": "hello world", "language":
+ "en"}, {"id": "884", "text": "hello world", "language": "en"}, {"id": "885",
+ "text": "hello world", "language": "en"}, {"id": "886", "text": "hello world",
+ "language": "en"}, {"id": "887", "text": "hello world", "language": "en"}, {"id":
+ "888", "text": "hello world", "language": "en"}, {"id": "889", "text": "hello
+ world", "language": "en"}, {"id": "890", "text": "hello world", "language":
+ "en"}, {"id": "891", "text": "hello world", "language": "en"}, {"id": "892",
+ "text": "hello world", "language": "en"}, {"id": "893", "text": "hello world",
+ "language": "en"}, {"id": "894", "text": "hello world", "language": "en"}, {"id":
+ "895", "text": "hello world", "language": "en"}, {"id": "896", "text": "hello
+ world", "language": "en"}, {"id": "897", "text": "hello world", "language":
+ "en"}, {"id": "898", "text": "hello world", "language": "en"}, {"id": "899",
+ "text": "hello world", "language": "en"}, {"id": "900", "text": "hello world",
+ "language": "en"}, {"id": "901", "text": "hello world", "language": "en"}, {"id":
+ "902", "text": "hello world", "language": "en"}, {"id": "903", "text": "hello
+ world", "language": "en"}, {"id": "904", "text": "hello world", "language":
+ "en"}, {"id": "905", "text": "hello world", "language": "en"}, {"id": "906",
+ "text": "hello world", "language": "en"}, {"id": "907", "text": "hello world",
+ "language": "en"}, {"id": "908", "text": "hello world", "language": "en"}, {"id":
+ "909", "text": "hello world", "language": "en"}, {"id": "910", "text": "hello
+ world", "language": "en"}, {"id": "911", "text": "hello world", "language":
+ "en"}, {"id": "912", "text": "hello world", "language": "en"}, {"id": "913",
+ "text": "hello world", "language": "en"}, {"id": "914", "text": "hello world",
+ "language": "en"}, {"id": "915", "text": "hello world", "language": "en"}, {"id":
+ "916", "text": "hello world", "language": "en"}, {"id": "917", "text": "hello
+ world", "language": "en"}, {"id": "918", "text": "hello world", "language":
+ "en"}, {"id": "919", "text": "hello world", "language": "en"}, {"id": "920",
+ "text": "hello world", "language": "en"}, {"id": "921", "text": "hello world",
+ "language": "en"}, {"id": "922", "text": "hello world", "language": "en"}, {"id":
+ "923", "text": "hello world", "language": "en"}, {"id": "924", "text": "hello
+ world", "language": "en"}, {"id": "925", "text": "hello world", "language":
+ "en"}, {"id": "926", "text": "hello world", "language": "en"}, {"id": "927",
+ "text": "hello world", "language": "en"}, {"id": "928", "text": "hello world",
+ "language": "en"}, {"id": "929", "text": "hello world", "language": "en"}, {"id":
+ "930", "text": "hello world", "language": "en"}, {"id": "931", "text": "hello
+ world", "language": "en"}, {"id": "932", "text": "hello world", "language":
+ "en"}, {"id": "933", "text": "hello world", "language": "en"}, {"id": "934",
+ "text": "hello world", "language": "en"}, {"id": "935", "text": "hello world",
+ "language": "en"}, {"id": "936", "text": "hello world", "language": "en"}, {"id":
+ "937", "text": "hello world", "language": "en"}, {"id": "938", "text": "hello
+ world", "language": "en"}, {"id": "939", "text": "hello world", "language":
+ "en"}, {"id": "940", "text": "hello world", "language": "en"}, {"id": "941",
+ "text": "hello world", "language": "en"}, {"id": "942", "text": "hello world",
+ "language": "en"}, {"id": "943", "text": "hello world", "language": "en"}, {"id":
+ "944", "text": "hello world", "language": "en"}, {"id": "945", "text": "hello
+ world", "language": "en"}, {"id": "946", "text": "hello world", "language":
+ "en"}, {"id": "947", "text": "hello world", "language": "en"}, {"id": "948",
+ "text": "hello world", "language": "en"}, {"id": "949", "text": "hello world",
+ "language": "en"}, {"id": "950", "text": "hello world", "language": "en"}, {"id":
+ "951", "text": "hello world", "language": "en"}, {"id": "952", "text": "hello
+ world", "language": "en"}, {"id": "953", "text": "hello world", "language":
+ "en"}, {"id": "954", "text": "hello world", "language": "en"}, {"id": "955",
+ "text": "hello world", "language": "en"}, {"id": "956", "text": "hello world",
+ "language": "en"}, {"id": "957", "text": "hello world", "language": "en"}, {"id":
+ "958", "text": "hello world", "language": "en"}, {"id": "959", "text": "hello
+ world", "language": "en"}, {"id": "960", "text": "hello world", "language":
+ "en"}, {"id": "961", "text": "hello world", "language": "en"}, {"id": "962",
+ "text": "hello world", "language": "en"}, {"id": "963", "text": "hello world",
+ "language": "en"}, {"id": "964", "text": "hello world", "language": "en"}, {"id":
+ "965", "text": "hello world", "language": "en"}, {"id": "966", "text": "hello
+ world", "language": "en"}, {"id": "967", "text": "hello world", "language":
+ "en"}, {"id": "968", "text": "hello world", "language": "en"}, {"id": "969",
+ "text": "hello world", "language": "en"}, {"id": "970", "text": "hello world",
+ "language": "en"}, {"id": "971", "text": "hello world", "language": "en"}, {"id":
+ "972", "text": "hello world", "language": "en"}, {"id": "973", "text": "hello
+ world", "language": "en"}, {"id": "974", "text": "hello world", "language":
+ "en"}, {"id": "975", "text": "hello world", "language": "en"}, {"id": "976",
+ "text": "hello world", "language": "en"}, {"id": "977", "text": "hello world",
+ "language": "en"}, {"id": "978", "text": "hello world", "language": "en"}, {"id":
+ "979", "text": "hello world", "language": "en"}, {"id": "980", "text": "hello
+ world", "language": "en"}, {"id": "981", "text": "hello world", "language":
+ "en"}, {"id": "982", "text": "hello world", "language": "en"}, {"id": "983",
+ "text": "hello world", "language": "en"}, {"id": "984", "text": "hello world",
+ "language": "en"}, {"id": "985", "text": "hello world", "language": "en"}, {"id":
+ "986", "text": "hello world", "language": "en"}, {"id": "987", "text": "hello
+ world", "language": "en"}, {"id": "988", "text": "hello world", "language":
+ "en"}, {"id": "989", "text": "hello world", "language": "en"}, {"id": "990",
+ "text": "hello world", "language": "en"}, {"id": "991", "text": "hello world",
+ "language": "en"}, {"id": "992", "text": "hello world", "language": "en"}, {"id":
+ "993", "text": "hello world", "language": "en"}, {"id": "994", "text": "hello
+ world", "language": "en"}, {"id": "995", "text": "hello world", "language":
+ "en"}, {"id": "996", "text": "hello world", "language": "en"}, {"id": "997",
+ "text": "hello world", "language": "en"}, {"id": "998", "text": "hello world",
+ "language": "en"}, {"id": "999", "text": "hello world", "language": "en"}, {"id":
+ "1000", "text": "hello world", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '55962'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch
+ request contains too many records. Max 1000 records are permitted."}}}'
+ headers:
+ apim-request-id: aa9589a7-7057-4899-8853-64e9a9a4588e
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:47 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '10'
+ status:
+ code: 400
+ message: Bad Request
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_client_passed_default_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_client_passed_default_language_hint.yaml
new file mode 100644
index 000000000000..5669a1da3adb
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_client_passed_default_language_hint.yaml
@@ -0,0 +1,108 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "es"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "es"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 63a32671-e4f1-4ecf-b8dd-5c58051ebda9
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:47 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '2'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 272a4c80-6b40-476f-9d05-701c2a54ea72
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:47 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '92'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "es"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "es"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: f344bd29-a1d2-4109-8499-fc1817740a61
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:47 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '2'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_attribute_error_no_result_attribute.yaml
new file mode 100644
index 000000000000..8fe2598fc88b
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_attribute_error_no_result_attribute.yaml
@@ -0,0 +1,32 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '58'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 2d1f109a-17ed-4b83-b1aa-ee11406f4c72
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:48 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '2'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_attribute_error_nonexistent_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
new file mode 100644
index 000000000000..032e12b2f14b
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_attribute_error_nonexistent_attribute.yaml
@@ -0,0 +1,32 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '58'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: f363c9a3-910b-4437-95f5-b3bfb7d1038c
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:48 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '2'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_errors.yaml
new file mode 100644
index 000000000000..ca234b3ee88c
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_errors.yaml
@@ -0,0 +1,41 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "", "language": "en"}, {"id": "2", "text":
+ "I did not like the hotel we stayed at.", "language": "english"}, {"id": "3",
+ "text": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+ "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '5308'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"A
+ document within the request was too large to be processed. Limit document
+ size to: 5120 text elements. For additional details on the data limitations
+ see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: f7e35a3b-dfe2-494c-82b7-f3ab5759b8c3
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:49 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '4'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_warnings.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_warnings.yaml
new file mode 100644
index 000000000000..164878ac9be1
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_document_warnings.yaml
@@ -0,0 +1,32 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "This won''t actually create a warning
+ :''(", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '98'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: c4071053-3e6e-4bfa-bc65-6a85f13e053f
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
+ date: Thu, 23 Jul 2020 17:19:49 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '79'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_duplicate_ids_error.yaml
new file mode 100644
index 000000000000..b5208e4b463e
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_duplicate_ids_error.yaml
@@ -0,0 +1,32 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "hello world", "language": "en"}, {"id":
+ "1", "text": "I did not like the hotel we stayed at.", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '150'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request
+ contains duplicated Ids. Make sure each document has a unique Id."}}}'
+ headers:
+ apim-request-id: eb8ac9bb-71d3-4895-925d-be0bd9e70da7
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:50 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '5'
+ status:
+ code: 400
+ message: Bad Request
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_empty_credential_class.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_empty_credential_class.yaml
new file mode 100644
index 000000000000..0fcb79963484
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_empty_credential_class.yaml
@@ -0,0 +1,28 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This is written in English.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '85'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
+ key or wrong API endpoint. Make sure to provide a valid key for an active
+ subscription and use a correct regional API endpoint for your resource."}}'
+ headers:
+ content-length: '224'
+ date: Thu, 23 Jul 2020 17:19:49 GMT
+ status:
+ code: 401
+ message: PermissionDenied
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_input_with_all_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_input_with_all_errors.yaml
new file mode 100644
index 000000000000..0bbd383679e5
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_input_with_all_errors.yaml
@@ -0,0 +1,37 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "", "language": "en"}, {"id": "2", "text":
+ "Hola", "language": "Spanish"}, {"id": "3", "text": "", "language": "de"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '153'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 04aae24c-cda5-46df-82d8-d00ce1b997e0
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:50 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '2'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_input_with_some_errors.yaml
new file mode 100644
index 000000000000..a1bd4c36a655
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_input_with_some_errors.yaml
@@ -0,0 +1,38 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "hola", "language": "es"}, {"id": "2",
+ "text": "", "language": "en"}, {"id": "3", "text": "Is 998.214.865-68 your Brazilian
+ CPF number?", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '192'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"3","entities":[{"text":"998.214.865-68","category":"Brazil
+ CPF Number","offset":3,"length":14,"confidenceScore":0.85}],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: b41905c9-2f2d-40ee-821e-2482d4882b61
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
+ date: Thu, 23 Jul 2020 17:19:50 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '79'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_invalid_language_hint_docs.yaml
new file mode 100644
index 000000000000..07bf4a04c6db
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_invalid_language_hint_docs.yaml
@@ -0,0 +1,33 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "This should fail because we''re passing
+ in an invalid language hint", "language": "notalanguage"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '134'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: a77e3fea-6c23-477f-8a72-3885cb74e89f
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:51 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '2'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_invalid_language_hint_method.yaml
new file mode 100644
index 000000000000..ab4b47342a6b
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_invalid_language_hint_method.yaml
@@ -0,0 +1,33 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This should fail because we''re passing
+ in an invalid language hint", "language": "notalanguage"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '134'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 439917d9-3122-42b3-923f-f45d5927a520
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:51 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '2'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_language_kwarg_english.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_language_kwarg_english.yaml
new file mode 100644
index 000000000000..4c931318f80b
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_language_kwarg_english.yaml
@@ -0,0 +1,33 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "Bill Gates is the CEO of Microsoft.",
+ "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '93'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=latest&showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":1,"validDocumentsCount":1,"erroneousDocumentsCount":0,"transactionsCount":1},"documents":[{"id":"0","statistics":{"charactersCount":35,"transactionsCount":1},"entities":[{"text":"Bill
+ Gates","category":"Person","offset":0,"length":10,"confidenceScore":0.81},{"text":"Microsoft","category":"Organization","offset":25,"length":9,"confidenceScore":0.64}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: e612f043-5b57-4974-ac8f-8eaca05cdffe
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
+ date: Thu, 23 Jul 2020 17:19:52 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '72'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=latest&showStats=true
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_length_with_emoji.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_length_with_emoji.yaml
new file mode 100644
index 000000000000..0b6ee9b2eff7
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_length_with_emoji.yaml
@@ -0,0 +1,33 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "\ud83d\udc69 SSN: 123-12-1234", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '87'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"0","entities":[{"text":"123-12-1234","category":"U.S.
+ Social Security Number (SSN)","offset":7,"length":11,"confidenceScore":0.85}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: d85eded0-4738-4ad8-a913-eec883d4d280
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
+ date: Thu, 23 Jul 2020 17:19:52 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '71'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_out_of_order_ids.yaml
new file mode 100644
index 000000000000..8854aaac4d1a
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_out_of_order_ids.yaml
@@ -0,0 +1,36 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "56", "text": ":)", "language": "en"}, {"id": "0",
+ "text": ":(", "language": "en"}, {"id": "22", "text": "", "language": "en"},
+ {"id": "19", "text": ":P", "language": "en"}, {"id": "1", "text": ":D", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '241'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"56","entities":[],"warnings":[]},{"id":"0","entities":[],"warnings":[]},{"id":"19","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: d2c34707-fd54-46d1-afcb-6428d916171f
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
+ date: Thu, 23 Jul 2020 17:19:52 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '65'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_output_same_order_as_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_output_same_order_as_input.yaml
new file mode 100644
index 000000000000..5f4753385eab
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_output_same_order_as_input.yaml
@@ -0,0 +1,34 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "one", "language": "en"}, {"id": "2",
+ "text": "two", "language": "en"}, {"id": "3", "text": "three", "language": "en"},
+ {"id": "4", "text": "four", "language": "en"}, {"id": "5", "text": "five", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '249'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"5","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 10d501bf-1bf5-48be-85bd-818a8a4d6bb3
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=5
+ date: Thu, 23 Jul 2020 17:19:53 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '75'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_pass_cls.yaml
new file mode 100644
index 000000000000..61672923a812
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_pass_cls.yaml
@@ -0,0 +1,32 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "Test passing cls to endpoint", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '86'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 6ab92cde-4042-45d2-913b-d6dad6184a02
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
+ date: Thu, 23 Jul 2020 17:19:53 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '67'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_passing_only_string.yaml
new file mode 100644
index 000000000000..49919db5c1a5
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_passing_only_string.yaml
@@ -0,0 +1,41 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "My SSN is 859-98-0987.", "language":
+ "en"}, {"id": "1", "text": "Your ABA number - 111000025 - is the first 9 digits
+ in the lower left hand corner of your personal check.", "language": "en"}, {"id":
+ "2", "text": "Is 998.214.865-68 your Brazilian CPF number?", "language": "en"},
+ {"id": "3", "text": "", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '358'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":4,"validDocumentsCount":3,"erroneousDocumentsCount":1,"transactionsCount":3},"documents":[{"id":"0","statistics":{"charactersCount":22,"transactionsCount":1},"entities":[{"text":"859-98-0987","category":"U.S.
+ Social Security Number (SSN)","offset":10,"length":11,"confidenceScore":0.65}],"warnings":[]},{"id":"1","statistics":{"charactersCount":105,"transactionsCount":1},"entities":[{"text":"111000025","category":"Phone
+ Number","offset":18,"length":9,"confidenceScore":0.8},{"text":"111000025","category":"ABA
+ Routing Number","offset":18,"length":9,"confidenceScore":0.75}],"warnings":[]},{"id":"2","statistics":{"charactersCount":44,"transactionsCount":1},"entities":[{"text":"998.214.865-68","category":"Brazil
+ CPF Number","offset":3,"length":14,"confidenceScore":0.85}],"warnings":[]}],"errors":[{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 21f124c4-b892-42b9-be5e-3a0e28bc5a7b
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:54 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '138'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=true
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_per_item_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_per_item_dont_use_language_hint.yaml
new file mode 100644
index 000000000000..41c33df290da
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_per_item_dont_use_language_hint.yaml
@@ -0,0 +1,34 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ ""}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ ""}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '236'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 6fa308e2-4146-49ac-8ce0-0a2e16abfe4b
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:55 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '76'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_rotate_subscription_key.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_rotate_subscription_key.yaml
new file mode 100644
index 000000000000..7240fb83ad83
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_rotate_subscription_key.yaml
@@ -0,0 +1,94 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: e2afbde5-c8c3-449e-a0e2-bb5614441303
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:54 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '89'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"error":{"code":"401","message":"Access denied due to invalid subscription
+ key or wrong API endpoint. Make sure to provide a valid key for an active
+ subscription and use a correct regional API endpoint for your resource."}}'
+ headers:
+ content-length: '224'
+ date: Thu, 23 Jul 2020 17:19:54 GMT
+ status:
+ code: 401
+ message: PermissionDenied
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 2b14ce51-9676-4d12-9b44-097d78573dfb
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:55 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '93'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_show_stats_and_model_version.yaml
new file mode 100644
index 000000000000..84d162bbfe7c
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_show_stats_and_model_version.yaml
@@ -0,0 +1,36 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "56", "text": ":)", "language": "en"}, {"id": "0",
+ "text": ":(", "language": "en"}, {"id": "22", "text": "", "language": "en"},
+ {"id": "19", "text": ":P", "language": "en"}, {"id": "1", "text": ":D", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '241'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=latest&showStats=true
+ response:
+ body:
+ string: '{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid
+ document in request.","innererror":{"code":"InvalidDocument","message":"Document
+ text is empty."}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 78db8b35-0650-43b1-a905-2cd921c8d718
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=4
+ date: Thu, 23 Jul 2020 17:19:55 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '66'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?model-version=latest&showStats=true
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_too_many_documents.yaml
new file mode 100644
index 000000000000..43a8e7242ceb
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_too_many_documents.yaml
@@ -0,0 +1,37 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "One", "language": "en"}, {"id": "1",
+ "text": "Two", "language": "en"}, {"id": "2", "text": "Three", "language": "en"},
+ {"id": "3", "text": "Four", "language": "en"}, {"id": "4", "text": "Five", "language":
+ "en"}, {"id": "5", "text": "Six", "language": "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '295'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]},{"id":"4","entities":[],"warnings":[]},{"id":"5","entities":[],"warnings":[]}],"errors":[{"id":"","error":{"code":"InvalidRequest","message":"The
+ request has exceeded the allowed document limits.","innererror":{"code":"InvalidDocumentBatch","message":"The
+ number of documents in the request have exceeded the data limitations. See
+ https://aka.ms/text-analytics-data-limits for additional information"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 66c2a87a-f154-4c39-b802-7b8d814ff3f9
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=6
+ date: Thu, 23 Jul 2020 17:19:55 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '74'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_user_agent.yaml
new file mode 100644
index 000000000000..d8f59385c858
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_user_agent.yaml
@@ -0,0 +1,34 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "en"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "en"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]},{"id":"3","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 0893dd3a-bf7e-41d4-bcab-e428b9b5d47d
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:57 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '83'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_dont_use_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_dont_use_language_hint.yaml
new file mode 100644
index 000000000000..621a498dac4e
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_dont_use_language_hint.yaml
@@ -0,0 +1,34 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This was the best day of my life.",
+ "language": ""}, {"id": "1", "text": "I did not like the hotel we stayed at.
+ It was too expensive.", "language": ""}, {"id": "2", "text": "The restaurant
+ was not as good as I hoped.", "language": ""}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '273'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"0","entities":[],"warnings":[]},{"id":"1","entities":[],"warnings":[]},{"id":"2","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 5bb21583-5cc7-4ab1-a81e-b7fcf1236fad
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=3
+ date: Thu, 23 Jul 2020 17:19:58 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '131'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint.yaml
new file mode 100644
index 000000000000..afb081801c19
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint.yaml
@@ -0,0 +1,39 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "0", "text": "This was the best day of my life.",
+ "language": "fr"}, {"id": "1", "text": "I did not like the hotel we stayed at.
+ It was too expensive.", "language": "fr"}, {"id": "2", "text": "The restaurant
+ was not as good as I hoped.", "language": "fr"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '279'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: e8eae430-8838-4fda-9dd5-ae283cbdd325
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:58 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '3'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
new file mode 100644
index 000000000000..57c8e5b5bf65
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_dict_per_item_hints.yaml
@@ -0,0 +1,38 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I will go to the park.", "language":
+ "es"}, {"id": "2", "text": "I did not like the hotel we stayed at.", "language":
+ "es"}, {"id": "3", "text": "The restaurant had really good food.", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '240'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"3","entities":[],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 79b03f0e-bebb-4096-8010-14fb8734dadd
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
+ date: Thu, 23 Jul 2020 17:19:57 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '80'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_obj_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
new file mode 100644
index 000000000000..d94542bb0494
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_obj_input.yaml
@@ -0,0 +1,39 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I should take my cat to the veterinarian.",
+ "language": "de"}, {"id": "4", "text": "Este es un document escrito en Espa\u00f1ol.",
+ "language": "de"}, {"id": "3", "text": "\u732b\u306f\u5e78\u305b", "language":
+ "de"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '253'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"4","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"3","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: c6aa447e-1084-4062-965a-ad3db86ab494
+ content-type: application/json; charset=utf-8
+ date: Thu, 23 Jul 2020 17:19:59 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '1'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
new file mode 100644
index 000000000000..b6435020ea8f
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_recognize_pii_entities_async.test_whole_batch_language_hint_and_obj_per_item_hints.yaml
@@ -0,0 +1,38 @@
+interactions:
+- request:
+ body: '{"documents": [{"id": "1", "text": "I should take my cat to the veterinarian.",
+ "language": "es"}, {"id": "2", "text": "Este es un document escrito en Espa\u00f1ol.",
+ "language": "es"}, {"id": "3", "text": "\u732b\u306f\u5e78\u305b", "language":
+ "en"}]}'
+ headers:
+ Accept:
+ - application/json
+ Content-Length:
+ - '253'
+ Content-Type:
+ - application/json
+ User-Agent:
+ - azsdk-python-ai-textanalytics/1.0.1 Python/3.7.7 (Darwin-17.7.0-x86_64-i386-64bit)
+ method: POST
+ uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+ response:
+ body:
+ string: '{"documents":[{"id":"3","entities":[],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid
+ Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid
+ language code. Supported languages: en"}}}],"modelVersion":"2020-04-01"}'
+ headers:
+ apim-request-id: 718b9664-7ee9-49ed-8d15-243f632afe44
+ content-type: application/json; charset=utf-8
+ csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1
+ date: Thu, 23 Jul 2020 17:19:58 GMT
+ strict-transport-security: max-age=31536000; includeSubDomains; preload
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-envoy-upstream-service-time: '64'
+ status:
+ code: 200
+ message: OK
+ url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/entities/recognition/pii?showStats=false
+version: 1
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi.py
index 64633222a99a..bd4ec13abde5 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi.py
@@ -3,29 +3,27 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
+import functools
from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics import TextAnalyticsClient, ApiVersion
from testcase import TextAnalyticsTest, GlobalTextAnalyticsAccountPreparer
+from testcase import TextAnalyticsClientPreparer as _TextAnalyticsClientPreparer
+# pre-apply the client_cls positional argument so it needn't be explicitly passed below
+TextAnalyticsClientPreparer = functools.partial(_TextAnalyticsClientPreparer, TextAnalyticsClient)
class TestRecognizeEntities(TextAnalyticsTest):
@GlobalTextAnalyticsAccountPreparer()
- def test_default_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
- credential = AzureKeyCredential(text_analytics_account_key)
- client = TextAnalyticsClient(text_analytics_account, credential)
-
+ @TextAnalyticsClientPreparer()
+ def test_default_api_version(self, client):
assert "v3.1-preview.1" in client._client._client._base_url
@GlobalTextAnalyticsAccountPreparer()
- def test_v3_0_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
- credential = AzureKeyCredential(text_analytics_account_key)
- client = TextAnalyticsClient(text_analytics_account, credential, api_version=ApiVersion.V3_0)
-
+ @TextAnalyticsClientPreparer(client_kwargs={"api_version": ApiVersion.V3_0})
+ def test_v3_0_api_version(self, client):
assert "v3.0" in client._client._client._base_url
@GlobalTextAnalyticsAccountPreparer()
- def test_v3_1_preview_1_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
- credential = AzureKeyCredential(text_analytics_account_key)
- client = TextAnalyticsClient(text_analytics_account, credential, api_version=ApiVersion.V3_1_PREVIEW_1)
-
+ @TextAnalyticsClientPreparer(client_kwargs={"api_version": ApiVersion.V3_1_PREVIEW_1})
+ def test_v3_1_preview_1_api_version(self, client):
assert "v3.1-preview.1" in client._client._client._base_url
\ No newline at end of file
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi_async.py
index dbd20a22218e..830072716808 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi_async.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_multiapi_async.py
@@ -3,30 +3,28 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
+import functools
from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics import ApiVersion
from azure.ai.textanalytics.aio import TextAnalyticsClient
from testcase import TextAnalyticsTest, GlobalTextAnalyticsAccountPreparer
+from testcase import TextAnalyticsClientPreparer as _TextAnalyticsClientPreparer
+# pre-apply the client_cls positional argument so it needn't be explicitly passed below
+TextAnalyticsClientPreparer = functools.partial(_TextAnalyticsClientPreparer, TextAnalyticsClient)
class TestRecognizeEntities(TextAnalyticsTest):
@GlobalTextAnalyticsAccountPreparer()
- def test_default_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
- credential = AzureKeyCredential(text_analytics_account_key)
- client = TextAnalyticsClient(text_analytics_account, credential)
-
+ @TextAnalyticsClientPreparer()
+ def test_default_api_version(self, client):
assert "v3.1-preview.1" in client._client._client._base_url
@GlobalTextAnalyticsAccountPreparer()
- def test_v3_0_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
- credential = AzureKeyCredential(text_analytics_account_key)
- client = TextAnalyticsClient(text_analytics_account, credential, api_version=ApiVersion.V3_0)
-
+ @TextAnalyticsClientPreparer(client_kwargs={"api_version": ApiVersion.V3_0})
+ def test_v3_0_api_version(self, client):
assert "v3.0" in client._client._client._base_url
@GlobalTextAnalyticsAccountPreparer()
- def test_v3_1_preview_1_api_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
- credential = AzureKeyCredential(text_analytics_account_key)
- client = TextAnalyticsClient(text_analytics_account, credential, api_version=ApiVersion.V3_1_PREVIEW_1)
-
+ @TextAnalyticsClientPreparer(client_kwargs={"api_version": ApiVersion.V3_1_PREVIEW_1})
+ def test_v3_1_preview_1_api_version(self, client):
assert "v3.1-preview.1" in client._client._client._base_url
\ No newline at end of file
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py
new file mode 100644
index 000000000000..a35ccf655264
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py
@@ -0,0 +1,566 @@
+# coding=utf-8
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+import pytest
+import platform
+import functools
+
+from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
+from azure.core.credentials import AzureKeyCredential
+from testcase import TextAnalyticsTest, GlobalTextAnalyticsAccountPreparer
+from testcase import TextAnalyticsClientPreparer as _TextAnalyticsClientPreparer
+from azure.ai.textanalytics import (
+ TextAnalyticsClient,
+ TextDocumentInput,
+ VERSION
+)
+
+# pre-apply the client_cls positional argument so it needn't be explicitly passed below
+# the first one
+TextAnalyticsClientPreparer = functools.partial(_TextAnalyticsClientPreparer, TextAnalyticsClient)
+
+# TODO: add back offset and length checks throughout this test once I add them
+
+class TestRecognizePIIEntities(TextAnalyticsTest):
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_no_single_input(self, client):
+ with self.assertRaises(TypeError):
+ response = client.recognize_pii_entities("hello world")
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_all_successful_passing_dict(self, client):
+
+ docs = [{"id": "1", "text": "My SSN is 859-98-0987."},
+ {"id": "2", "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check."},
+ {"id": "3", "text": "Is 998.214.865-68 your Brazilian CPF number?"}]
+
+ response = client.recognize_pii_entities(docs, show_stats=True)
+ self.assertEqual(response[0].entities[0].text, "859-98-0987")
+ self.assertEqual(response[0].entities[0].category, "U.S. Social Security Number (SSN)")
+ self.assertEqual(response[1].entities[0].text, "111000025")
+ # self.assertEqual(response[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
+ self.assertEqual(response[2].entities[0].text, "998.214.865-68")
+ self.assertEqual(response[2].entities[0].category, "Brazil CPF Number")
+ for doc in response:
+ self.assertIsNotNone(doc.id)
+ self.assertIsNotNone(doc.statistics)
+ for entity in doc.entities:
+ self.assertIsNotNone(entity.text)
+ self.assertIsNotNone(entity.category)
+ self.assertIsNotNone(entity.confidence_score)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_all_successful_passing_text_document_input(self, client):
+ docs = [
+ TextDocumentInput(id="1", text="My SSN is 859-98-0987."),
+ TextDocumentInput(id="2", text="Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check."),
+ TextDocumentInput(id="3", text="Is 998.214.865-68 your Brazilian CPF number?")
+ ]
+
+ response = client.recognize_pii_entities(docs, show_stats=True)
+ self.assertEqual(response[0].entities[0].text, "859-98-0987")
+ self.assertEqual(response[0].entities[0].category, "U.S. Social Security Number (SSN)")
+ self.assertEqual(response[1].entities[0].text, "111000025")
+ # self.assertEqual(response[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
+ self.assertEqual(response[2].entities[0].text, "998.214.865-68")
+ self.assertEqual(response[2].entities[0].category, "Brazil CPF Number")
+ for doc in response:
+ self.assertIsNotNone(doc.id)
+ self.assertIsNotNone(doc.statistics)
+ for entity in doc.entities:
+ self.assertIsNotNone(entity.text)
+ self.assertIsNotNone(entity.category)
+ self.assertIsNotNone(entity.confidence_score)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_length_with_emoji(self, client):
+ result = client.recognize_pii_entities(["👩 SSN: 123-12-1234"])
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_passing_only_string(self, client):
+ docs = [
+ u"My SSN is 859-98-0987.",
+ u"Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check.",
+ u"Is 998.214.865-68 your Brazilian CPF number?",
+ u""
+ ]
+
+ response = client.recognize_pii_entities(docs, show_stats=True)
+ self.assertEqual(response[0].entities[0].text, "859-98-0987")
+ self.assertEqual(response[0].entities[0].category, "U.S. Social Security Number (SSN)")
+ self.assertEqual(response[1].entities[0].text, "111000025")
+ # self.assertEqual(response[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
+ self.assertEqual(response[2].entities[0].text, "998.214.865-68")
+ self.assertEqual(response[2].entities[0].category, "Brazil CPF Number")
+ self.assertTrue(response[3].is_error)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_input_with_some_errors(self, client):
+ docs = [{"id": "1", "language": "es", "text": "hola"},
+ {"id": "2", "text": ""},
+ {"id": "3", "text": "Is 998.214.865-68 your Brazilian CPF number?"}]
+
+ response = client.recognize_pii_entities(docs)
+ self.assertTrue(response[0].is_error)
+ self.assertTrue(response[1].is_error)
+ self.assertFalse(response[2].is_error)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_input_with_all_errors(self, client):
+ docs = [{"id": "1", "text": ""},
+ {"id": "2", "language": "Spanish", "text": "Hola"},
+ {"id": "3", "language": "de", "text": ""}]
+
+ response = client.recognize_pii_entities(docs)
+ self.assertTrue(response[0].is_error)
+ self.assertTrue(response[1].is_error)
+ self.assertTrue(response[2].is_error)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_too_many_documents(self, client):
+ docs = ["One", "Two", "Three", "Four", "Five", "Six"]
+
+ with pytest.raises(HttpResponseError) as excinfo:
+ client.recognize_pii_entities(docs)
+ assert excinfo.value.status_code == 400
+ assert excinfo.value.error.code == "InvalidDocumentBatch"
+ assert "(InvalidDocumentBatch) The number of documents in the request have exceeded the data limitations" in str(excinfo.value)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_output_same_order_as_input(self, client):
+ docs = [
+ TextDocumentInput(id="1", text="one"),
+ TextDocumentInput(id="2", text="two"),
+ TextDocumentInput(id="3", text="three"),
+ TextDocumentInput(id="4", text="four"),
+ TextDocumentInput(id="5", text="five")
+ ]
+
+ response = client.recognize_pii_entities(docs)
+
+ for idx, doc in enumerate(response):
+ self.assertEqual(str(idx + 1), doc.id)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer(client_kwargs={"text_analytics_account_key": ""})
+ def test_empty_credential_class(self, client):
+ with self.assertRaises(ClientAuthenticationError):
+ response = client.recognize_pii_entities(
+ ["This is written in English."]
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer(client_kwargs={"text_analytics_account_key": "xxxxxxxxxxxx"})
+ def test_bad_credentials(self, client):
+ with self.assertRaises(ClientAuthenticationError):
+ response = client.recognize_pii_entities(
+ ["This is written in English."]
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_bad_document_input(self, client):
+ docs = "This is the wrong type"
+
+ with self.assertRaises(TypeError):
+ response = client.recognize_pii_entities(docs)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_mixing_inputs(self, client):
+ docs = [
+ {"id": "1", "text": "Microsoft was founded by Bill Gates and Paul Allen."},
+ TextDocumentInput(id="2", text="I did not like the hotel we stayed at. It was too expensive."),
+ u"You cannot mix string input with the above inputs"
+ ]
+ with self.assertRaises(TypeError):
+ response = client.recognize_pii_entities(docs)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_out_of_order_ids(self, client):
+ docs = [{"id": "56", "text": ":)"},
+ {"id": "0", "text": ":("},
+ {"id": "22", "text": ""},
+ {"id": "19", "text": ":P"},
+ {"id": "1", "text": ":D"}]
+
+ response = client.recognize_pii_entities(docs)
+ in_order = ["56", "0", "22", "19", "1"]
+ for idx, resp in enumerate(response):
+ self.assertEqual(resp.id, in_order[idx])
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_show_stats_and_model_version(self, client):
+ def callback(response):
+ self.assertIsNotNone(response)
+ self.assertIsNotNone(response.model_version, msg=response.raw_response)
+ self.assertIsNotNone(response.raw_response)
+ self.assertEqual(response.statistics.document_count, 5)
+ self.assertEqual(response.statistics.transaction_count, 4)
+ self.assertEqual(response.statistics.valid_document_count, 4)
+ self.assertEqual(response.statistics.erroneous_document_count, 1)
+
+ docs = [{"id": "56", "text": ":)"},
+ {"id": "0", "text": ":("},
+ {"id": "22", "text": ""},
+ {"id": "19", "text": ":P"},
+ {"id": "1", "text": ":D"}]
+
+ response = client.recognize_pii_entities(
+ docs,
+ show_stats=True,
+ model_version="latest",
+ raw_response_hook=callback
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_batch_size_over_limit(self, client):
+ docs = [u"hello world"] * 1050
+ with self.assertRaises(HttpResponseError):
+ response = client.recognize_pii_entities(docs)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_whole_batch_language_hint(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"fr\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ docs = [
+ u"This was the best day of my life.",
+ u"I did not like the hotel we stayed at. It was too expensive.",
+ u"The restaurant was not as good as I hoped."
+ ]
+
+ response = client.recognize_pii_entities(docs, language="fr", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_whole_batch_dont_use_language_hint(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ docs = [
+ u"This was the best day of my life.",
+ u"I did not like the hotel we stayed at. It was too expensive.",
+ u"The restaurant was not as good as I hoped."
+ ]
+
+ response = client.recognize_pii_entities(docs, language="", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_per_item_dont_use_language_hint(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 2)
+ language_str = "\"language\": \"en\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 1)
+
+
+ docs = [{"id": "1", "language": "", "text": "I will go to the park."},
+ {"id": "2", "language": "", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = client.recognize_pii_entities(docs, raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_whole_batch_language_hint_and_obj_input(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"de\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ docs = [
+ TextDocumentInput(id="1", text="I should take my cat to the veterinarian."),
+ TextDocumentInput(id="4", text="Este es un document escrito en Español."),
+ TextDocumentInput(id="3", text="猫は幸せ"),
+ ]
+
+ response = client.recognize_pii_entities(docs, language="de", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_whole_batch_language_hint_and_obj_per_item_hints(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"es\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 2)
+ language_str = "\"language\": \"en\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 1)
+
+ docs = [
+ TextDocumentInput(id="1", text="I should take my cat to the veterinarian.", language="es"),
+ TextDocumentInput(id="2", text="Este es un document escrito en Español.", language="es"),
+ TextDocumentInput(id="3", text="猫は幸せ"),
+ ]
+
+ response = client.recognize_pii_entities(docs, language="en", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_whole_batch_language_hint_and_dict_per_item_hints(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"es\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 2)
+ language_str = "\"language\": \"en\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 1)
+
+
+ docs = [{"id": "1", "language": "es", "text": "I will go to the park."},
+ {"id": "2", "language": "es", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = client.recognize_pii_entities(docs, language="en", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer(client_kwargs={"default_language": "es"})
+ def test_client_passed_default_language_hint(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"es\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ def callback_2(resp):
+ language_str = "\"language\": \"en\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ docs = [{"id": "1", "text": "I will go to the park."},
+ {"id": "2", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = client.recognize_pii_entities(docs, raw_response_hook=callback)
+ response = client.recognize_pii_entities(docs, language="en", raw_response_hook=callback_2)
+ response = client.recognize_pii_entities(docs, raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_invalid_language_hint_method(self, client):
+ response = client.recognize_pii_entities(
+ ["This should fail because we're passing in an invalid language hint"], language="notalanguage"
+ )
+ self.assertEqual(response[0].error.code, 'UnsupportedLanguageCode')
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_invalid_language_hint_docs(self, client):
+ response = client.recognize_pii_entities(
+ [{"id": "1", "language": "notalanguage", "text": "This should fail because we're passing in an invalid language hint"}]
+ )
+ self.assertEqual(response[0].error.code, 'UnsupportedLanguageCode')
+
+ @GlobalTextAnalyticsAccountPreparer()
+ def test_rotate_subscription_key(self, resource_group, location, text_analytics_account, text_analytics_account_key):
+ credential = AzureKeyCredential(text_analytics_account_key)
+ client = TextAnalyticsClient(text_analytics_account, credential)
+
+ docs = [{"id": "1", "text": "I will go to the park."},
+ {"id": "2", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = client.recognize_pii_entities(docs)
+ self.assertIsNotNone(response)
+
+ credential.update("xxx") # Make authentication fail
+ with self.assertRaises(ClientAuthenticationError):
+ response = client.recognize_pii_entities(docs)
+
+ credential.update(text_analytics_account_key) # Authenticate successfully again
+ response = client.recognize_pii_entities(docs)
+ self.assertIsNotNone(response)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_user_agent(self, client):
+ def callback(resp):
+ self.assertIn("azsdk-python-ai-textanalytics/{} Python/{} ({})".format(
+ VERSION, platform.python_version(), platform.platform()),
+ resp.http_request.headers["User-Agent"]
+ )
+
+ docs = [{"id": "1", "text": "I will go to the park."},
+ {"id": "2", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = client.recognize_pii_entities(docs, raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_document_attribute_error_no_result_attribute(self, client):
+ docs = [{"id": "1", "text": ""}]
+ response = client.recognize_pii_entities(docs)
+
+ # Attributes on DocumentError
+ self.assertTrue(response[0].is_error)
+ self.assertEqual(response[0].id, "1")
+ self.assertIsNotNone(response[0].error)
+
+ # Result attribute not on DocumentError, custom error message
+ try:
+ entities = response[0].entities
+ except AttributeError as custom_error:
+ self.assertEqual(
+ custom_error.args[0],
+ '\'DocumentError\' object has no attribute \'entities\'. '
+ 'The service was unable to process this document:\nDocument Id: 1\nError: '
+ 'InvalidDocument - Document text is empty.\n'
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_document_attribute_error_nonexistent_attribute(self, client):
+ docs = [{"id": "1", "text": ""}]
+ response = client.recognize_pii_entities(docs)
+
+ # Attribute not found on DocumentError or result obj, default behavior/message
+ try:
+ entities = response[0].attribute_not_on_result_or_error
+ except AttributeError as default_behavior:
+ self.assertEqual(
+ default_behavior.args[0],
+ '\'DocumentError\' object has no attribute \'attribute_not_on_result_or_error\''
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_bad_model_version_error(self, client):
+ docs = [{"id": "1", "language": "english", "text": "I did not like the hotel we stayed at."}]
+
+ try:
+ result = client.recognize_pii_entities(docs, model_version="bad")
+ except HttpResponseError as err:
+ self.assertEqual(err.error.code, "ModelVersionIncorrect")
+ self.assertIsNotNone(err.error.message)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_document_errors(self, client):
+ text = ""
+ for _ in range(5121):
+ text += "x"
+
+ docs = [{"id": "1", "text": ""},
+ {"id": "2", "language": "english", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": text}]
+
+ doc_errors = client.recognize_pii_entities(docs)
+ self.assertEqual(doc_errors[0].error.code, "InvalidDocument")
+ self.assertIsNotNone(doc_errors[0].error.message)
+ self.assertEqual(doc_errors[1].error.code, "UnsupportedLanguageCode")
+ self.assertIsNotNone(doc_errors[1].error.message)
+ self.assertEqual(doc_errors[2].error.code, "InvalidDocument")
+ self.assertIsNotNone(doc_errors[2].error.message)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_document_warnings(self, client):
+ # No warnings actually returned for recognize_pii_entities. Will update when they add
+ docs = [
+ {"id": "1", "text": "This won't actually create a warning :'("},
+ ]
+
+ result = client.recognize_pii_entities(docs)
+ for doc in result:
+ doc_warnings = doc.warnings
+ self.assertEqual(len(doc_warnings), 0)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_not_passing_list_for_docs(self, client):
+ docs = {"id": "1", "text": "hello world"}
+ with pytest.raises(TypeError) as excinfo:
+ client.recognize_pii_entities(docs)
+ assert "Input documents cannot be a dict" in str(excinfo.value)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_missing_input_records_error(self, client):
+ docs = []
+ with pytest.raises(ValueError) as excinfo:
+ client.recognize_pii_entities(docs)
+ assert "Input documents can not be empty or None" in str(excinfo.value)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_passing_none_docs(self, client):
+ with pytest.raises(ValueError) as excinfo:
+ client.recognize_pii_entities(None)
+ assert "Input documents can not be empty or None" in str(excinfo.value)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_duplicate_ids_error(self, client):
+ # Duplicate Ids
+ docs = [{"id": "1", "text": "hello world"},
+ {"id": "1", "text": "I did not like the hotel we stayed at."}]
+ try:
+ result = client.recognize_pii_entities(docs)
+ except HttpResponseError as err:
+ self.assertEqual(err.error.code, "InvalidDocument")
+ self.assertIsNotNone(err.error.message)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_batch_size_over_limit_error(self, client):
+ # Batch size over limit
+ docs = [u"hello world"] * 1001
+ try:
+ response = client.recognize_pii_entities(docs)
+ except HttpResponseError as err:
+ self.assertEqual(err.error.code, "InvalidDocumentBatch")
+ self.assertIsNotNone(err.error.message)
+
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_pass_cls(self, client):
+ def callback(pipeline_response, deserialized, _):
+ return "cls result"
+ res = client.recognize_pii_entities(
+ documents=["Test passing cls to endpoint"],
+ cls=callback
+ )
+ assert res == "cls result"
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ def test_language_kwarg_english(self, client):
+ def callback(response):
+ language_str = "\"language\": \"en\""
+ self.assertEqual(response.http_request.body.count(language_str), 1)
+ self.assertIsNotNone(response.model_version)
+ self.assertIsNotNone(response.statistics)
+
+ res = client.recognize_pii_entities(
+ documents=["Bill Gates is the CEO of Microsoft."],
+ model_version="latest",
+ show_stats=True,
+ language="en",
+ raw_response_hook=callback
+ )
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py
new file mode 100644
index 000000000000..c8e38af984dd
--- /dev/null
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py
@@ -0,0 +1,567 @@
+# coding=utf-8
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+import pytest
+import platform
+import functools
+
+from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
+from azure.core.credentials import AzureKeyCredential
+from asynctestcase import AsyncTextAnalyticsTest
+from testcase import GlobalTextAnalyticsAccountPreparer
+from testcase import TextAnalyticsClientPreparer as _TextAnalyticsClientPreparer
+from azure.ai.textanalytics.aio import TextAnalyticsClient
+from azure.ai.textanalytics import (
+ TextDocumentInput,
+ VERSION,
+ ApiVersion
+)
+
+# pre-apply the client_cls positional argument so it needn't be explicitly passed below
+# the first one
+TextAnalyticsClientPreparer = functools.partial(_TextAnalyticsClientPreparer, TextAnalyticsClient)
+# TODO: add back offset and length checks throughout this test once I add them
+
+class TestRecognizePIIEntities(AsyncTextAnalyticsTest):
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_no_single_input(self, client):
+ with self.assertRaises(TypeError):
+ response = await client.recognize_pii_entities("hello world")
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_all_successful_passing_dict(self, client):
+
+ docs = [{"id": "1", "text": "My SSN is 859-98-0987."},
+ {"id": "2", "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check."},
+ {"id": "3", "text": "Is 998.214.865-68 your Brazilian CPF number?"}]
+
+ response = await client.recognize_pii_entities(docs, show_stats=True)
+ self.assertEqual(response[0].entities[0].text, "859-98-0987")
+ self.assertEqual(response[0].entities[0].category, "U.S. Social Security Number (SSN)")
+ self.assertEqual(response[1].entities[0].text, "111000025")
+ # self.assertEqual(response[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
+ self.assertEqual(response[2].entities[0].text, "998.214.865-68")
+ self.assertEqual(response[2].entities[0].category, "Brazil CPF Number")
+ for doc in response:
+ self.assertIsNotNone(doc.id)
+ self.assertIsNotNone(doc.statistics)
+ for entity in doc.entities:
+ self.assertIsNotNone(entity.text)
+ self.assertIsNotNone(entity.category)
+ self.assertIsNotNone(entity.confidence_score)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_all_successful_passing_text_document_input(self, client):
+ docs = [
+ TextDocumentInput(id="1", text="My SSN is 859-98-0987."),
+ TextDocumentInput(id="2", text="Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check."),
+ TextDocumentInput(id="3", text="Is 998.214.865-68 your Brazilian CPF number?")
+ ]
+
+ response = await client.recognize_pii_entities(docs, show_stats=True)
+ self.assertEqual(response[0].entities[0].text, "859-98-0987")
+ self.assertEqual(response[0].entities[0].category, "U.S. Social Security Number (SSN)")
+ self.assertEqual(response[1].entities[0].text, "111000025")
+ # self.assertEqual(response[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
+ self.assertEqual(response[2].entities[0].text, "998.214.865-68")
+ self.assertEqual(response[2].entities[0].category, "Brazil CPF Number")
+ for doc in response:
+ self.assertIsNotNone(doc.id)
+ self.assertIsNotNone(doc.statistics)
+ for entity in doc.entities:
+ self.assertIsNotNone(entity.text)
+ self.assertIsNotNone(entity.category)
+ self.assertIsNotNone(entity.confidence_score)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_length_with_emoji(self, client):
+ result = await client.recognize_pii_entities(["👩 SSN: 123-12-1234"])
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_passing_only_string(self, client):
+ docs = [
+ u"My SSN is 859-98-0987.",
+ u"Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check.",
+ u"Is 998.214.865-68 your Brazilian CPF number?",
+ u""
+ ]
+
+ response = await client.recognize_pii_entities(docs, show_stats=True)
+ self.assertEqual(response[0].entities[0].text, "859-98-0987")
+ self.assertEqual(response[0].entities[0].category, "U.S. Social Security Number (SSN)")
+ self.assertEqual(response[1].entities[0].text, "111000025")
+ # self.assertEqual(response[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
+ self.assertEqual(response[2].entities[0].text, "998.214.865-68")
+ self.assertEqual(response[2].entities[0].category, "Brazil CPF Number")
+ self.assertTrue(response[3].is_error)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_input_with_some_errors(self, client):
+ docs = [{"id": "1", "language": "es", "text": "hola"},
+ {"id": "2", "text": ""},
+ {"id": "3", "text": "Is 998.214.865-68 your Brazilian CPF number?"}]
+
+ response = await client.recognize_pii_entities(docs)
+ self.assertTrue(response[0].is_error)
+ self.assertTrue(response[1].is_error)
+ self.assertFalse(response[2].is_error)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_input_with_all_errors(self, client):
+ docs = [{"id": "1", "text": ""},
+ {"id": "2", "language": "Spanish", "text": "Hola"},
+ {"id": "3", "language": "de", "text": ""}]
+
+ response = await client.recognize_pii_entities(docs)
+ self.assertTrue(response[0].is_error)
+ self.assertTrue(response[1].is_error)
+ self.assertTrue(response[2].is_error)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_too_many_documents(self, client):
+ docs = ["One", "Two", "Three", "Four", "Five", "Six"]
+
+ with pytest.raises(HttpResponseError) as excinfo:
+ await client.recognize_pii_entities(docs)
+ assert excinfo.value.status_code == 400
+ assert excinfo.value.error.code == "InvalidDocumentBatch"
+ assert "(InvalidDocumentBatch) The number of documents in the request have exceeded the data limitations" in str(excinfo.value)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_output_same_order_as_input(self, client):
+ docs = [
+ TextDocumentInput(id="1", text="one"),
+ TextDocumentInput(id="2", text="two"),
+ TextDocumentInput(id="3", text="three"),
+ TextDocumentInput(id="4", text="four"),
+ TextDocumentInput(id="5", text="five")
+ ]
+
+ response = await client.recognize_pii_entities(docs)
+
+ for idx, doc in enumerate(response):
+ self.assertEqual(str(idx + 1), doc.id)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer(client_kwargs={"text_analytics_account_key": ""})
+ async def test_empty_credential_class(self, client):
+ with self.assertRaises(ClientAuthenticationError):
+ response = await client.recognize_pii_entities(
+ ["This is written in English."]
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer(client_kwargs={"text_analytics_account_key": "xxxxxxxxxxxx"})
+ async def test_bad_credentials(self, client):
+ with self.assertRaises(ClientAuthenticationError):
+ response = await client.recognize_pii_entities(
+ ["This is written in English."]
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_bad_document_input(self, client):
+ docs = "This is the wrong type"
+
+ with self.assertRaises(TypeError):
+ response = await client.recognize_pii_entities(docs)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_mixing_inputs(self, client):
+ docs = [
+ {"id": "1", "text": "Microsoft was founded by Bill Gates and Paul Allen."},
+ TextDocumentInput(id="2", text="I did not like the hotel we stayed at. It was too expensive."),
+ u"You cannot mix string input with the above inputs"
+ ]
+ with self.assertRaises(TypeError):
+ response = await client.recognize_pii_entities(docs)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_out_of_order_ids(self, client):
+ docs = [{"id": "56", "text": ":)"},
+ {"id": "0", "text": ":("},
+ {"id": "22", "text": ""},
+ {"id": "19", "text": ":P"},
+ {"id": "1", "text": ":D"}]
+
+ response = await client.recognize_pii_entities(docs)
+ in_order = ["56", "0", "22", "19", "1"]
+ for idx, resp in enumerate(response):
+ self.assertEqual(resp.id, in_order[idx])
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_show_stats_and_model_version(self, client):
+ def callback(response):
+ self.assertIsNotNone(response)
+ self.assertIsNotNone(response.model_version, msg=response.raw_response)
+ self.assertIsNotNone(response.raw_response)
+ self.assertEqual(response.statistics.document_count, 5)
+ self.assertEqual(response.statistics.transaction_count, 4)
+ self.assertEqual(response.statistics.valid_document_count, 4)
+ self.assertEqual(response.statistics.erroneous_document_count, 1)
+
+ docs = [{"id": "56", "text": ":)"},
+ {"id": "0", "text": ":("},
+ {"id": "22", "text": ""},
+ {"id": "19", "text": ":P"},
+ {"id": "1", "text": ":D"}]
+
+ response = await client.recognize_pii_entities(
+ docs,
+ show_stats=True,
+ model_version="latest",
+ raw_response_hook=callback
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_batch_size_over_limit(self, client):
+ docs = [u"hello world"] * 1050
+ with self.assertRaises(HttpResponseError):
+ response = await client.recognize_pii_entities(docs)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_whole_batch_language_hint(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"fr\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ docs = [
+ u"This was the best day of my life.",
+ u"I did not like the hotel we stayed at. It was too expensive.",
+ u"The restaurant was not as good as I hoped."
+ ]
+
+ response = await client.recognize_pii_entities(docs, language="fr", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_whole_batch_dont_use_language_hint(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ docs = [
+ u"This was the best day of my life.",
+ u"I did not like the hotel we stayed at. It was too expensive.",
+ u"The restaurant was not as good as I hoped."
+ ]
+
+ response = await client.recognize_pii_entities(docs, language="", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_per_item_dont_use_language_hint(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 2)
+ language_str = "\"language\": \"en\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 1)
+
+
+ docs = [{"id": "1", "language": "", "text": "I will go to the park."},
+ {"id": "2", "language": "", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = await client.recognize_pii_entities(docs, raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_whole_batch_language_hint_and_obj_input(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"de\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ docs = [
+ TextDocumentInput(id="1", text="I should take my cat to the veterinarian."),
+ TextDocumentInput(id="4", text="Este es un document escrito en Español."),
+ TextDocumentInput(id="3", text="猫は幸せ"),
+ ]
+
+ response = await client.recognize_pii_entities(docs, language="de", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_whole_batch_language_hint_and_obj_per_item_hints(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"es\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 2)
+ language_str = "\"language\": \"en\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 1)
+
+ docs = [
+ TextDocumentInput(id="1", text="I should take my cat to the veterinarian.", language="es"),
+ TextDocumentInput(id="2", text="Este es un document escrito en Español.", language="es"),
+ TextDocumentInput(id="3", text="猫は幸せ"),
+ ]
+
+ response = await client.recognize_pii_entities(docs, language="en", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_whole_batch_language_hint_and_dict_per_item_hints(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"es\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 2)
+ language_str = "\"language\": \"en\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 1)
+
+
+ docs = [{"id": "1", "language": "es", "text": "I will go to the park."},
+ {"id": "2", "language": "es", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = await client.recognize_pii_entities(docs, language="en", raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer(client_kwargs={"default_language": "es"})
+ async def test_client_passed_default_language_hint(self, client):
+ def callback(resp):
+ language_str = "\"language\": \"es\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ def callback_2(resp):
+ language_str = "\"language\": \"en\""
+ language = resp.http_request.body.count(language_str)
+ self.assertEqual(language, 3)
+
+ docs = [{"id": "1", "text": "I will go to the park."},
+ {"id": "2", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = await client.recognize_pii_entities(docs, raw_response_hook=callback)
+ response = await client.recognize_pii_entities(docs, language="en", raw_response_hook=callback_2)
+ response = await client.recognize_pii_entities(docs, raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_invalid_language_hint_method(self, client):
+ response = await client.recognize_pii_entities(
+ ["This should fail because we're passing in an invalid language hint"], language="notalanguage"
+ )
+ self.assertEqual(response[0].error.code, 'UnsupportedLanguageCode')
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_invalid_language_hint_docs(self, client):
+ response = await client.recognize_pii_entities(
+ [{"id": "1", "language": "notalanguage", "text": "This should fail because we're passing in an invalid language hint"}]
+ )
+ self.assertEqual(response[0].error.code, 'UnsupportedLanguageCode')
+
+ @GlobalTextAnalyticsAccountPreparer()
+ async def test_rotate_subscription_key(self, resource_group, location, text_analytics_account, text_analytics_account_key):
+ credential = AzureKeyCredential(text_analytics_account_key)
+ client = TextAnalyticsClient(text_analytics_account, credential)
+
+ docs = [{"id": "1", "text": "I will go to the park."},
+ {"id": "2", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = await client.recognize_pii_entities(docs)
+ self.assertIsNotNone(response)
+
+ credential.update("xxx") # Make authentication fail
+ with self.assertRaises(ClientAuthenticationError):
+ response = await client.recognize_pii_entities(docs)
+
+ credential.update(text_analytics_account_key) # Authenticate successfully again
+ response = await client.recognize_pii_entities(docs)
+ self.assertIsNotNone(response)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_user_agent(self, client):
+ def callback(resp):
+ self.assertIn("azsdk-python-ai-textanalytics/{} Python/{} ({})".format(
+ VERSION, platform.python_version(), platform.platform()),
+ resp.http_request.headers["User-Agent"]
+ )
+
+ docs = [{"id": "1", "text": "I will go to the park."},
+ {"id": "2", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": "The restaurant had really good food."}]
+
+ response = await client.recognize_pii_entities(docs, raw_response_hook=callback)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_document_attribute_error_no_result_attribute(self, client):
+ docs = [{"id": "1", "text": ""}]
+ response = await client.recognize_pii_entities(docs)
+
+ # Attributes on DocumentError
+ self.assertTrue(response[0].is_error)
+ self.assertEqual(response[0].id, "1")
+ self.assertIsNotNone(response[0].error)
+
+ # Result attribute not on DocumentError, custom error message
+ try:
+ entities = response[0].entities
+ except AttributeError as custom_error:
+ self.assertEqual(
+ custom_error.args[0],
+ '\'DocumentError\' object has no attribute \'entities\'. '
+ 'The service was unable to process this document:\nDocument Id: 1\nError: '
+ 'InvalidDocument - Document text is empty.\n'
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_document_attribute_error_nonexistent_attribute(self, client):
+ docs = [{"id": "1", "text": ""}]
+ response = await client.recognize_pii_entities(docs)
+
+ # Attribute not found on DocumentError or result obj, default behavior/message
+ try:
+ entities = response[0].attribute_not_on_result_or_error
+ except AttributeError as default_behavior:
+ self.assertEqual(
+ default_behavior.args[0],
+ '\'DocumentError\' object has no attribute \'attribute_not_on_result_or_error\''
+ )
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_bad_model_version_error(self, client):
+ docs = [{"id": "1", "language": "english", "text": "I did not like the hotel we stayed at."}]
+
+ try:
+ result = await client.recognize_pii_entities(docs, model_version="bad")
+ except HttpResponseError as err:
+ self.assertEqual(err.error.code, "ModelVersionIncorrect")
+ self.assertIsNotNone(err.error.message)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_document_errors(self, client):
+ text = ""
+ for _ in range(5121):
+ text += "x"
+
+ docs = [{"id": "1", "text": ""},
+ {"id": "2", "language": "english", "text": "I did not like the hotel we stayed at."},
+ {"id": "3", "text": text}]
+
+ doc_errors = await client.recognize_pii_entities(docs)
+ self.assertEqual(doc_errors[0].error.code, "InvalidDocument")
+ self.assertIsNotNone(doc_errors[0].error.message)
+ self.assertEqual(doc_errors[1].error.code, "UnsupportedLanguageCode")
+ self.assertIsNotNone(doc_errors[1].error.message)
+ self.assertEqual(doc_errors[2].error.code, "InvalidDocument")
+ self.assertIsNotNone(doc_errors[2].error.message)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_document_warnings(self, client):
+ # No warnings actually returned for recognize_pii_entities. Will update when they add
+ docs = [
+ {"id": "1", "text": "This won't actually create a warning :'("},
+ ]
+
+ result = await client.recognize_pii_entities(docs)
+ for doc in result:
+ doc_warnings = doc.warnings
+ self.assertEqual(len(doc_warnings), 0)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_not_passing_list_for_docs(self, client):
+ docs = {"id": "1", "text": "hello world"}
+ with pytest.raises(TypeError) as excinfo:
+ await client.recognize_pii_entities(docs)
+ assert "Input documents cannot be a dict" in str(excinfo.value)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_missing_input_records_error(self, client):
+ docs = []
+ with pytest.raises(ValueError) as excinfo:
+ await client.recognize_pii_entities(docs)
+ assert "Input documents can not be empty or None" in str(excinfo.value)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_passing_none_docs(self, client):
+ with pytest.raises(ValueError) as excinfo:
+ await client.recognize_pii_entities(None)
+ assert "Input documents can not be empty or None" in str(excinfo.value)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_duplicate_ids_error(self, client):
+ # Duplicate Ids
+ docs = [{"id": "1", "text": "hello world"},
+ {"id": "1", "text": "I did not like the hotel we stayed at."}]
+ try:
+ result = await client.recognize_pii_entities(docs)
+ except HttpResponseError as err:
+ self.assertEqual(err.error.code, "InvalidDocument")
+ self.assertIsNotNone(err.error.message)
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_batch_size_over_limit_error(self, client):
+ # Batch size over limit
+ docs = [u"hello world"] * 1001
+ try:
+ response = await client.recognize_pii_entities(docs)
+ except HttpResponseError as err:
+ self.assertEqual(err.error.code, "InvalidDocumentBatch")
+ self.assertIsNotNone(err.error.message)
+
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_pass_cls(self, client):
+ def callback(pipeline_response, deserialized, _):
+ return "cls result"
+ res = await client.recognize_pii_entities(
+ documents=["Test passing cls to endpoint"],
+ cls=callback
+ )
+ assert res == "cls result"
+
+ @GlobalTextAnalyticsAccountPreparer()
+ @TextAnalyticsClientPreparer()
+ async def test_language_kwarg_english(self, client):
+ def callback(response):
+ language_str = "\"language\": \"en\""
+ self.assertEqual(response.http_request.body.count(language_str), 1)
+ self.assertIsNotNone(response.model_version)
+ self.assertIsNotNone(response.statistics)
+
+ res = await client.recognize_pii_entities(
+ documents=["Bill Gates is the CEO of Microsoft."],
+ model_version="latest",
+ show_stats=True,
+ language="en",
+ raw_response_hook=callback
+ )
diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_text_analytics.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_text_analytics.py
index e424d8d67356..d49a4a0cc3e4 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_text_analytics.py
+++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_text_analytics.py
@@ -32,6 +32,8 @@ def test_repr(self):
categorized_entity = _models.CategorizedEntity(text="Bill Gates", category="Person", subcategory="Age", confidence_score=0.899)
+ pii_entity = _models.PiiEntity(text="859-98-0987", category="SSN", subcategory=None, confidence_score=0.899)
+
text_document_statistics = _models.TextDocumentStatistics(character_count=14, transaction_count=18)
warnings = [_models.TextAnalyticsWarning(code="LongWordsInDocument", message="The document contains very long words (longer than 64 characters). These words will be truncated and may result in unreliable model predictions.")]
@@ -44,6 +46,14 @@ def test_repr(self):
is_error=False
)
+ recognize_pii_entities_result = _models.RecognizePiiEntitiesResult(
+ id="1",
+ entities=[pii_entity],
+ warnings=warnings,
+ statistics=text_document_statistics,
+ is_error=False
+ )
+
detect_language_result = _models.DetectLanguageResult(
id="1",
primary_language=detected_language,
@@ -113,6 +123,7 @@ def test_repr(self):
self.assertEqual("DetectedLanguage(name=English, iso6391_name=en, confidence_score=1.0)", repr(detected_language))
self.assertEqual("CategorizedEntity(text=Bill Gates, category=Person, subcategory=Age, confidence_score=0.899)",
repr(categorized_entity))
+ self.assertEqual("PiiEntity(text=859-98-0987, category=SSN, subcategory=None, confidence_score=0.899)", repr(pii_entity))
self.assertEqual("TextDocumentStatistics(character_count=14, transaction_count=18)",
repr(text_document_statistics))
self.assertEqual("RecognizeEntitiesResult(id=1, entities=[CategorizedEntity(text=Bill Gates, category=Person, "
@@ -121,6 +132,12 @@ def test_repr(self):
"These words will be truncated and may result in unreliable model predictions.)], "
"statistics=TextDocumentStatistics(character_count=14, transaction_count=18), "
"is_error=False)", repr(recognize_entities_result))
+ self.assertEqual("RecognizePiiEntitiesResult(id=1, entities=[PiiEntity(text=859-98-0987, category=SSN, "
+ "subcategory=None, confidence_score=0.899)], "
+ "warnings=[TextAnalyticsWarning(code=LongWordsInDocument, message=The document contains very long words (longer than 64 characters). "
+ "These words will be truncated and may result in unreliable model predictions.)], "
+ "statistics=TextDocumentStatistics(character_count=14, transaction_count=18), "
+ "is_error=False)", repr(recognize_pii_entities_result))
self.assertEqual("DetectLanguageResult(id=1, primary_language=DetectedLanguage(name=English, "
"iso6391_name=en, confidence_score=1.0), "
"warnings=[TextAnalyticsWarning(code=LongWordsInDocument, message=The document contains very long words (longer than 64 characters). "
From e7a2c521459808ef8476ed65ba8c205e486956d3 Mon Sep 17 00:00:00 2001
From: Krista Pratico
Date: Thu, 30 Jul 2020 08:49:24 -0700
Subject: [PATCH 3/7] [formrecognizer] renames from consistency check (#12752)
* document_name -> name on TrainingDocumentInfo
* include_sub_folders -> include_subfolders
* update FieldValueType to python types
* changelog
---
.../azure-ai-formrecognizer/CHANGELOG.md | 5 ++-
.../azure-ai-formrecognizer/README.md | 2 +-
.../formrecognizer/_form_training_client.py | 4 +--
.../azure/ai/formrecognizer/_models.py | 36 ++++++++++++-------
.../aio/_form_training_client_async.py | 4 +--
.../sample_train_model_with_labels_async.py | 2 +-
...sample_train_model_without_labels_async.py | 2 +-
.../samples/sample_train_model_with_labels.py | 2 +-
.../sample_train_model_without_labels.py | 2 +-
.../tests/test_mgmt.py | 4 +--
.../tests/test_mgmt_async.py | 4 +--
.../tests/test_repr.py | 4 +--
.../tests/test_training.py | 16 ++++-----
.../tests/test_training_async.py | 16 ++++-----
.../azure-ai-formrecognizer/tests/testcase.py | 9 ++---
15 files changed, 63 insertions(+), 49 deletions(-)
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md
index 2cba48c3a324..10f1ec619f9f 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md
@@ -5,10 +5,13 @@
**Breaking Changes**
- Values are now capitalized for enums `FormContentType`, `LengthUnit`, `TrainingStatus`, and `CustomFormModelStatus`
+- `document_name` renamed to `name` on `TrainingDocumentInfo`
+- Keyword argument `include_sub_folders` renamed to `include_subfolders` on `begin_training` methods
**New features**
-- `FormField` now has attribute `value_type` which contains the semantic data type of the field value
+- `FormField` now has attribute `value_type` which contains the semantic data type of the field value. The options for
+`value_type` are described in the enum `FieldValueType`
**Fixes and improvements**
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md
index aa98db81f8cb..ea258a9f16d3 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md
@@ -289,7 +289,7 @@ for submodel in model.submodels:
# Training result information
for doc in model.training_documents:
- print("Document name: {}".format(doc.document_name))
+ print("Document name: {}".format(doc.name))
print("Document status: {}".format(doc.status))
print("Document page count: {}".format(doc.page_count))
print("Document errors: {}".format(doc.errors))
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py
index 094284051091..32ddbbeb1366 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py
@@ -111,7 +111,7 @@ def begin_training(self, training_files_url, use_training_labels, **kwargs):
:keyword str prefix: A case-sensitive prefix string to filter documents in the source path for
training. For example, when using a Azure storage blob URI, use the prefix to restrict sub
folders for training.
- :keyword bool include_sub_folders: A flag to indicate if sub folders within the set of prefix folders
+ :keyword bool include_subfolders: A flag to indicate if subfolders within the set of prefix folders
will also need to be included when searching for content to be preprocessed. Not supported if
training with labels.
:keyword int polling_interval: Waiting time between two polls for LRO operations
@@ -157,7 +157,7 @@ def callback(raw_response):
use_label_file=use_training_labels,
source_filter=TrainSourceFilter(
prefix=kwargs.pop("prefix", ""),
- include_sub_folders=kwargs.pop("include_sub_folders", False),
+ include_sub_folders=kwargs.pop("include_subfolders", False),
)
),
cls=lambda pipeline_response, _, response_headers: pipeline_response,
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py
index 6878162edc09..60d95f90a427 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py
@@ -12,6 +12,16 @@
import six
+def adjust_value_type(value_type):
+ if value_type == "array":
+ value_type = "list"
+ if value_type == "number":
+ value_type = "float"
+ if value_type == "object":
+ value_type = "dictionary"
+ return value_type
+
+
def adjust_confidence(score):
"""Adjust confidence when not returned.
"""
@@ -83,10 +93,10 @@ class FieldValueType(str, Enum):
DATE = "date"
TIME = "time"
PHONE_NUMBER = "phoneNumber"
- NUMBER = "number"
+ FLOAT = "float"
INTEGER = "integer"
- ARRAY = "array"
- OBJECT = "object"
+ LIST = "list"
+ DICTIONARY = "dictionary"
class LengthUnit(str, Enum):
@@ -202,9 +212,9 @@ def __repr__(self):
class FormField(object):
"""Represents a field recognized in an input form.
- :ivar value_type: The type of `value` found on FormField. Possible types include: 'string',
- 'date', 'time', 'phoneNumber', 'number', 'integer', 'object', or 'array'.
- :vartype value_type: str or ~azure.ai.formrecognizer.FieldValueType
+ :ivar str value_type: The type of `value` found on FormField. Described in
+ :class:`~azure.ai.formrecognizer.FieldValueType`, possible types include: 'string',
+ 'date', 'time', 'phoneNumber', 'float', 'integer', 'dictionary', or 'list'.
:ivar ~azure.ai.formrecognizer.FieldData label_data:
Contains the text, bounding box, and field elements for the field label.
:ivar ~azure.ai.formrecognizer.FieldData value_data:
@@ -213,7 +223,7 @@ class FormField(object):
:ivar value:
The value for the recognized field. Its semantic data type is described by `value_type`.
:vartype value: str, int, float, :class:`~datetime.date`, :class:`~datetime.time`,
- :class:`~azure.ai.formrecognizer.FormField`, or list[:class:`~azure.ai.formrecognizer.FormField`]
+ dict[str, :class:`~azure.ai.formrecognizer.FormField`], or list[:class:`~azure.ai.formrecognizer.FormField`]
:ivar float confidence:
Measures the degree of certainty of the recognition result. Value is between [0.0, 1.0].
"""
@@ -229,7 +239,7 @@ def __init__(self, **kwargs):
@classmethod
def _from_generated(cls, field, value, read_result):
return cls(
- value_type=value.type if value else None,
+ value_type=adjust_value_type(value.type) if value else None,
label_data=FieldData._from_generated(field, read_result),
value_data=FieldData._from_generated(value, read_result),
value=get_field_value(field, value, read_result),
@@ -667,7 +677,7 @@ class TrainingDocumentInfo(object):
"""Report for an individual document used for training
a custom model.
- :ivar str document_name:
+ :ivar str name:
The name of the document.
:ivar str status:
The :class:`~azure.ai.formrecognizer.TrainingStatus`
@@ -680,7 +690,7 @@ class TrainingDocumentInfo(object):
"""
def __init__(self, **kwargs):
- self.document_name = kwargs.get("document_name", None)
+ self.name = kwargs.get("name", None)
self.status = kwargs.get("status", None)
self.page_count = kwargs.get("page_count", None)
self.errors = kwargs.get("errors", [])
@@ -688,15 +698,15 @@ def __init__(self, **kwargs):
@classmethod
def _from_generated(cls, train_result):
return [cls(
- document_name=doc.document_name,
+ name=doc.document_name,
status=doc.status,
page_count=doc.pages,
errors=FormRecognizerError._from_generated(doc.errors)
) for doc in train_result.training_documents] if train_result.training_documents else None
def __repr__(self):
- return "TrainingDocumentInfo(document_name={}, status={}, page_count={}, errors={})".format(
- self.document_name, self.status, self.page_count, repr(self.errors)
+ return "TrainingDocumentInfo(name={}, status={}, page_count={}, errors={})".format(
+ self.name, self.status, self.page_count, repr(self.errors)
)[:1024]
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py
index dee6a28d66ba..f68400d36d26 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py
@@ -120,7 +120,7 @@ async def begin_training(
:keyword str prefix: A case-sensitive prefix string to filter documents in the source path for
training. For example, when using a Azure storage blob URI, use the prefix to restrict sub
folders for training.
- :keyword bool include_sub_folders: A flag to indicate if sub folders within the set of prefix folders
+ :keyword bool include_subfolders: A flag to indicate if subfolders within the set of prefix folders
will also need to be included when searching for content to be preprocessed. Not supported if
training with labels.
:keyword int polling_interval: Waiting time between two polls for LRO operations
@@ -170,7 +170,7 @@ def callback(raw_response):
use_label_file=use_training_labels,
source_filter=TrainSourceFilter(
prefix=kwargs.pop("prefix", ""),
- include_sub_folders=kwargs.pop("include_sub_folders", False)
+ include_sub_folders=kwargs.pop("include_subfolders", False)
)
),
cls=lambda pipeline_response, _, response_headers: pipeline_response,
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py
index 22c5f43ec41a..a2832d4a9c5b 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py
@@ -71,7 +71,7 @@ async def train_model_with_labels(self):
# Training result information
for doc in model.training_documents:
- print("Document name: {}".format(doc.document_name))
+ print("Document name: {}".format(doc.name))
print("Document status: {}".format(doc.status))
print("Document page count: {}".format(doc.page_count))
print("Document errors: {}".format(doc.errors))
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py
index 10f8dc7a2e4e..9123d380255b 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py
@@ -67,7 +67,7 @@ async def train_model_without_labels(self):
# [END training_async]
# Training result information
for doc in model.training_documents:
- print("Document name: {}".format(doc.document_name))
+ print("Document name: {}".format(doc.name))
print("Document status: {}".format(doc.status))
print("Document page count: {}".format(doc.page_count))
print("Document errors: {}".format(doc.errors))
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py
index 9163ae85bc8e..7877d51058d9 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py
@@ -66,7 +66,7 @@ def train_model_with_labels(self):
# Training result information
for doc in model.training_documents:
- print("Document name: {}".format(doc.document_name))
+ print("Document name: {}".format(doc.name))
print("Document status: {}".format(doc.status))
print("Document page count: {}".format(doc.page_count))
print("Document errors: {}".format(doc.errors))
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py
index 800e05bdd3a0..117edcf94739 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py
@@ -63,7 +63,7 @@ def train_model_without_labels(self):
# [END training]
# Training result information
for doc in model.training_documents:
- print("Document name: {}".format(doc.document_name))
+ print("Document name: {}".format(doc.name))
print("Document status: {}".format(doc.status))
print("Document page count: {}".format(doc.page_count))
print("Document errors: {}".format(doc.errors))
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py
index 400ef0368d40..7191ee407113 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py
@@ -91,7 +91,7 @@ def test_mgmt_model_labeled(self, client, container_sas_url):
self.assertEqual(labeled_model_from_train.training_completed_on, labeled_model_from_get.training_completed_on)
self.assertEqual(labeled_model_from_train.errors, labeled_model_from_get.errors)
for a, b in zip(labeled_model_from_train.training_documents, labeled_model_from_get.training_documents):
- self.assertEqual(a.document_name, b.document_name)
+ self.assertEqual(a.name, b.name)
self.assertEqual(a.errors, b.errors)
self.assertEqual(a.page_count, b.page_count)
self.assertEqual(a.status, b.status)
@@ -127,7 +127,7 @@ def test_mgmt_model_unlabeled(self, client, container_sas_url):
self.assertEqual(unlabeled_model_from_train.training_completed_on, unlabeled_model_from_get.training_completed_on)
self.assertEqual(unlabeled_model_from_train.errors, unlabeled_model_from_get.errors)
for a, b in zip(unlabeled_model_from_train.training_documents, unlabeled_model_from_get.training_documents):
- self.assertEqual(a.document_name, b.document_name)
+ self.assertEqual(a.name, b.name)
self.assertEqual(a.errors, b.errors)
self.assertEqual(a.page_count, b.page_count)
self.assertEqual(a.status, b.status)
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt_async.py
index 6f24ce442e39..2dcfe223eee3 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt_async.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt_async.py
@@ -111,7 +111,7 @@ async def test_mgmt_model_labeled(self, client, container_sas_url):
self.assertEqual(labeled_model_from_train.training_completed_on, labeled_model_from_get.training_completed_on)
self.assertEqual(labeled_model_from_train.errors, labeled_model_from_get.errors)
for a, b in zip(labeled_model_from_train.training_documents, labeled_model_from_get.training_documents):
- self.assertEqual(a.document_name, b.document_name)
+ self.assertEqual(a.name, b.name)
self.assertEqual(a.errors, b.errors)
self.assertEqual(a.page_count, b.page_count)
self.assertEqual(a.status, b.status)
@@ -146,7 +146,7 @@ async def test_mgmt_model_unlabeled(self, client, container_sas_url):
self.assertEqual(unlabeled_model_from_train.training_completed_on, unlabeled_model_from_get.training_completed_on)
self.assertEqual(unlabeled_model_from_train.errors, unlabeled_model_from_get.errors)
for a, b in zip(unlabeled_model_from_train.training_documents, unlabeled_model_from_get.training_documents):
- self.assertEqual(a.document_name, b.document_name)
+ self.assertEqual(a.name, b.name)
self.assertEqual(a.errors, b.errors)
self.assertEqual(a.page_count, b.page_count)
self.assertEqual(a.status, b.status)
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py
index 292476201ef6..92446178008c 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py
@@ -118,8 +118,8 @@ def form_recognizer_error():
@pytest.fixture
def training_document_info(form_recognizer_error):
- model = _models.TrainingDocumentInfo(document_name="document_name", status=_models.TrainingStatus.PARTIALLY_SUCCEEDED, page_count=5, errors=[form_recognizer_error[0]])
- model_repr = "TrainingDocumentInfo(document_name=document_name, status=partiallySucceeded, page_count=5, errors=[{}])".format(form_recognizer_error[1])[:1024]
+ model = _models.TrainingDocumentInfo(name="name", status=_models.TrainingStatus.PARTIALLY_SUCCEEDED, page_count=5, errors=[form_recognizer_error[0]])
+ model_repr = "TrainingDocumentInfo(name=name, status=partiallySucceeded, page_count=5, errors=[{}])".format(form_recognizer_error[1])[:1024]
assert repr(model) == model_repr
return model, model_repr
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py
index 4dcb467d603d..525d9efe909f 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training.py
@@ -67,7 +67,7 @@ def test_training(self, client, container_sas_url):
self.assertEqual(model.errors, [])
self.assertEqual(model.status, "ready")
for doc in model.training_documents:
- self.assertIsNotNone(doc.document_name)
+ self.assertIsNotNone(doc.name)
self.assertIsNotNone(doc.page_count)
self.assertIsNotNone(doc.status)
self.assertEqual(doc.errors, [])
@@ -90,7 +90,7 @@ def test_training_multipage(self, client, container_sas_url):
self.assertEqual(model.errors, [])
self.assertEqual(model.status, "ready")
for doc in model.training_documents:
- self.assertIsNotNone(doc.document_name)
+ self.assertIsNotNone(doc.name)
self.assertIsNotNone(doc.page_count)
self.assertIsNotNone(doc.status)
self.assertEqual(doc.errors, [])
@@ -151,7 +151,7 @@ def test_training_with_labels(self, client, container_sas_url):
self.assertEqual(model.errors, [])
self.assertEqual(model.status, "ready")
for doc in model.training_documents:
- self.assertIsNotNone(doc.document_name)
+ self.assertIsNotNone(doc.name)
self.assertIsNotNone(doc.page_count)
self.assertIsNotNone(doc.status)
self.assertEqual(doc.errors, [])
@@ -175,7 +175,7 @@ def test_training_multipage_with_labels(self, client, container_sas_url):
self.assertEqual(model.errors, [])
self.assertEqual(model.status, "ready")
for doc in model.training_documents:
- self.assertIsNotNone(doc.document_name)
+ self.assertIsNotNone(doc.name)
self.assertIsNotNone(doc.page_count)
self.assertIsNotNone(doc.status)
self.assertEqual(doc.errors, [])
@@ -228,15 +228,15 @@ def callback(response):
@GlobalClientPreparer(training=True)
def test_training_with_files_filter(self, client, container_sas_url):
- poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False, include_sub_folders=True)
+ poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False, include_subfolders=True)
model = poller.result()
self.assertEqual(len(model.training_documents), 6)
- self.assertEqual(model.training_documents[-1].document_name, "subfolder/Form_6.jpg") # we traversed subfolders
+ self.assertEqual(model.training_documents[-1].name, "subfolder/Form_6.jpg") # we traversed subfolders
- poller = client.begin_training(container_sas_url, use_training_labels=False, prefix="subfolder", include_sub_folders=True)
+ poller = client.begin_training(container_sas_url, use_training_labels=False, prefix="subfolder", include_subfolders=True)
model = poller.result()
self.assertEqual(len(model.training_documents), 1)
- self.assertEqual(model.training_documents[0].document_name, "subfolder/Form_6.jpg") # we filtered for only subfolders
+ self.assertEqual(model.training_documents[0].name, "subfolder/Form_6.jpg") # we filtered for only subfolders
with pytest.raises(HttpResponseError) as e:
poller = client.begin_training(training_files_url=container_sas_url, use_training_labels=False, prefix="xxx")
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py
index 18f570cdfb76..2aa4220e30e2 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_training_async.py
@@ -74,7 +74,7 @@ async def test_training(self, client, container_sas_url):
self.assertEqual(model.errors, [])
self.assertEqual(model.status, "ready")
for doc in model.training_documents:
- self.assertIsNotNone(doc.document_name)
+ self.assertIsNotNone(doc.name)
self.assertIsNotNone(doc.page_count)
self.assertIsNotNone(doc.status)
self.assertEqual(doc.errors, [])
@@ -97,7 +97,7 @@ async def test_training_multipage(self, client, container_sas_url):
self.assertEqual(model.errors, [])
self.assertEqual(model.status, "ready")
for doc in model.training_documents:
- self.assertIsNotNone(doc.document_name)
+ self.assertIsNotNone(doc.name)
self.assertIsNotNone(doc.page_count)
self.assertIsNotNone(doc.status)
self.assertEqual(doc.errors, [])
@@ -163,7 +163,7 @@ async def test_training_with_labels(self, client, container_sas_url):
self.assertEqual(model.errors, [])
self.assertEqual(model.status, "ready")
for doc in model.training_documents:
- self.assertIsNotNone(doc.document_name)
+ self.assertIsNotNone(doc.name)
self.assertIsNotNone(doc.page_count)
self.assertIsNotNone(doc.status)
self.assertEqual(doc.errors, [])
@@ -186,7 +186,7 @@ async def test_training_multipage_with_labels(self, client, container_sas_url):
self.assertEqual(model.errors, [])
self.assertEqual(model.status, "ready")
for doc in model.training_documents:
- self.assertIsNotNone(doc.document_name)
+ self.assertIsNotNone(doc.name)
self.assertIsNotNone(doc.page_count)
self.assertIsNotNone(doc.status)
self.assertEqual(doc.errors, [])
@@ -241,15 +241,15 @@ def callback(response):
@GlobalClientPreparer(training=True)
async def test_training_with_files_filter(self, client, container_sas_url):
async with client:
- poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=False, include_sub_folders=True)
+ poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=False, include_subfolders=True)
model = await poller.result()
self.assertEqual(len(model.training_documents), 6)
- self.assertEqual(model.training_documents[-1].document_name, "subfolder/Form_6.jpg") # we traversed subfolders
+ self.assertEqual(model.training_documents[-1].name, "subfolder/Form_6.jpg") # we traversed subfolders
- poller = await client.begin_training(container_sas_url, use_training_labels=False, prefix="subfolder", include_sub_folders=True)
+ poller = await client.begin_training(container_sas_url, use_training_labels=False, prefix="subfolder", include_subfolders=True)
model = await poller.result()
self.assertEqual(len(model.training_documents), 1)
- self.assertEqual(model.training_documents[0].document_name, "subfolder/Form_6.jpg") # we filtered for only subfolders
+ self.assertEqual(model.training_documents[0].name, "subfolder/Form_6.jpg") # we filtered for only subfolders
with pytest.raises(HttpResponseError) as e:
poller = await client.begin_training(training_files_url=container_sas_url, use_training_labels=False, prefix="xxx")
diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py
index 23a5baa1e6e4..6429b9a7e868 100644
--- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py
+++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py
@@ -13,6 +13,7 @@
import re
import logging
from azure.core.credentials import AzureKeyCredential, AccessToken
+from azure.ai.formrecognizer._models import adjust_value_type
from devtools_testutils import (
AzureTestCase,
AzureMgmtPreparer,
@@ -137,7 +138,7 @@ def assertModelTransformCorrect(self, model, actual, unlabeled=False):
self.assertEqual(model.status, actual.model_info.status)
self.assertEqual(model.errors, actual.train_result.errors)
for m, a in zip(model.training_documents, actual.train_result.training_documents):
- self.assertEqual(m.document_name, a.document_name)
+ self.assertEqual(m.name, a.document_name)
if m.errors and a.errors:
self.assertEqual(m.errors, a.errors)
self.assertEqual(m.page_count, a.pages)
@@ -222,7 +223,7 @@ def assertLabeledFormFieldDictTransformCorrect(self, form_fields, actual_fields,
self.assertBoundingBoxTransformCorrect(b[label].value_data.bounding_box, a.bounding_box)
self.assertEqual(a.text, b[label].value_data.text)
field_type = a.type
- self.assertEqual(field_type, b[label].value_type)
+ self.assertEqual(adjust_value_type(field_type), b[label].value_type)
if field_type == "string":
self.assertEqual(b[label].value, a.value_string)
if field_type == "number":
@@ -268,7 +269,7 @@ def assertFormFieldTransformCorrect(self, receipt_field, actual_field, read_resu
if actual_field is None:
return
field_type = actual_field.type
- self.assertEqual(field_type, receipt_field.value_type)
+ self.assertEqual(adjust_value_type(field_type), receipt_field.value_type)
if field_type == "string":
self.assertEqual(receipt_field.value, actual_field.value_string)
if field_type == "number":
@@ -320,7 +321,7 @@ def assertTablesTransformCorrect(self, layout, actual_layout, read_results=None,
def assertReceiptItemsHasValues(self, items, page_number, include_field_elements):
for item in items:
- self.assertEqual(item.value_type, "object")
+ self.assertEqual(item.value_type, "dictionary")
self.assertBoundingBoxHasPoints(item.value.get("Name").value_data.bounding_box)
self.assertIsNotNone(item.value.get("Name").confidence)
self.assertIsNotNone(item.value.get("Name").value_data.text)
From e39c7e087d4df2cb75b5ac6d82412d2b3f33d99b Mon Sep 17 00:00:00 2001
From: iscai-msft <43154838+iscai-msft@users.noreply.github.com>
Date: Thu, 30 Jul 2020 12:15:35 -0400
Subject: [PATCH 4/7] clean up links for PII samples (#12826)
---
sdk/textanalytics/azure-ai-textanalytics/README.md | 4 +++-
sdk/textanalytics/azure-ai-textanalytics/samples/README.md | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/sdk/textanalytics/azure-ai-textanalytics/README.md b/sdk/textanalytics/azure-ai-textanalytics/README.md
index 135d48dca39c..b4f22cb02d08 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/README.md
+++ b/sdk/textanalytics/azure-ai-textanalytics/README.md
@@ -443,7 +443,7 @@ Authenticate the client with a Cognitive Services/Text Analytics API key or a to
In a batch of documents:
* Analyze sentiment: [sample_analyze_sentiment.py][analyze_sentiment_sample] ([async version][analyze_sentiment_sample_async])
* Recognize entities: [sample_recognize_entities.py][recognize_entities_sample] ([async version][recognize_entities_sample_async])
-* Recognize personally identifiable information: [sample_recognize_pii_entities.py](`https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py`)([async version](`https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py`))
+* Recognize personally identifiable information: [sample_recognize_pii_entities.py][recognize_pii_entities_sample]([async version][recognize_pii_entities_sample_async])
* Recognize linked entities: [sample_recognize_linked_entities.py][recognize_linked_entities_sample] ([async version][recognize_linked_entities_sample_async])
* Extract key phrases: [sample_extract_key_phrases.py][extract_key_phrases_sample] ([async version][extract_key_phrases_sample_async])
* Detect language: [sample_detect_language.py][detect_language_sample] ([async version][detect_language_sample_async])
@@ -531,6 +531,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[recognize_entities_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_entities_async.py
[recognize_linked_entities_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_linked_entities.py
[recognize_linked_entities_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_linked_entities_async.py
+[recognize_pii_entities_sample]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py
+[recognize_pii_entities_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py
[cla]: https://cla.microsoft.com
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
diff --git a/sdk/textanalytics/azure-ai-textanalytics/samples/README.md b/sdk/textanalytics/azure-ai-textanalytics/samples/README.md
index fcb2361c8b30..1cbc36ad4107 100644
--- a/sdk/textanalytics/azure-ai-textanalytics/samples/README.md
+++ b/sdk/textanalytics/azure-ai-textanalytics/samples/README.md
@@ -24,7 +24,7 @@ These sample programs show common scenarios for the Text Analytics client's offe
|[sample_detect_language.py][detect_language] and [sample_detect_language_async.py][detect_language_async]|Detect language in documents|
|[sample_recognize_entities.py][recognize_entities] and [sample_recognize_entities_async.py][recognize_entities_async]|Recognize named entities in documents|
|[sample_recognize_linked_entities.py][recognize_linked_entities] and [sample_recognize_linked_entities_async.py][recognize_linked_entities_async]|Recognize linked entities in documents|
-|[sample_recognize_pii_entities.py](`https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py`) and [sample_recognize_pii_entities_async.py](`https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py`)|Recognize personally identifiable information in documents|
+|[sample_recognize_pii_entities.py][recognize_pii_entities] and [sample_recognize_pii_entities_async.py][recognize_pii_entities_async]|Recognize personally identifiable information in documents|
|[sample_extract_key_phrases.py][extract_key_phrases] and [sample_extract_key_phrases_async.py][extract_key_phrases_async]|Extract key phrases from documents|
|[sample_analyze_sentiment.py][analyze_sentiment] and [sample_analyze_sentiment_async.py][analyze_sentiment_async]|Analyze the sentiment of documents|
|[sample_alternative_document_input.py][sample_alternative_document_input] and [sample_alternative_document_input_async.py][sample_alternative_document_input_async]|Pass documents to an endpoint using dicts|
@@ -73,6 +73,8 @@ what you can do with the Azure Text Analytics client library.
[recognize_entities_async]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_entities_async.py
[recognize_linked_entities]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_linked_entities.py
[recognize_linked_entities_async]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_linked_entities_async.py
+[recognize_pii_entities]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py
+[recognize_pii_entities_async]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py
[extract_key_phrases]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_extract_key_phrases.py
[extract_key_phrases_async]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_extract_key_phrases_async.py
[analyze_sentiment]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics/samples/sample_analyze_sentiment.py
From 3e91896bad9c9c2a6be894db72cfe3dd74f6535d Mon Sep 17 00:00:00 2001
From: Xiang Yan
Date: Thu, 30 Jul 2020 10:30:48 -0700
Subject: [PATCH 5/7] fix doc, sample, docstring (#12784)
* fix doc, sample, docstring
* update version
* update
---
sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md | 6 ++++++
sdk/appconfiguration/azure-appconfiguration/README.md | 4 ++--
.../appconfiguration/_azure_appconfiguration_client.py | 4 ++--
.../azure/appconfiguration/_version.py | 2 +-
.../aio/_azure_configuration_client_async.py | 4 ++--
.../samples/hello_world_advanced_async_sample.py | 2 +-
.../samples/hello_world_advanced_sample.py | 2 +-
7 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md
index 5a535709da5f..ee7e163cb4d4 100644
--- a/sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md
+++ b/sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md
@@ -3,6 +3,12 @@
-------------------
+## 1.0.1 (Unreleased)
+
+### Fixes
+
+- Doc & Sample fixes
+
## 1.0.0 (2020-01-06)
### Features
diff --git a/sdk/appconfiguration/azure-appconfiguration/README.md b/sdk/appconfiguration/azure-appconfiguration/README.md
index 1c663ad152a5..17de9f05b444 100644
--- a/sdk/appconfiguration/azure-appconfiguration/README.md
+++ b/sdk/appconfiguration/azure-appconfiguration/README.md
@@ -201,7 +201,7 @@ deleted_config_setting = client.delete_configuration_setting(
```python
filtered_listed = client.list_configuration_settings(
- labels=["*Labe*"], keys=["*Ke*"]
+ label_filter="My*", key_filter="My*"
)
for item in filtered_listed:
pass # do something
@@ -234,7 +234,7 @@ To use list_configuration_settings, call it synchronously and iterate over the r
```python
filtered_listed = async_client.list_configuration_settings(
- labels=["*Labe*"], keys=["*Ke*"]
+ label_filter="My*", key_filter="My*"
)
async for item in filtered_listed:
pass # do something
diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py
index e8a457ca9e65..f31a837189a2 100644
--- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py
+++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py
@@ -183,7 +183,7 @@ def list_configuration_settings(
pass # do something
filtered_listed = client.list_configuration_settings(
- label_filter="*Labe*", key_filter="*Ke*", accept_datetime=accept_datetime
+ label_filter="Labe*", key_filter="Ke*", accept_datetime=accept_datetime
)
for item in filtered_listed:
pass # do something
@@ -473,7 +473,7 @@ def list_revisions(
pass # do something
filtered_revisions = client.list_revisions(
- label_filter="*Labe*", key_filter="*Ke*", accept_datetime=accept_datetime
+ label_filter="Labe*", key_filter="Ke*", accept_datetime=accept_datetime
)
for item in filtered_revisions:
pass # do something
diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_version.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_version.py
index 8eedef9ba349..010063f9dd93 100644
--- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_version.py
+++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_version.py
@@ -3,4 +3,4 @@
# Licensed under the MIT License.
# ------------------------------------
-VERSION = "1.0.0"
+VERSION = "1.0.1"
diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_configuration_client_async.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_configuration_client_async.py
index 937a9c034c70..258c9bc2cb9d 100644
--- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_configuration_client_async.py
+++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_configuration_client_async.py
@@ -194,7 +194,7 @@ def list_configuration_settings(
pass # do something
filtered_listed = async_client.list_configuration_settings(
- label_filter="*Labe*", key_filter="*Ke*", accept_datetime=accept_datetime
+ label_filter="Labe*", key_filter="Ke*", accept_datetime=accept_datetime
)
async for item in filtered_listed:
pass # do something
@@ -491,7 +491,7 @@ def list_revisions(
pass # do something
filtered_revisions = async_client.list_revisions(
- label_filter="*Labe*", key_filter="*Ke*", accept_datetime=accept_datetime
+ label_filter="Labe*", key_filter="Ke*", accept_datetime=accept_datetime
)
async for item in filtered_revisions:
pass # do something
diff --git a/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_advanced_async_sample.py b/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_advanced_async_sample.py
index f9806c42cdd1..df43e8640481 100644
--- a/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_advanced_async_sample.py
+++ b/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_advanced_async_sample.py
@@ -45,7 +45,7 @@ async def main():
print("")
print("List configuration settings")
- config_settings = client.list_configuration_settings(labels=["MyLabel"])
+ config_settings = client.list_configuration_settings(label_filter="MyLabel")
async for item in config_settings:
print_configuration_setting(item)
diff --git a/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_advanced_sample.py b/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_advanced_sample.py
index a0623a900efc..246a7c47d019 100644
--- a/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_advanced_sample.py
+++ b/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_advanced_sample.py
@@ -43,7 +43,7 @@ def main():
print("")
print("List configuration settings")
- config_settings = client.list_configuration_settings(labels=["MyLabel"])
+ config_settings = client.list_configuration_settings(label_filter="MyLabel")
for item in config_settings:
print_configuration_setting(item)
From 48a813342e74e02b2a291201277b93cbd164c13f Mon Sep 17 00:00:00 2001
From: LibbaLawrence <46537478+LibbaLawrence@users.noreply.github.com>
Date: Thu, 30 Jul 2020 16:06:49 -0400
Subject: [PATCH 6/7] [Tables] Azure Data Tables SDK, sync and async code
(#12766)
* updated design of update and upsert methods
* fixed upsert/update
* reflected change to create_entity
* fixed problems with upsert function
* fixed upsert/update functions on async clients
* pausing on tests
* fixed test failing on HttpResponse
* fixing 2.7 errorZ
* trying to fix 2.7
* fixed tests
* removed problem with unbpund fucntion
* track 1 async sdk
* renamed aio to _aio
* updating comments
* tweaking comments and types for stub gen
* fixed pylint issue
* fixed list_tables to query_tables
* pylint errors
* fixing type errors
* updating samples
* fixing comments
* updating README
* fixing PR comments on keyword and credential
* editing order of docstrings
* fixing queue comments
* fixing queue comments
* delete table has no return response
* changing types to model types
* added keys to dictionary
* changing types to model types
* fixed stroage reference
* fixing docstring reutrn
* fixed cathc and raise same error
* UpdateMode in init
* obj to _
* fixing comments
* fixed metadata return
* fixed comments
* fixing test error
* fixed depedncies
* fixing type
* fixing stubgen error
* changed to ivar
* fixing type error
* editing samples/ fixing pylint
* reformatted service client sampels
* added more official samples
* added in teh create and delete table in table client
* working on client samples
* linked README to samples
* TODO for return types
* changed query entity to get entity
* edited README
* made UpdateMode into an enum
* changed return type of cont token to dict
* fixed readme common uses
* todos created
* fixed continuation token to a dictionary
* fixed continuation error
* changed query to individual entries
* editing README pr comments
* removed AAD from readme
* removed TODO
* getting rid of exposed secret
* added design updates to async client
* stahs
* fixed import
* fixed init file
* fixed import
* added todo for table
* added return type
* editing table client return
* changed table name for table standards (Sean fix)
* editing sas methods
* work in progress - fixing pre api review comments
* updated tests to work with fixes
* re-running tests for verification'
* fixed small errors with changing method names
* fixed storgae_process_error -> table instead of storage, created metadata tag on entity instead of returning etag as part of entity
* made metadata for entities separate from entity itself (see _entity.py)
* updated readme and added regex check for table names on TableClient and TableServiceClient
* oops forgot to import re in the _table_client.py
* metadata test passing
* fixed unimported entity
* added user defined filter option with parameters
* added user defined filter option with parameters
* changed the regex test to match to fit with python2
* fixed linting issues thrown by pylint
* re-ran test
* updating samples part 1
* updating asserts part 2
* removing references to common
* fixing sas on sample
* fixing import statement
* attempting to fix dateutil error
* trying to fix enum in entity property
* fix #2 dateutil
* attempting to fix dateutil error
* fixing test import
* remove unuse import
* added tests for table_client and table_service_client
* adding live recordings
* fix #2 dateutil
* updated dev_requirements, changed test name
* py 2.7 doesnt have timezone - siwtch to UTC
* reverting back to libbas recordings
* reverting to using tzutc -- for now
* updating samples a little with error printing
* replicated tzutc class with class Timezone
* forgot to create table twice for error
* changed regex to fxn in _error.py, added second assertion to tests, updated readme
* updating samples to reflect sdk part 1
* commented out cryptogrpahy from encryption test
* removed commented out code and changed the invalid table name
* updating docstrings
* 'commented out references to cryptography
* commented out pylint errors related to encryption
* updated delete entity to show etag
* still finding encryption
* removed list froma round itempaged
* commenting out test
* commented out tests
* fixed enum on edmtype
* updated update entity
* fixing apiview comments on sas
* added table name to table clinet
* changing ItemPaged to ItemPaged[str[
* changing properties to private
* changes form apiview archboard pre meeting
* added filter type
* TODO on from_string in SAS, fixed error in table querying ItemPaged return
* changed name to _primary_hostname not primay_hopstname
* oops missed the other hostname
* oops missed the other other hostname
* added a client base for tableclient and tableserviceclient, passes all tests as is for sync code
* fixed TODO on sas
* changes to satisfy linter
* tweaking delete
* moved account parsing to the base class, fixed more linting issues
* resolved comments
* updating samples
* updating updatemode
* updating UpdateMode
* importing typing for union
* initial commit for diff
* change to REPLACE'
* initial commit for pulling down current async status, ran a tests live for updated yaml files
* renamed entity tableentity
* allowed select to be array or str
* made Table class
* renamed a new directory for azure-data-tables
* removing storgae reference
* changed query 'r' to read
* removing some commented out code
* updating delete/create table comments
* docstring return type for table
* bullet point auth
* base work for async models, working on passing last few tests, added _models for async entities
* removing packages to exclude
* fixing README
* adding to the blurb in the readme from the archboard pwpt
* passing most async tests, issues with list_tables query_options currently
* fixing blank line
* making nspkg for data
* removed async
* changed to relative imports
* :had to update naming
* stahs
* stahs
* had to fix list and query tables
* build mad about version
* changed version to match 1.0.0
* changed how results_per_page is passed in, need to verify with Libba and change up sync code if we are correct
* forgot and init file - path was being skipped in build
* changing list and query to align with new api view
* passing the list_tables_with_num_results again
* passes tests when run locally, does not pass in live-mode. the behavior of results_per_page combined with by_page() is still slightly confusing
* fixed test back
* hand to change query to list tables
* temp fix on README error
* had to change msrest version
* fixing pylint error
* Update README.md
* ignorning nspkg readme
* addressed Libbas comments
* regenerated code
* fixed Krista comments on readmes
* fixing Krista comments
* fixed anna's changes
* addressed all of izzys comments
* removing unsued import
* fixing merge errors
* fixing docstrings
* fixewd docstring
* fixing docstrings
* fixing docs
* verifying tests work:
* verifying tests'
* fixed sync for parameters
* fixed async clients parameters
* fixing error for mode
* fixing pylint errors
* re running tests
* added more tests
* fixing models for tests
* fixed init
* had to fix fomratting of async docstring types
* deleting stubgens
* fixing references to storage, and tokens
* working to refactor mentions of storage
* making links to cosmos
* changed naming of header for changelog
* added azure data init to include
* fixed exposed model
* fixed return of create table to be Table object
* fixed return of create table to be Table object
* updated docstring
* added try catch to code calls
* fixed exposed model
* working on fixing error handling:
* not overriding etag
* fixed table entity metadata
* editing table object
* fixing sas protocol
* remvoed tables from aio model
* removing identity
* adding comment to install requirement
* changing docstrings for edm type - making an issue to infer
* fixing pylint errro
* fixing readme
* fixed tests for metadata
* removing links from REAMDE
* fixing broken link
* fixing pylint
* trying to fix bandit fail
* trying to fix bandit fail
* oops forget to disable bandit check
* adding back md5 with nosec
Co-authored-by: Sean Kane
Co-authored-by: Sean Kane <68240067+seankane-msft@users.noreply.github.com>
---
eng/.docsettings.yml | 1 +
sdk/tables/azure-data-nspkg/MANIFEST.in | 3 +
sdk/tables/azure-data-nspkg/README.md | 11 +
sdk/tables/azure-data-nspkg/azure/__init__.py | 1 +
.../azure-data-nspkg/azure/data/__init__.py | 1 +
sdk/tables/azure-data-nspkg/setup.cfg | 2 +
sdk/tables/azure-data-nspkg/setup.py | 45 +
sdk/tables/azure-data-tables/CHANGELOG.md | 6 +
sdk/tables/azure-data-tables/MANIFEST.in | 6 +
sdk/tables/azure-data-tables/README.md | 299 +++
.../azure-data-tables/azure/__init__.py | 1 +
.../azure-data-tables/azure/data/__init__.py | 1 +
.../azure/data/tables/__init__.py | 54 +
.../azure/data/tables/_deserialize.py | 176 ++
.../azure/data/tables/_entity.py | 119 ++
.../azure/data/tables/_generated/__init__.py | 14 +
.../data/tables/_generated/_azure_table.py | 64 +
.../data/tables/_generated/_configuration.py | 55 +
.../data/tables/_generated/aio/__init__.py | 10 +
.../_generated/aio/_azure_table_async.py | 56 +
.../_generated/aio/_configuration_async.py | 49 +
.../aio/operations_async/__init__.py | 13 +
.../_service_operations_async.py | 246 +++
.../_table_operations_async.py | 1043 ++++++++++
.../data/tables/_generated/models/__init__.py | 68 +
.../_generated/models/_azure_table_enums.py | 26 +
.../data/tables/_generated/models/_models.py | 539 +++++
.../tables/_generated/models/_models_py3.py | 607 ++++++
.../tables/_generated/operations/__init__.py | 13 +
.../operations/_service_operations.py | 253 +++
.../operations/_table_operations.py | 1058 ++++++++++
.../azure/data/tables/_generated/py.typed | 1 +
.../azure/data/tables/_generated/version.py | 13 +
.../azure/data/tables/_models.py | 499 +++++
.../azure/data/tables/_serialize.py | 217 +++
.../azure/data/tables/_shared/__init__.py | 56 +
.../data/tables/_shared/_common_conversion.py | 107 +
.../azure/data/tables/_shared/_constants.py | 51 +
.../azure/data/tables/_shared/_error.py | 230 +++
.../data/tables/_shared/_table_client_base.py | 98 +
.../_shared/_table_service_client_base.py | 75 +
.../data/tables/_shared/authentication.py | 138 ++
.../azure/data/tables/_shared/base_client.py | 434 +++++
.../data/tables/_shared/base_client_async.py | 174 ++
.../azure/data/tables/_shared/constants.py | 26 +
.../azure/data/tables/_shared/models.py | 350 ++++
.../azure/data/tables/_shared/parser.py | 20 +
.../azure/data/tables/_shared/policies.py | 628 ++++++
.../data/tables/_shared/policies_async.py | 221 +++
.../data/tables/_shared/request_handlers.py | 147 ++
.../data/tables/_shared/response_handlers.py | 159 ++
.../tables/_shared/shared_access_signature.py | 243 +++
.../_shared/table_shared_access_signature.py | 298 +++
.../azure/data/tables/_table_client.py | 471 +++++
.../data/tables/_table_service_client.py | 264 +++
.../azure/data/tables/_version.py | 7 +
.../azure/data/tables/aio/__init__.py | 13 +
.../azure/data/tables/aio/_models.py | 104 +
.../data/tables/aio/_table_client_async.py | 407 ++++
.../tables/aio/_table_service_client_async.py | 293 +++
.../azure/data/tables/py.typed | 1 +
.../azure-data-tables/dev_requirements.txt | 6 +
sdk/tables/azure-data-tables/mypy.ini | 13 +
.../samples/create_query_entities.py | 30 +
.../samples/creation_deletion_of_table.py | 61 +
.../samples/inserting_deleting_entities.py | 58 +
.../samples/querying_table.py | 25 +
.../samples/table_exists_error_handling.py | 24 +
.../samples/table_samples_authentication.py | 88 +
.../samples/table_samples_client.py | 212 ++
.../samples/table_samples_service.py | 114 ++
.../samples/update_entity.py | 36 +
sdk/tables/azure-data-tables/setup.cfg | 2 +
sdk/tables/azure-data-tables/setup.py | 84 +
.../tests/_shared/__init__.py | 0
.../tests/_shared/asynctestcase.py | 56 +
.../tests/_shared/testcase.py | 442 +++++
.../azure-data-tables/tests/conftest.py | 40 +
.../tests/encryption_test_helper.py | 90 +
.../test_table.test_account_sas.yaml | 224 +++
.../test_table.test_create_table.yaml | 90 +
...table.test_create_table_fail_on_exist.yaml | 137 ++
...test_delete_table_with_existing_table.yaml | 90 +
...ith_non_existing_table_fail_not_exist.yaml | 49 +
.../test_table.test_get_table_acl.yaml | 127 ++
.../test_table.test_list_tables.yaml | 132 ++
...st_table.test_list_tables_with_filter.yaml | 132 ++
...st_table.test_list_tables_with_marker.yaml | 282 +++
...ble.test_list_tables_with_num_results.yaml | 280 +++
.../test_table.test_query_tables.yaml | 132 ++
...t_table.test_query_tables_with_filter.yaml | 132 ++
...t_table.test_query_tables_with_marker.yaml | 282 +++
...le.test_query_tables_with_num_results.yaml | 280 +++
...table.test_set_table_acl_too_many_ids.yaml | 90 +
...able_acl_with_empty_signed_identifier.yaml | 166 ++
...ble_acl_with_empty_signed_identifiers.yaml | 165 ++
...set_table_acl_with_signed_identifiers.yaml | 166 ++
.../test_table_async.test_account_sas.yaml | 165 ++
.../test_table_async.test_create_table.yaml | 66 +
...async.test_create_table_fail_on_exist.yaml | 103 +
...test_delete_table_with_existing_table.yaml | 66 +
...ith_non_existing_table_fail_not_exist.yaml | 35 +
.../test_table_async.test_get_table_acl.yaml | 95 +
.../test_table_async.test_list_tables.yaml | 71 +
...le_async.test_list_tables_with_filter.yaml | 39 +
...le_async.test_list_tables_with_marker.yaml | 214 ++
...ync.test_list_tables_with_num_results.yaml | 247 +++
...e_async.test_query_tables_with_filter.yaml | 98 +
...async.test_set_table_acl_too_many_ids.yaml | 66 +
...ble_acl_with_empty_signed_identifiers.yaml | 124 ++
...set_table_acl_with_signed_identifiers.yaml | 127 ++
...t.test_request_callback_signed_header.yaml | 114 ++
...t_table_client.test_response_callback.yaml | 39 +
...t_table_client.test_user_agent_append.yaml | 56 +
...t_table_client.test_user_agent_custom.yaml | 87 +
..._table_client.test_user_agent_default.yaml | 44 +
...ble_entity.test_binary_property_value.yaml | 185 ++
.../test_table_entity.test_delete_entity.yaml | 233 +++
...ntity.test_delete_entity_not_existing.yaml | 141 ++
...st_delete_entity_with_if_doesnt_match.yaml | 197 ++
...ty.test_delete_entity_with_if_matches.yaml | 233 +++
....test_empty_and_spaces_property_value.yaml | 188 ++
.../test_table_entity.test_get_entity.yaml | 190 ++
..._entity.test_get_entity_full_metadata.yaml | 190 ++
...table_entity.test_get_entity_if_match.yaml | 234 +++
...le_entity.test_get_entity_no_metadata.yaml | 190 ++
...e_entity.test_get_entity_not_existing.yaml | 133 ++
...able_entity.test_get_entity_with_hook.yaml | 190 ++
...le_entity.test_get_entity_with_select.yaml | 250 +++
....test_get_entity_with_special_doubles.yaml | 186 ++
...le_entity.test_insert_entity_conflict.yaml | 199 ++
..._entity.test_insert_entity_dictionary.yaml | 146 ++
...ty.test_insert_entity_empty_string_pk.yaml | 140 ++
...ty.test_insert_entity_empty_string_rk.yaml | 140 ++
..._entity.test_insert_entity_missing_pk.yaml | 90 +
..._entity.test_insert_entity_missing_rk.yaml | 90 +
..._insert_entity_property_name_too_long.yaml | 138 ++
...est_insert_entity_too_many_properties.yaml | 207 ++
...test_insert_entity_with_full_metadata.yaml | 146 ++
...e_entity.test_insert_entity_with_hook.yaml | 146 ++
..._entity_with_large_int32_value_throws.yaml | 90 +
..._entity_with_large_int64_value_throws.yaml | 90 +
...y.test_insert_entity_with_no_metadata.yaml | 146 ++
.../test_table_entity.test_insert_etag.yaml | 150 ++
..._or_merge_entity_with_existing_entity.yaml | 238 +++
...merge_entity_with_non_existing_entity.yaml | 182 ++
...r_replace_entity_with_existing_entity.yaml | 238 +++
...place_entity_with_non_existing_entity.yaml | 182 ++
.../test_table_entity.test_merge_entity.yaml | 240 +++
...entity.test_merge_entity_not_existing.yaml | 145 ++
...est_merge_entity_with_if_doesnt_match.yaml | 201 ++
...ity.test_merge_entity_with_if_matches.yaml | 240 +++
...table_entity.test_none_property_value.yaml | 184 ++
...ith_partition_key_having_single_quote.yaml | 376 ++++
...test_table_entity.test_query_entities.yaml | 332 ++++
...ity.test_query_entities_full_metadata.yaml | 332 ++++
...ntity.test_query_entities_no_metadata.yaml | 332 ++++
...ntity.test_query_entities_with_filter.yaml | 188 ++
...ntity.test_query_entities_with_select.yaml | 332 ++++
...e_entity.test_query_entities_with_top.yaml | 392 ++++
...test_query_entities_with_top_and_next.yaml | 592 ++++++
...t_table_entity.test_query_user_filter.yaml | 146 ++
...table_entity.test_query_zero_entities.yaml | 220 +++
.../test_table_entity.test_sas_add.yaml | 190 ++
...able_entity.test_sas_add_inside_range.yaml | 190 ++
...ble_entity.test_sas_add_outside_range.yaml | 143 ++
.../test_table_entity.test_sas_delete.yaml | 233 +++
.../test_table_entity.test_sas_query.yaml | 188 ++
...ble_entity.test_sas_signed_identifier.yaml | 228 +++
.../test_table_entity.test_sas_update.yaml | 240 +++
...entity.test_sas_upper_case_table_name.yaml | 188 ++
.../test_table_entity.test_timezone.yaml | 245 +++
...ble_entity.test_unicode_property_name.yaml | 234 +++
...le_entity.test_unicode_property_value.yaml | 232 +++
.../test_table_entity.test_update_entity.yaml | 240 +++
...ntity.test_update_entity_not_existing.yaml | 145 ++
...st_update_entity_with_if_doesnt_match.yaml | 201 ++
...ty.test_update_entity_with_if_matches.yaml | 240 +++
...tity_async.test_binary_property_value.yaml | 138 ++
...table_entity_async.test_delete_entity.yaml | 174 ++
...async.test_delete_entity_not_existing.yaml | 103 +
...st_delete_entity_with_if_doesnt_match.yaml | 147 ++
...nc.test_delete_entity_with_if_matches.yaml | 174 ++
....test_empty_and_spaces_property_value.yaml | 141 ++
...st_table_entity_async.test_get_entity.yaml | 143 ++
...y_async.test_get_entity_full_metadata.yaml | 143 ++
...entity_async.test_get_entity_if_match.yaml | 174 ++
...ity_async.test_get_entity_no_metadata.yaml | 143 ++
...ty_async.test_get_entity_not_existing.yaml | 99 +
...ntity_async.test_get_entity_with_hook.yaml | 143 ++
...ity_async.test_get_entity_with_select.yaml | 110 ++
....test_get_entity_with_special_doubles.yaml | 139 ++
...ity_async.test_insert_entity_conflict.yaml | 153 ++
...y_async.test_insert_entity_dictionary.yaml | 110 ++
...nc.test_insert_entity_empty_string_pk.yaml | 104 +
...nc.test_insert_entity_empty_string_rk.yaml | 104 +
...y_async.test_insert_entity_missing_pk.yaml | 66 +
...y_async.test_insert_entity_missing_rk.yaml | 66 +
..._insert_entity_property_name_too_long.yaml | 104 +
...est_insert_entity_too_many_properties.yaml | 173 ++
...test_insert_entity_with_full_metadata.yaml | 110 ++
...ty_async.test_insert_entity_with_hook.yaml | 110 ++
..._entity_with_large_int32_value_throws.yaml | 66 +
..._entity_with_large_int64_value_throws.yaml | 66 +
...c.test_insert_entity_with_no_metadata.yaml | 110 ++
..._or_merge_entity_with_existing_entity.yaml | 179 ++
...merge_entity_with_non_existing_entity.yaml | 135 ++
...r_replace_entity_with_existing_entity.yaml | 179 ++
...place_entity_with_non_existing_entity.yaml | 135 ++
..._table_entity_async.test_merge_entity.yaml | 181 ++
..._async.test_merge_entity_not_existing.yaml | 109 ++
...est_merge_entity_with_if_doesnt_match.yaml | 153 ++
...ync.test_merge_entity_with_if_matches.yaml | 181 ++
...entity_async.test_none_property_value.yaml | 137 ++
...ith_partition_key_having_single_quote.yaml | 151 ++
...able_entity_async.test_query_entities.yaml | 250 +++
...ync.test_query_entities_full_metadata.yaml | 250 +++
...async.test_query_entities_no_metadata.yaml | 250 +++
...async.test_query_entities_with_filter.yaml | 142 ++
...async.test_query_entities_with_select.yaml | 250 +++
...ty_async.test_query_entities_with_top.yaml | 328 ++++
...test_query_entities_with_top_and_next.yaml | 450 +++++
...entity_async.test_query_zero_entities.yaml | 162 ++
.../test_table_entity_async.test_sas_add.yaml | 143 ++
...ntity_async.test_sas_add_inside_range.yaml | 143 ++
...tity_async.test_sas_add_outside_range.yaml | 109 ++
...st_table_entity_async.test_sas_delete.yaml | 174 ++
...est_table_entity_async.test_sas_query.yaml | 142 ++
...tity_async.test_sas_signed_identifier.yaml | 175 ++
...st_table_entity_async.test_sas_update.yaml | 181 ++
..._async.test_sas_upper_case_table_name.yaml | 142 ++
...test_table_entity_async.test_timezone.yaml | 138 ++
...tity_async.test_unicode_property_name.yaml | 176 ++
...ity_async.test_unicode_property_value.yaml | 174 ++
...table_entity_async.test_update_entity.yaml | 181 ++
...async.test_update_entity_not_existing.yaml | 109 ++
...st_update_entity_with_if_doesnt_match.yaml | 153 ++
...nc.test_update_entity_with_if_matches.yaml | 181 ++
...ce_properties.test_retention_too_long.yaml | 51 +
...able_service_properties.test_set_cors.yaml | 82 +
...vice_properties.test_set_hour_metrics.yaml | 81 +
...e_service_properties.test_set_logging.yaml | 81 +
...ce_properties.test_set_minute_metrics.yaml | 81 +
...perties.test_table_service_properties.yaml | 80 +
...e_properties.test_too_many_cors_rules.yaml | 57 +
...vice_stats.test_table_service_stats_f.yaml | 38 +
..._table_service_stats_when_unavailable.yaml | 38 +
.../azure-data-tables/tests/test_table.py | 489 +++++
.../tests/test_table_async.py | 435 +++++
.../tests/test_table_batch.py | 646 ++++++
.../tests/test_table_client.py | 567 ++++++
.../tests/test_table_encryption.py | 977 ++++++++++
.../tests/test_table_entity.py | 1714 ++++++++++++++++
.../tests/test_table_entity_async.py | 1731 +++++++++++++++++
.../tests/test_table_service_properties.py | 262 +++
.../tests/test_table_service_stats.py | 81 +
sdk/tables/ci.yml | 41 +
sdk/tables/tests.yml | 39 +
shared_requirements.txt | 3 +-
259 files changed, 46494 insertions(+), 1 deletion(-)
create mode 100644 sdk/tables/azure-data-nspkg/MANIFEST.in
create mode 100644 sdk/tables/azure-data-nspkg/README.md
create mode 100644 sdk/tables/azure-data-nspkg/azure/__init__.py
create mode 100644 sdk/tables/azure-data-nspkg/azure/data/__init__.py
create mode 100644 sdk/tables/azure-data-nspkg/setup.cfg
create mode 100644 sdk/tables/azure-data-nspkg/setup.py
create mode 100644 sdk/tables/azure-data-tables/CHANGELOG.md
create mode 100644 sdk/tables/azure-data-tables/MANIFEST.in
create mode 100644 sdk/tables/azure-data-tables/README.md
create mode 100644 sdk/tables/azure-data-tables/azure/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_entity.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/_azure_table.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/_configuration.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/_azure_table_async.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/_configuration_async.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/_service_operations_async.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/_table_operations_async.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/models/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_azure_table_enums.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_models.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_models_py3.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_service_operations.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_table_operations.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/py.typed
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_generated/version.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_models.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_serialize.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/_common_conversion.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/_constants.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/_error.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/_table_client_base.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/_table_service_client_base.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/authentication.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/base_client.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/base_client_async.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/constants.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/models.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/parser.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/policies.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/policies_async.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/request_handlers.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/response_handlers.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/shared_access_signature.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_shared/table_shared_access_signature.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_table_client.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/_version.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/aio/__init__.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/aio/_models.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py
create mode 100644 sdk/tables/azure-data-tables/azure/data/tables/py.typed
create mode 100644 sdk/tables/azure-data-tables/dev_requirements.txt
create mode 100644 sdk/tables/azure-data-tables/mypy.ini
create mode 100644 sdk/tables/azure-data-tables/samples/create_query_entities.py
create mode 100644 sdk/tables/azure-data-tables/samples/creation_deletion_of_table.py
create mode 100644 sdk/tables/azure-data-tables/samples/inserting_deleting_entities.py
create mode 100644 sdk/tables/azure-data-tables/samples/querying_table.py
create mode 100644 sdk/tables/azure-data-tables/samples/table_exists_error_handling.py
create mode 100644 sdk/tables/azure-data-tables/samples/table_samples_authentication.py
create mode 100644 sdk/tables/azure-data-tables/samples/table_samples_client.py
create mode 100644 sdk/tables/azure-data-tables/samples/table_samples_service.py
create mode 100644 sdk/tables/azure-data-tables/samples/update_entity.py
create mode 100644 sdk/tables/azure-data-tables/setup.cfg
create mode 100644 sdk/tables/azure-data-tables/setup.py
create mode 100644 sdk/tables/azure-data-tables/tests/_shared/__init__.py
create mode 100644 sdk/tables/azure-data-tables/tests/_shared/asynctestcase.py
create mode 100644 sdk/tables/azure-data-tables/tests/_shared/testcase.py
create mode 100644 sdk/tables/azure-data-tables/tests/conftest.py
create mode 100644 sdk/tables/azure-data-tables/tests/encryption_test_helper.py
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_account_sas.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table_fail_on_exist.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_existing_table.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_non_existing_table_fail_not_exist.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_get_table_acl.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_filter.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_marker.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_num_results.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_filter.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_marker.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_num_results.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_too_many_ids.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifier.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifiers.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_signed_identifiers.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_account_sas.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table_fail_on_exist.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_delete_table_with_existing_table.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_delete_table_with_non_existing_table_fail_not_exist.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_get_table_acl.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_filter.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_marker.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_num_results.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_query_tables_with_filter.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_too_many_ids.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifiers.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_signed_identifiers.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_request_callback_signed_header.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_response_callback.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_append.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_custom.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_default.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_binary_property_value.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_not_existing.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_with_if_doesnt_match.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_with_if_matches.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_empty_and_spaces_property_value.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_full_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_no_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_not_existing.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_hook.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_special_doubles.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_conflict.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_dictionary.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_empty_string_pk.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_empty_string_rk.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_missing_pk.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_missing_rk.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_property_name_too_long.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_too_many_properties.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_full_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_hook.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int32_value_throws.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int64_value_throws.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_no_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_etag.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_merge_entity_with_existing_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_merge_entity_with_non_existing_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_replace_entity_with_existing_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_replace_entity_with_non_existing_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_not_existing.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_with_if_doesnt_match.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_with_if_matches.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_none_property_value.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_operations_on_entity_with_partition_key_having_single_quote.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_full_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_no_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_filter.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_select.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_top.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_top_and_next.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_user_filter.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_zero_entities.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add_inside_range.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add_outside_range.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_delete.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_query.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_signed_identifier.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_update.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_upper_case_table_name.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_timezone.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_unicode_property_name.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_unicode_property_value.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_not_existing.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_with_if_doesnt_match.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_with_if_matches.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_binary_property_value.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_not_existing.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_with_if_doesnt_match.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_with_if_matches.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_empty_and_spaces_property_value.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_full_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_if_match.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_no_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_not_existing.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_hook.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_select.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_special_doubles.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_conflict.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_dictionary.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_empty_string_pk.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_empty_string_rk.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_missing_pk.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_missing_rk.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_property_name_too_long.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_too_many_properties.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_full_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_hook.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_large_int32_value_throws.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_large_int64_value_throws.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_no_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_merge_entity_with_existing_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_merge_entity_with_non_existing_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_replace_entity_with_existing_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_replace_entity_with_non_existing_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_not_existing.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_with_if_doesnt_match.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_with_if_matches.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_none_property_value.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_operations_on_entity_with_partition_key_having_single_quote.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_full_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_no_metadata.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_filter.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_select.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_top.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_top_and_next.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_zero_entities.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add_inside_range.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add_outside_range.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_delete.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_query.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_signed_identifier.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_update.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_upper_case_table_name.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_timezone.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_unicode_property_name.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_unicode_property_value.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_not_existing.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_with_if_doesnt_match.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_with_if_matches.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_retention_too_long.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_cors.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_hour_metrics.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_logging.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_minute_metrics.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_table_service_properties.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_too_many_cors_rules.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_stats.test_table_service_stats_f.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_service_stats.test_table_service_stats_when_unavailable.yaml
create mode 100644 sdk/tables/azure-data-tables/tests/test_table.py
create mode 100644 sdk/tables/azure-data-tables/tests/test_table_async.py
create mode 100644 sdk/tables/azure-data-tables/tests/test_table_batch.py
create mode 100644 sdk/tables/azure-data-tables/tests/test_table_client.py
create mode 100644 sdk/tables/azure-data-tables/tests/test_table_encryption.py
create mode 100644 sdk/tables/azure-data-tables/tests/test_table_entity.py
create mode 100644 sdk/tables/azure-data-tables/tests/test_table_entity_async.py
create mode 100644 sdk/tables/azure-data-tables/tests/test_table_service_properties.py
create mode 100644 sdk/tables/azure-data-tables/tests/test_table_service_stats.py
create mode 100644 sdk/tables/ci.yml
create mode 100644 sdk/tables/tests.yml
diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml
index 804df46c48df..6fa386df06c5 100644
--- a/eng/.docsettings.yml
+++ b/eng/.docsettings.yml
@@ -119,6 +119,7 @@ known_content_issues:
- ['sdk/storage/azure-storage-queue/samples/README.md', 'nspkg and common']
- ['sdk/textanalytics/azure-ai-nspkg/README.md', 'nspkg and common']
- ['sdk/eventhub/azure-eventhub/samples/README.md', 'nspkg and common']
+ - ['sdk/tables/azure-data-nspkg/README.md', 'nspkg and common']
# HISTORY.rst
- ['sdk/core/azure/HISTORY.rst','#4554']
diff --git a/sdk/tables/azure-data-nspkg/MANIFEST.in b/sdk/tables/azure-data-nspkg/MANIFEST.in
new file mode 100644
index 000000000000..ae46fa1cbe7c
--- /dev/null
+++ b/sdk/tables/azure-data-nspkg/MANIFEST.in
@@ -0,0 +1,3 @@
+include *.md
+include azure/__init__.py
+include azure/data/__init__.py
diff --git a/sdk/tables/azure-data-nspkg/README.md b/sdk/tables/azure-data-nspkg/README.md
new file mode 100644
index 000000000000..2b07e10788ef
--- /dev/null
+++ b/sdk/tables/azure-data-nspkg/README.md
@@ -0,0 +1,11 @@
+# Microsoft Azure Data SDK for Python
+
+This is the Microsoft Azure Data namespace package.
+
+This package is not intended to be installed directly by the end user.
+
+It provides the necessary files for other packages to extend the
+azure.data namespace.
+
+If you are looking to install the Azure Data libraries, see the
+[azure](https://pypi.python.org/pypi/azure) bundle package.
diff --git a/sdk/tables/azure-data-nspkg/azure/__init__.py b/sdk/tables/azure-data-nspkg/azure/__init__.py
new file mode 100644
index 000000000000..69e3be50dac4
--- /dev/null
+++ b/sdk/tables/azure-data-nspkg/azure/__init__.py
@@ -0,0 +1 @@
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/sdk/tables/azure-data-nspkg/azure/data/__init__.py b/sdk/tables/azure-data-nspkg/azure/data/__init__.py
new file mode 100644
index 000000000000..69e3be50dac4
--- /dev/null
+++ b/sdk/tables/azure-data-nspkg/azure/data/__init__.py
@@ -0,0 +1 @@
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/sdk/tables/azure-data-nspkg/setup.cfg b/sdk/tables/azure-data-nspkg/setup.cfg
new file mode 100644
index 000000000000..3c6e79cf31da
--- /dev/null
+++ b/sdk/tables/azure-data-nspkg/setup.cfg
@@ -0,0 +1,2 @@
+[bdist_wheel]
+universal=1
diff --git a/sdk/tables/azure-data-nspkg/setup.py b/sdk/tables/azure-data-nspkg/setup.py
new file mode 100644
index 000000000000..8d9a5455678d
--- /dev/null
+++ b/sdk/tables/azure-data-nspkg/setup.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import sys
+from setuptools import setup
+
+PACKAGES = []
+# Do an empty package on Python 3 and not python_requires, since not everybody is ready
+# https://github.com/Azure/azure-sdk-for-python/issues/3447
+# https://github.com/Azure/azure-sdk-for-python/issues/3481
+if sys.version_info[0] < 3:
+ PACKAGES = ['azure.data']
+
+setup(
+ name='azure-data-nspkg',
+ version='1.0.0',
+ description="Microsoft Azure Data Namespace Package [Internal]",
+ long_description=open("README.md", "r").read(),
+ long_description_content_type="text/markdown",
+ license='MIT License',
+ author="Microsoft Corporation",
+ author_email="azpysdkhelp@microsoft.com",
+ url="https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/tables",
+ classifiers=[
+ "Development Status :: 5 - Production/Stable",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "License :: OSI Approved :: MIT License",
+ ],
+ zip_safe=False,
+ packages=PACKAGES,
+ install_requires=[
+ 'azure-nspkg>=3.0.0',
+ ]
+)
diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md
new file mode 100644
index 000000000000..53f73cf90855
--- /dev/null
+++ b/sdk/tables/azure-data-tables/CHANGELOG.md
@@ -0,0 +1,6 @@
+# Release History
+
+## 12.0.0b1 (Unreleased)
+
+
+
diff --git a/sdk/tables/azure-data-tables/MANIFEST.in b/sdk/tables/azure-data-tables/MANIFEST.in
new file mode 100644
index 000000000000..428787a39347
--- /dev/null
+++ b/sdk/tables/azure-data-tables/MANIFEST.in
@@ -0,0 +1,6 @@
+include *.md
+include azure/__init__.py
+include azure/data/__init__.py
+include LICENSE.txt
+recursive-include tests *.py
+recursive-include samples *.py *.md
diff --git a/sdk/tables/azure-data-tables/README.md b/sdk/tables/azure-data-tables/README.md
new file mode 100644
index 000000000000..02ea72a9fab9
--- /dev/null
+++ b/sdk/tables/azure-data-tables/README.md
@@ -0,0 +1,299 @@
+# Azure Data Tables client library for Python
+
+Azure Data Tables is a NoSQL data storing service that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS.
+Tables scale as needed to support the amount of data inserted, and allow for the storing of data with non-complex accessing.
+Tables scale as needed to support the amount of data inserted, and allow for the storing of data with non-complex accessing.
+The Azure Data Tables client can be used to access Azure Storage or Cosmos accounts.
+
+Common uses of Azure Data Tables include:
+
+* Storing structured data in the form of tables
+* Quickly querying data using a clustered index
+
+[Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) | [Package (PyPI)](https://pypi.org) | [API reference documentation](https://aka.ms/azsdk/python/tables/docs) | [Product documentation](https://docs.microsoft.com/azure/storage/) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk)
+
+## Getting started
+
+### Prerequisites
+* Python 2.7, or 3.5 or later is required to use this package.
+* You must have an [Azure subscription](https://azure.microsoft.com/free/) and an
+[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package
+ or you must have a [Azure Cosmos Account](https://docs.microsoft.com/en-us/azure/cosmos-db/account-overview).
+
+### Install the package
+Install the Azure Data Tables client library for Python with [pip](https://pypi.org/project/pip/):
+
+```bash
+pip install --pre azure-data-tables
+```
+
+### Create a storage account
+If you wish to create a new cosmos storage account, you can use the [Azure Cosmos DB](https://docs.microsoft.com/en-us/azure/cosmos-db/create-cosmosdb-resources-portal)
+If you wish to create a new storage account, you can use the
+[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal),
+[Azure PowerShell](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell),
+or [Azure CLI](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli):
+
+```bash
+# Create a new resource group to hold the storage account -
+# if using an existing resource group, skip this step
+az group create --name MyResourceGroup --location westus2
+
+# Create the storage account
+az storage account create -n mystorageaccount -g MyResourceGroup
+```
+
+### Create the client
+The Azure Data Tables client library for Python allows you to interact with two types of resources: the
+account and tables, and entities. Interaction with these resources starts with an instance of a [client](#clients).
+To create a client object, you will need the account's table service endpoint URL and a credential that allows
+you to access the account:
+
+```python
+from azure.data.tables import TableServiceClient
+
+service = TableServiceClient(account_url="https://.table.core.windows.net/", credential=credential)
+```
+
+#### Looking up the account URL
+You can find the account's table service URL using the
+[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-account-overview#storage-account-endpoints),
+[Azure PowerShell](https://docs.microsoft.com/powershell/module/az.storage/get-azstorageaccount),
+or [Azure CLI](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-show):
+
+```bash
+# Get the table service URL for the account
+az storage account show -n mystorageaccount -g MyResourceGroup --query "primaryEndpoints.table"
+```
+
+#### Types of credentials
+The `credential` parameter may be provided in a number of different forms, depending on the type of
+[authorization](https://docs.microsoft.com/azure/storage/common/storage-auth) you wish to use:
+1. To use a [shared access signature (SAS) token](https://docs.microsoft.com/azure/storage/common/storage-sas-overview),
+ provide the token as a string. If your account URL includes the SAS token, omit the credential parameter.
+ You can generate a SAS token from the Azure Portal under "Shared access signature" or use one of the `generate_sas()`
+ functions to create a sas token for the account or table:
+
+```python
+ from datetime import datetime, timedelta
+ from azure.data.tables import TableServiceClient, generate_account_sas, ResourceTypes, AccountSasPermissions
+
+ sas_token = generate_account_sas(
+ account_name="",
+ account_key="",
+ resource_types=ResourceTypes(service=True),
+ permission=AccountSasPermissions(read=True),
+ expiry=datetime.utcnow() + timedelta(hours=1)
+ )
+
+ table_service_client = TableServiceClient(account_url="https://.table.core.windows.net", credential=sas_token)
+```
+
+2. To use an account [shared key](https://docs.microsoft.com/rest/api/storageservices/authenticate-with-shared-key/)
+ (aka account key or access key), provide the key as a string. This can be found in the Azure Portal under the "Access Keys"
+ section or by running the following Azure CLI command:
+
+ ```az storage account keys list -g MyResourceGroup -n mystorageaccount```
+
+ Use the key as the credential parameter to authenticate the client:
+ ```python
+ from azure.data.tables import TableServiceClient
+ service = TableServiceClient(account_url="https://.table.core.windows.net", credential="")
+ ```
+
+#### Creating the client from a connection string
+Depending on your use case and authorization method, you may prefer to initialize a client instance with a
+connection string instead of providing the account URL and credential separately. To do this, pass the
+connection string to the client's `from_connection_string` class method:
+
+```python
+from azure.data.tables import TableServiceClient
+
+connection_string = "DefaultEndpointsProtocol=https;AccountName=xxxx;AccountKey=xxxx;EndpointSuffix=core.windows.net"
+service = TableServiceClient.from_connection_string(conn_str=connection_string)
+```
+
+The connection string to your account can be found in the Azure Portal under the "Access Keys" section or by running the following CLI command:
+
+```bash
+az storage account show-connection-string -g MyResourceGroup -n mystorageaccount
+```
+
+## Key concepts
+The following components make up the Azure Data Tables Service:
+* The account
+* A table within the account, which contains a set of entities
+* An entity within a table, as a dictionary
+
+The Azure Data Tables client library for Python allows you to interact with each of these components through the
+use of a dedicated client object.
+
+### Clients
+Two different clients are provided to to interact with the various components of the Table Service:
+1. [TableServiceClient](https://aka.ms/azsdk/python/tables/docs) -
+ this client represents interaction with the Azure account itself, and allows you to acquire preconfigured
+ client instances to access the tables within. It provides operations to retrieve and configure the account
+ properties as well as query, create, and delete tables within the account. To perform operations on a specific table,
+ retrieve a client using the `get_table_client` method.
+2. [TableClient](https://aka.ms/azsdk/python/tables/docs) -
+ this client represents interaction with a specific table (which need not exist yet). It provides operations to
+ create, delete, or update a table and includes operations to query, get, and upsert entities
+ within it.
+
+### Entities
+* **Create** - Adds an entity to the table.
+* **Delete** - Deletes an entity from the table.
+* **Update** - Updates an entities information by either merging or replacing the existing entity.
+* **Query** - Queries existing entities in a table based off of the QueryOptions (OData).
+* **Get** - Gets a specific entity from a table by partition and row key.
+* **Upsert** - Merges or replaces an entity in a table, or if the entity does not exist, inserts the entity.
+
+## Examples
+
+The following sections provide several code snippets covering some of the most common Table tasks, including:
+
+* [Creating a table](#creating-a-table "Creating a table")
+* [Creating entities](#creating-entities "Creating entities")
+* [Querying entities](#querying-entities "Querying entities")
+
+
+### Creating a table
+Create a table in your account
+
+```python
+from azure.data.tables import TableServiceClient
+
+table_service_client = TableServiceClient.from_connection_string(conn_str="")
+table_service_client.create_table(table_name="myTable")
+```
+
+### Creating entities
+Create entities in the table
+
+```python
+from azure.data.tables import TableClient
+
+my_entity = {'PartitionKey':'part','RowKey':'row'}
+
+table_client = TableClient.from_connection_string(conn_str="", table_name="myTable")
+entity = table_client.create_entity(entity=my_entity)
+```
+
+### Querying entities
+Querying entities in the table
+
+```python
+from azure.data.tables import TableClient
+
+my_filter = "text eq Marker"
+
+table_client = TableClient.from_connection_string(conn_str="", table_name="mytable")
+entity = table_client.query_entities(filter=my_filter)
+```
+
+## Optional Configuration
+
+Optional keyword arguments can be passed in at the client and per-operation level. The azure-core [reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-core/latest/azure.core.html) describes available configurations for retries, logging, transport protocols, and more.
+
+
+### Retry Policy configuration
+
+Use the following keyword arguments when instantiating a client to configure the retry policy:
+
+* __retry_total__ (int): Total number of retries to allow. Takes precedence over other counts.
+Pass in `retry_total=0` if you do not want to retry on requests. Defaults to 10.
+* __retry_connect__ (int): How many connection-related errors to retry on. Defaults to 3.
+* __retry_read__ (int): How many times to retry on read errors. Defaults to 3.
+* __retry_status__ (int): How many times to retry on bad status codes. Defaults to 3.
+* __retry_to_secondary__ (bool): Whether the request should be retried to secondary, if able.
+This should only be enabled of RA-GRS accounts are used and potentially stale data can be handled.
+Defaults to `False`.
+
+### Other client / per-operation configuration
+
+Other optional configuration keyword arguments that can be specified on the client or per-operation.
+
+**Client keyword arguments:**
+
+* __connection_timeout__ (int): Optionally sets the connect and read timeout value, in seconds.
+* __transport__ (Any): User-provided transport to send the HTTP request.
+
+**Per-operation keyword arguments:**
+
+* __raw_response_hook__ (callable): The given callback uses the response returned from the service.
+* __raw_request_hook__ (callable): The given callback uses the request before being sent to service.
+* __client_request_id__ (str): Optional user specified identification of the request.
+* __user_agent__ (str): Appends the custom value to the user-agent header to be sent with the request.
+* __logging_enable__ (bool): Enables logging at the DEBUG level. Defaults to False. Can also be passed in at
+the client level to enable it for all requests.
+* __headers__ (dict): Pass in custom headers as key, value pairs. E.g. `headers={'CustomValue': value}`
+
+
+## Troubleshooting
+### General
+Azure Data Tables clients raise exceptions defined in [Azure Core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md).
+All Table service operations will throw a `HttpResponseError` on failure with helpful [error codes](https://docs.microsoft.com/en-us/rest/api/storageservices/table-service-error-codes).
+
+### Logging
+This library uses the standard
+[logging](https://docs.python.org/3/library/logging.html) library for logging.
+Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO
+level.
+
+Detailed DEBUG level logging, including request/response bodies and unredacted
+headers, can be enabled on a client with the `logging_enable` argument:
+```python
+import sys
+import logging
+from azure.data.tables import TableServiceClient
+
+# Create a logger for the 'azure.data.tables' SDK
+logger = logging.getLogger('azure.data.tables')
+logger.setLevel(logging.DEBUG)
+
+# Configure a console output
+handler = logging.StreamHandler(stream=sys.stdout)
+logger.addHandler(handler)
+
+# This client will log detailed information about its HTTP sessions, at DEBUG level
+service_client = TableServiceClient.from_connection_string("your_connection_string", logging_enable=True)
+```
+
+Similarly, `logging_enable` can enable detailed logging for a single operation,
+even when it isn't enabled for the client:
+```py
+service_client.get_service_stats(logging_enable=True)
+```
+
+## Next steps
+
+Get started with our [Table samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk).
+
+Several Azure Data Tables Python SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Tables:
+
+* [table_samples_authentication.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article:
+ * From a connection string
+ * From a shared access key
+ * From a shared access signature token
+* [table_samples_service.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article:
+ * Get and set service properties
+ * List tables in a account
+ * Create and delete a table from the service
+ * Get the TableClient
+* [table_samples_client.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article:
+ * Client creation
+ * Create a table
+ * Create and Delete entities
+ * Query entities
+ * Update entities
+ * Upsert entities
+
+### Additional documentation
+For more extensive documentation on Azure Data Tables, see the [Azure Data Tables documentation](https://docs.microsoft.com/azure/storage/tables/) on docs.microsoft.com.
+
+## Contributing
+This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
+
+When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
diff --git a/sdk/tables/azure-data-tables/azure/__init__.py b/sdk/tables/azure-data-tables/azure/__init__.py
new file mode 100644
index 000000000000..59cb70146572
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/__init__.py
@@ -0,0 +1 @@
+__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
diff --git a/sdk/tables/azure-data-tables/azure/data/__init__.py b/sdk/tables/azure-data-tables/azure/data/__init__.py
new file mode 100644
index 000000000000..59cb70146572
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/__init__.py
@@ -0,0 +1 @@
+__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/__init__.py b/sdk/tables/azure-data-tables/azure/data/tables/__init__.py
new file mode 100644
index 000000000000..784eae1b1948
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/__init__.py
@@ -0,0 +1,54 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from azure.data.tables._models import TableServiceStats
+
+from ._entity import TableEntity, EntityProperty, EdmType
+from ._shared.table_shared_access_signature import generate_table_sas, \
+ generate_account_sas
+from ._table_client import TableClient
+from ._table_service_client import TableServiceClient
+
+from ._models import (
+ AccessPolicy,
+ Metrics,
+ RetentionPolicy, TableAnalyticsLogging, TableSasPermissions, CorsRule, UpdateMode, SASProtocol, Table,
+)
+from ._shared.models import (
+ LocationMode,
+ ResourceTypes,
+ AccountSasPermissions,
+ TableErrorCode
+)
+from ._shared.policies import ExponentialRetry, LinearRetry
+from ._version import VERSION
+
+__version__ = VERSION
+
+__all__ = [
+ 'TableClient',
+ 'TableServiceClient',
+ 'ExponentialRetry',
+ 'LinearRetry',
+ 'LocationMode',
+ 'ResourceTypes',
+ 'AccountSasPermissions',
+ 'TableErrorCode',
+ 'TableServiceStats',
+ 'TableSasPermissions',
+ 'AccessPolicy',
+ 'TableAnalyticsLogging',
+ 'Metrics',
+ 'generate_account_sas',
+ 'CorsRule',
+ 'UpdateMode',
+ 'Table',
+ 'TableEntity',
+ 'EntityProperty',
+ 'EdmType',
+ 'RetentionPolicy',
+ 'generate_table_sas',
+ 'SASProtocol'
+]
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py b/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py
new file mode 100644
index 000000000000..4555dad01241
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py
@@ -0,0 +1,176 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+# pylint: disable=unused-argument
+import datetime
+from uuid import UUID
+from azure.core.exceptions import ResourceExistsError
+from ._shared import url_quote
+from ._entity import EntityProperty, EdmType, TableEntity
+from ._shared._common_conversion import _decode_base64_to_bytes
+from ._generated.models import TableProperties
+
+
+from ._shared.models import TableErrorCode
+
+
+def deserialize_metadata(response, _, headers):
+ return {k[10:]: v for k, v in response.headers.items() if k.startswith("x-ms-meta-")}
+
+
+def deserialize_table_properties(response, obj, headers):
+ metadata = deserialize_metadata(response, obj, headers)
+ table_properties = TableProperties(
+ metadata=metadata,
+ **headers
+ )
+ return table_properties
+
+
+def deserialize_table_creation(response, _, headers):
+ if response.status_code == 204:
+ error_code = TableErrorCode.table_already_exists
+ error = ResourceExistsError(
+ message="Table already exists\nRequestId:{}\nTime:{}\nErrorCode:{}".format(
+ headers['x-ms-request-id'],
+ headers['Date'],
+ error_code
+ ),
+ response=response)
+ error.error_code = error_code
+ error.additional_info = {}
+ raise error
+ return headers
+
+
+def _from_entity_binary(value):
+ return EntityProperty(EdmType.BINARY, _decode_base64_to_bytes(value))
+
+
+def _from_entity_int32(value):
+ return EntityProperty(EdmType.INT32, int(value))
+
+
+zero = datetime.timedelta(0) # same as 00:00
+
+
+class Timezone(datetime.tzinfo): # pylint: disable : W0223
+
+ def utcoffset(self, dt):
+ return zero
+
+ def dst(self, dt):
+ return zero
+
+ def tzname(self, dt):
+ return
+
+
+def _from_entity_datetime(value):
+ # # TODO: Fix this
+ return datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M:%SZ'). \
+ replace(tzinfo=Timezone())
+
+
+def _from_entity_guid(value):
+ return UUID(value)
+
+
+_EDM_TYPES = [EdmType.BINARY, EdmType.INT64, EdmType.GUID, EdmType.DATETIME,
+ EdmType.STRING, EdmType.INT32, EdmType.DOUBLE, EdmType.BOOLEAN]
+
+_ENTITY_TO_PYTHON_CONVERSIONS = {
+ EdmType.BINARY: _from_entity_binary,
+ EdmType.INT32: _from_entity_int32,
+ EdmType.INT64: int,
+ EdmType.DOUBLE: float,
+ EdmType.DATETIME: _from_entity_datetime,
+ EdmType.GUID: _from_entity_guid,
+}
+
+
+def _convert_to_entity(entry_element):
+ ''' Convert json response to entity.
+ The entity format is:
+ {
+ "Address":"Mountain View",
+ "Age":23,
+ "AmountDue":200.23,
+ "CustomerCode@odata.type":"Edm.Guid",
+ "CustomerCode":"c9da6455-213d-42c9-9a79-3e9149a57833",
+ "CustomerSince@odata.type":"Edm.DateTime",
+ "CustomerSince":"2008-07-10T00:00:00",
+ "IsActive":true,
+ "NumberOfOrders@odata.type":"Edm.Int64",
+ "NumberOfOrders":"255",
+ "PartitionKey":"mypartitionkey",
+ "RowKey":"myrowkey"
+ }
+ '''
+ entity = TableEntity()
+
+ properties = {}
+ edmtypes = {}
+ odata = {}
+
+ for name, value in entry_element.items():
+ if name.startswith('odata.'):
+ odata[name[6:]] = value
+ elif name.endswith('@odata.type'):
+ edmtypes[name[:-11]] = value
+ else:
+ properties[name] = value
+
+ # Partition key is a known property
+ partition_key = properties.pop('PartitionKey', None)
+ if partition_key:
+ entity['PartitionKey'] = partition_key
+
+ # Row key is a known property
+ row_key = properties.pop('RowKey', None)
+ if row_key:
+ entity['RowKey'] = row_key
+
+ # Timestamp is a known property
+ timestamp = properties.pop('Timestamp', None)
+ if timestamp:
+ # TODO: verify change here
+ # entity['Timestamp'] = _from_entity_datetime(timestamp)
+ entity['Timestamp'] = timestamp
+
+ for name, value in properties.items():
+ mtype = edmtypes.get(name)
+
+ # Add type for Int32
+ if type(value) is int: # pylint:disable=C0123
+ mtype = EdmType.INT32
+
+ # no type info, property should parse automatically
+ if not mtype:
+ entity[name] = value
+ else: # need an object to hold the property
+ conv = _ENTITY_TO_PYTHON_CONVERSIONS.get(mtype)
+ if conv is not None:
+ new_property = conv(value)
+ else:
+ new_property = EntityProperty(mtype, value)
+ entity[name] = new_property
+
+ # extract etag from entry
+ etag = odata.get('etag')
+ if timestamp and not etag:
+ etag = 'W/"datetime\'' + url_quote(timestamp) + '\'"'
+ entity['etag'] = etag
+
+ entity._set_metadata() # pylint: disable = W0212
+ return entity
+
+
+def _extract_etag(response):
+ """ Extracts the etag from the response headers. """
+ if response and response.headers:
+ return response.headers.get('etag')
+
+ return None
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_entity.py b/sdk/tables/azure-data-tables/azure/data/tables/_entity.py
new file mode 100644
index 000000000000..cc3265c2860c
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_entity.py
@@ -0,0 +1,119 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from enum import Enum
+
+from ._shared._error import _ERROR_ATTRIBUTE_MISSING
+
+
+class TableEntity(dict):
+ """
+ An entity object. Can be accessed as a dict or as an obj. The attributes of
+ the entity will be created dynamically. For example, the following are both
+ valid::
+ TableEntity = TableEntity()
+ TableEntity.a = 'b'
+ TableEntity['x'] = 'y'
+
+ """
+
+ def _set_metadata(self):
+ if 'Timestamp' in self.keys():
+ self._metadata = {'etag': self.pop('etag'), "timestamp": self.pop('Timestamp')} # pylint:disable=W0201
+ else:
+ self._metadata = {'etag': self.pop('etag')} # pylint:disable=W0201
+
+ def metadata(self, **kwargs): # pylint: disable = W0613
+ # type: (...) -> Dict[str,Any]
+ """Resets metadata to be a part of the entity
+ :return Dict of entity metadata
+ :rtype Dict[str, Any]
+ """
+ return self._metadata
+
+ def __getattr__(self, name):
+ """
+ :param name:name of entity entry
+ :type name: str
+ :return: TableEntity dictionary
+ :rtype: dict[str,str]
+ """
+ try:
+ return self[name]
+ except KeyError:
+ raise AttributeError(_ERROR_ATTRIBUTE_MISSING.format('TableEntity', name))
+
+ __setattr__ = dict.__setitem__
+
+ def __delattr__(self, name):
+ """
+ :param name:name of entity entry
+ :type name: str
+ """
+ try:
+ if name is not None:
+ del self[name]
+ except KeyError:
+ raise AttributeError(_ERROR_ATTRIBUTE_MISSING.format('TableEntity', name))
+
+ def __dir__(self):
+ return dir({}) + list(self.keys())
+
+
+class EntityProperty(object):
+ """
+ An entity property. Used to explicitly set :class:`~EdmType` when necessary.
+
+ Values which require explicit typing are GUID, INT32, and BINARY. Other EdmTypes
+ may be explicitly create as EntityProperty objects but need not be. For example,
+ the below with both create STRING typed properties on the entity::
+ entity = Entity()
+ entity.a = 'b'
+ entity.x = EntityProperty(EdmType.STRING, 'y')
+ """
+
+ def __init__(self,
+ type=None, # type: Union[str,EdmType] # pylint:disable=W0622
+ value=None # type: Any
+ ):
+ """
+ Represents an Azure Table. Returned by list_tables.
+
+ :param Union[str, EdmType] type: The type of the property.
+ :param Any value: The value of the property.
+ """
+ self.type = type
+ self.value = value
+
+
+class EdmType(str, Enum):
+ """
+ Used by :class:`~.EntityProperty` to represent the type of the entity property
+ to be stored by the Table service.
+ """
+
+ BINARY = "Edm.Binary"
+ ''' Represents byte data. This type will be inferred for Python bytes.. '''
+
+ INT64 = "Edm.Int64"
+ ''' Represents a number between -(2^31) and 2^31. This is the default type for Python numbers. '''
+
+ GUID = "Edm.Guid"
+ ''' Represents a GUID. This type will be inferred for uuid.UUID. '''
+
+ DATETIME = "Edm.DateTime"
+ ''' Represents a date. This type will be inferred for Python datetime objects. '''
+
+ STRING = "Edm.String"
+ ''' Represents a string. This type will be inferred for Python strings. '''
+
+ INT32 = "Edm.Int32"
+ ''' Represents a number between -(2^15) and 2^15. Must be specified or numbers will default to INT64. '''
+
+ DOUBLE = "Edm.Double"
+ ''' Represents a double. This type will be inferred for Python floating point numbers. '''
+
+ BOOLEAN = "Edm.Boolean"
+ ''' Represents a boolean. This type will be inferred for Python bools. '''
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/__init__.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/__init__.py
new file mode 100644
index 000000000000..38dbb2a7267b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/__init__.py
@@ -0,0 +1,14 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from ._azure_table import AzureTable
+__all__ = ['AzureTable']
+
+try:
+ from ._patch import patch_sdk
+ patch_sdk()
+except ImportError:
+ pass
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/_azure_table.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/_azure_table.py
new file mode 100644
index 000000000000..b9331513f6f5
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/_azure_table.py
@@ -0,0 +1,64 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import TYPE_CHECKING
+
+from azure.core import PipelineClient
+from msrest import Deserializer, Serializer
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
+
+from ._configuration import AzureTableConfiguration
+from .operations import TableOperations
+from .operations import ServiceOperations
+from . import models
+
+
+class AzureTable(object):
+ """AzureTable.
+
+ :ivar table: TableOperations operations
+ :vartype table: azure_table.operations.TableOperations
+ :ivar service: ServiceOperations operations
+ :vartype service: azure_table.operations.ServiceOperations
+ :param url: The URL of the service account or table that is the targe of the desired operation.
+ :type url: str
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ """
+
+ def __init__(
+ self,
+ url, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ base_url = '{url}'
+ self._config = AzureTableConfiguration(url, **kwargs)
+ self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
+
+ client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
+ self._serialize = Serializer(client_models)
+ self._deserialize = Deserializer(client_models)
+
+ self.table = TableOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+ self.service = ServiceOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+
+ def close(self):
+ # type: () -> None
+ self._client.close()
+
+ def __enter__(self):
+ # type: () -> AzureTable
+ self._client.__enter__()
+ return self
+
+ def __exit__(self, *exc_details):
+ # type: (Any) -> None
+ self._client.__exit__(*exc_details)
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/_configuration.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/_configuration.py
new file mode 100644
index 000000000000..f822bc3d1ad0
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/_configuration.py
@@ -0,0 +1,55 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import TYPE_CHECKING
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
+
+VERSION = "unknown"
+
+class AzureTableConfiguration(Configuration):
+ """Configuration for AzureTable.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param url: The URL of the service account or table that is the targe of the desired operation.
+ :type url: str
+ """
+
+ def __init__(
+ self,
+ url, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ if url is None:
+ raise ValueError("Parameter 'url' must not be None.")
+ super(AzureTableConfiguration, self).__init__(**kwargs)
+
+ self.url = url
+ self.version = "2019-02-02"
+ kwargs.setdefault('sdk_moniker', 'azuretable/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/__init__.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/__init__.py
new file mode 100644
index 000000000000..4c1512d94a8a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/__init__.py
@@ -0,0 +1,10 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+__all__ = ['AzureTable']
+
+from ._azure_table_async import AzureTable
+
+
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/_azure_table_async.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/_azure_table_async.py
new file mode 100644
index 000000000000..1b3c4d87d19c
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/_azure_table_async.py
@@ -0,0 +1,56 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import Any
+
+from azure.core import AsyncPipelineClient
+from msrest import Deserializer, Serializer
+
+from ._configuration_async import AzureTableConfiguration
+from .operations_async import TableOperations
+from .operations_async import ServiceOperations
+from .. import models
+
+
+class AzureTable(object):
+ """AzureTable.
+
+ :ivar table: TableOperations operations
+ :vartype table: azure_table.aio.operations_async.TableOperations
+ :ivar service: ServiceOperations operations
+ :vartype service: azure_table.aio.operations_async.ServiceOperations
+ :param url: The URL of the service account or table that is the targe of the desired operation.
+ :type url: str
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ """
+
+ def __init__(
+ self,
+ url: str,
+ **kwargs: Any
+ ) -> None:
+ base_url = '{url}'
+ self._config = AzureTableConfiguration(url, **kwargs)
+ self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)
+
+ client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
+ self._serialize = Serializer(client_models)
+ self._deserialize = Deserializer(client_models)
+
+ self.table = TableOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+ self.service = ServiceOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+
+ async def close(self) -> None:
+ await self._client.close()
+
+ async def __aenter__(self) -> "AzureTable":
+ await self._client.__aenter__()
+ return self
+
+ async def __aexit__(self, *exc_details) -> None:
+ await self._client.__aexit__(*exc_details)
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/_configuration_async.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/_configuration_async.py
new file mode 100644
index 000000000000..d2581e2463c9
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/_configuration_async.py
@@ -0,0 +1,49 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import Any
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+
+VERSION = "unknown"
+
+class AzureTableConfiguration(Configuration):
+ """Configuration for AzureTable.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param url: The URL of the service account or table that is the targe of the desired operation.
+ :type url: str
+ """
+
+ def __init__(
+ self,
+ url: str,
+ **kwargs: Any
+ ) -> None:
+ if url is None:
+ raise ValueError("Parameter 'url' must not be None.")
+ super(AzureTableConfiguration, self).__init__(**kwargs)
+
+ self.url = url
+ self.version = "2019-02-02"
+ kwargs.setdefault('sdk_moniker', 'azuretable/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/__init__.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/__init__.py
new file mode 100644
index 000000000000..90d9a5059444
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/__init__.py
@@ -0,0 +1,13 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from ._table_operations_async import TableOperations
+from ._service_operations_async import ServiceOperations
+
+__all__ = [
+ 'TableOperations',
+ 'ServiceOperations',
+]
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/_service_operations_async.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/_service_operations_async.py
new file mode 100644
index 000000000000..b9a2d2b3d664
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/_service_operations_async.py
@@ -0,0 +1,246 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import Any, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class ServiceOperations:
+ """ServiceOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~azure_table.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ async def set_properties(
+ self,
+ table_service_properties: "models.TableServiceProperties",
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ **kwargs
+ ) -> None:
+ """Sets properties for an account's Table service endpoint, including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.
+
+ :param table_service_properties: The Table Service properties.
+ :type table_service_properties: ~azure_table.models.TableServiceProperties
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ restype = "service"
+ comp = "properties"
+ content_type = kwargs.pop("content_type", "application/xml")
+
+ # Construct URL
+ url = self.set_properties.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['restype'] = self._serialize.query("restype", restype, 'str')
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(table_service_properties, 'TableServiceProperties', is_xml=True)
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ set_properties.metadata = {'url': '/'} # type: ignore
+
+ async def get_properties(
+ self,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ **kwargs
+ ) -> "models.TableServiceProperties":
+ """Gets the properties of an account's Table service, including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.
+
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableServiceProperties, or the result of cls(response)
+ :rtype: ~azure_table.models.TableServiceProperties
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableServiceProperties"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ restype = "service"
+ comp = "properties"
+
+ # Construct URL
+ url = self.get_properties.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['restype'] = self._serialize.query("restype", restype, 'str')
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Accept'] = 'application/xml'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ deserialized = self._deserialize('TableServiceProperties', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ get_properties.metadata = {'url': '/'} # type: ignore
+
+ async def get_statistics(
+ self,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ **kwargs
+ ) -> "models.TableServiceStats":
+ """Retrieves statistics related to replication for the Table service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the account.
+
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableServiceStats, or the result of cls(response)
+ :rtype: ~azure_table.models.TableServiceStats
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableServiceStats"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ restype = "service"
+ comp = "stats"
+
+ # Construct URL
+ url = self.get_statistics.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['restype'] = self._serialize.query("restype", restype, 'str')
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Accept'] = 'application/xml'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ deserialized = self._deserialize('TableServiceStats', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ get_statistics.metadata = {'url': '/'} # type: ignore
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/_table_operations_async.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/_table_operations_async.py
new file mode 100644
index 000000000000..80d2a09252d7
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations_async/_table_operations_async.py
@@ -0,0 +1,1043 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class TableOperations:
+ """TableOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~azure_table.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ async def query(
+ self,
+ request_id_parameter: Optional[str] = None,
+ next_table_name: Optional[str] = None,
+ query_options: Optional["models.QueryOptions"] = None,
+ **kwargs
+ ) -> "models.TableQueryResponse":
+ """Queries tables under the given account.
+
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param next_table_name: A table query continuation token from a previous call.
+ :type next_table_name: str
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableQueryResponse, or the result of cls(response)
+ :rtype: ~azure_table.models.TableQueryResponse
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableQueryResponse"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ _top = None
+ _select = None
+ _filter = None
+ if query_options is not None:
+ _format = query_options.format
+ _top = query_options.top
+ _select = query_options.select
+ _filter = query_options.filter
+ data_service_version = "3.0"
+
+ # Construct URL
+ url = self.query.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+ if _top is not None:
+ query_parameters['$top'] = self._serialize.query("top", _top, 'int', minimum=0)
+ if _select is not None:
+ query_parameters['$select'] = self._serialize.query("select", _select, 'str')
+ if _filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str')
+ if next_table_name is not None:
+ query_parameters['NextTableName'] = self._serialize.query("next_table_name", next_table_name, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['x-ms-continuation-NextTableName']=self._deserialize('str', response.headers.get('x-ms-continuation-NextTableName'))
+ deserialized = self._deserialize('TableQueryResponse', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ query.metadata = {'url': '/Tables'} # type: ignore
+
+ async def create(
+ self,
+ table_properties: "models.TableProperties",
+ request_id_parameter: Optional[str] = None,
+ response_preference: Optional[Union[str, "models.ResponseFormat"]] = None,
+ query_options: Optional["models.QueryOptions"] = None,
+ **kwargs
+ ) -> "models.TableResponse":
+ """Creates a new table under the given account.
+
+ :param table_properties: The Table properties.
+ :type table_properties: ~azure_table.models.TableProperties
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param response_preference: Specifies whether the response should include the inserted entity
+ in the payload. Possible values are return-no-content and return-content.
+ :type response_preference: str or ~azure_table.models.ResponseFormat
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableResponse, or the result of cls(response)
+ :rtype: ~azure_table.models.TableResponse or None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableResponse"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+ content_type = kwargs.pop("content_type", "application/json;odata=nometadata")
+
+ # Construct URL
+ url = self.create.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ if response_preference is not None:
+ header_parameters['Prefer'] = self._serialize.header("response_preference", response_preference, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(table_properties, 'TableProperties')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [201, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ deserialized = None
+ if response.status_code == 201:
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['Preference-Applied']=self._deserialize('str', response.headers.get('Preference-Applied'))
+ deserialized = self._deserialize('TableResponse', pipeline_response)
+
+ if response.status_code == 204:
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['Preference-Applied']=self._deserialize('str', response.headers.get('Preference-Applied'))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ create.metadata = {'url': '/Tables'} # type: ignore
+
+ async def delete(
+ self,
+ table: str,
+ request_id_parameter: Optional[str] = None,
+ **kwargs
+ ) -> None:
+ """Operation permanently deletes the specified table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ # Construct URL
+ url = self.delete.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ delete.metadata = {'url': '/Tables(\'{table}\')'} # type: ignore
+
+ async def query_entities(
+ self,
+ table: str,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ next_partition_key: Optional[str] = None,
+ next_row_key: Optional[str] = None,
+ query_options: Optional["models.QueryOptions"] = None,
+ **kwargs
+ ) -> "models.TableEntityQueryResponse":
+ """Queries entities in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param next_partition_key: An entity query continuation token from a previous call.
+ :type next_partition_key: str
+ :param next_row_key: An entity query continuation token from a previous call.
+ :type next_row_key: str
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableEntityQueryResponse, or the result of cls(response)
+ :rtype: ~azure_table.models.TableEntityQueryResponse
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableEntityQueryResponse"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ _top = None
+ _select = None
+ _filter = None
+ if query_options is not None:
+ _format = query_options.format
+ _top = query_options.top
+ _select = query_options.select
+ _filter = query_options.filter
+ data_service_version = "3.0"
+
+ # Construct URL
+ url = self.query_entities.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+ if _top is not None:
+ query_parameters['$top'] = self._serialize.query("top", _top, 'int', minimum=0)
+ if _select is not None:
+ query_parameters['$select'] = self._serialize.query("select", _select, 'str')
+ if _filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str')
+ if next_partition_key is not None:
+ query_parameters['NextPartitionKey'] = self._serialize.query("next_partition_key", next_partition_key, 'str')
+ if next_row_key is not None:
+ query_parameters['NextRowKey'] = self._serialize.query("next_row_key", next_row_key, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['x-ms-continuation-NextPartitionKey']=self._deserialize('str', response.headers.get('x-ms-continuation-NextPartitionKey'))
+ response_headers['x-ms-continuation-NextRowKey']=self._deserialize('str', response.headers.get('x-ms-continuation-NextRowKey'))
+ deserialized = self._deserialize('TableEntityQueryResponse', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ query_entities.metadata = {'url': '/{table}()'} # type: ignore
+
+ async def query_entities_with_partition_and_row_key(
+ self,
+ table: str,
+ partition_key: str,
+ row_key: str,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ query_options: Optional["models.QueryOptions"] = None,
+ **kwargs
+ ) -> "models.TableEntityQueryResponse":
+ """Queries entities in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableEntityQueryResponse, or the result of cls(response)
+ :rtype: ~azure_table.models.TableEntityQueryResponse
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableEntityQueryResponse"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ _select = None
+ _filter = None
+ if query_options is not None:
+ _format = query_options.format
+ _select = query_options.select
+ _filter = query_options.filter
+ data_service_version = "3.0"
+
+ # Construct URL
+ url = self.query_entities_with_partition_and_row_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ 'partitionKey': self._serialize.url("partition_key", partition_key, 'str'),
+ 'rowKey': self._serialize.url("row_key", row_key, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+ if _select is not None:
+ query_parameters['$select'] = self._serialize.query("select", _select, 'str')
+ if _filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+ response_headers['x-ms-continuation-NextPartitionKey']=self._deserialize('str', response.headers.get('x-ms-continuation-NextPartitionKey'))
+ response_headers['x-ms-continuation-NextRowKey']=self._deserialize('str', response.headers.get('x-ms-continuation-NextRowKey'))
+ deserialized = self._deserialize('TableEntityQueryResponse', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ query_entities_with_partition_and_row_key.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
+
+ async def update_entity(
+ self,
+ table: str,
+ partition_key: str,
+ row_key: str,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ if_match: Optional[str] = None,
+ table_entity_properties: Optional[Dict[str, object]] = None,
+ query_options: Optional["models.QueryOptions"] = None,
+ **kwargs
+ ) -> None:
+ """Update entity in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param if_match: Match condition for an entity to be updated. If specified and a matching
+ entity is not found, an error will be raised. To force an unconditional update, set to the
+ wildcard character (*). If not specified, an insert will be performed when no existing entity
+ is found to update and a replace will be performed if an existing entity is found.
+ :type if_match: str
+ :param table_entity_properties: The properties for the table entity.
+ :type table_entity_properties: dict[str, object]
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_entity.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ 'partitionKey': self._serialize.url("partition_key", partition_key, 'str'),
+ 'rowKey': self._serialize.url("row_key", row_key, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ if if_match is not None:
+ header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ if table_entity_properties is not None:
+ body_content = self._serialize.body(table_entity_properties, '{object}')
+ else:
+ body_content = None
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ update_entity.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
+
+ async def merge_entity(
+ self,
+ table: str,
+ partition_key: str,
+ row_key: str,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ if_match: Optional[str] = None,
+ table_entity_properties: Optional[Dict[str, object]] = None,
+ query_options: Optional["models.QueryOptions"] = None,
+ **kwargs
+ ) -> None:
+ """Merge entity in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param if_match: Match condition for an entity to be updated. If specified and a matching
+ entity is not found, an error will be raised. To force an unconditional update, set to the
+ wildcard character (*). If not specified, an insert will be performed when no existing entity
+ is found to update and a merge will be performed if an existing entity is found.
+ :type if_match: str
+ :param table_entity_properties: The properties for the table entity.
+ :type table_entity_properties: dict[str, object]
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.merge_entity.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ 'partitionKey': self._serialize.url("partition_key", partition_key, 'str'),
+ 'rowKey': self._serialize.url("row_key", row_key, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ if if_match is not None:
+ header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ if table_entity_properties is not None:
+ body_content = self._serialize.body(table_entity_properties, '{object}')
+ else:
+ body_content = None
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ merge_entity.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
+
+ async def delete_entity(
+ self,
+ table: str,
+ partition_key: str,
+ row_key: str,
+ if_match: str,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ query_options: Optional["models.QueryOptions"] = None,
+ **kwargs
+ ) -> None:
+ """Deletes the specified entity in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param if_match: Match condition for an entity to be deleted. If specified and a matching
+ entity is not found, an error will be raised. To force an unconditional delete, set to the
+ wildcard character (*).
+ :type if_match: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+
+ # Construct URL
+ url = self.delete_entity.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ 'partitionKey': self._serialize.url("partition_key", partition_key, 'str'),
+ 'rowKey': self._serialize.url("row_key", row_key, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ delete_entity.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
+
+ async def insert_entity(
+ self,
+ table: str,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ response_preference: Optional[Union[str, "models.ResponseFormat"]] = None,
+ table_entity_properties: Optional[Dict[str, object]] = None,
+ query_options: Optional["models.QueryOptions"] = None,
+ **kwargs
+ ) -> Dict[str, object]:
+ """Insert entity in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param response_preference: Specifies whether the response should include the inserted entity
+ in the payload. Possible values are return-no-content and return-content.
+ :type response_preference: str or ~azure_table.models.ResponseFormat
+ :param table_entity_properties: The properties for the table entity.
+ :type table_entity_properties: dict[str, object]
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: dict mapping str to object, or the result of cls(response)
+ :rtype: dict[str, object] or None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, object]]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+ content_type = kwargs.pop("content_type", "application/json;odata=nometadata")
+
+ # Construct URL
+ url = self.insert_entity.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ if response_preference is not None:
+ header_parameters['Prefer'] = self._serialize.header("response_preference", response_preference, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ if table_entity_properties is not None:
+ body_content = self._serialize.body(table_entity_properties, '{object}')
+ else:
+ body_content = None
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [201, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ deserialized = None
+ if response.status_code == 201:
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+ response_headers['Preference-Applied']=self._deserialize('str', response.headers.get('Preference-Applied'))
+ response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
+ deserialized = self._deserialize('{object}', pipeline_response)
+
+ if response.status_code == 204:
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+ response_headers['Preference-Applied']=self._deserialize('str', response.headers.get('Preference-Applied'))
+ response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ insert_entity.metadata = {'url': '/{table}'} # type: ignore
+
+ async def get_access_policy(
+ self,
+ table: str,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ **kwargs
+ ) -> List["models.SignedIdentifier"]:
+ """Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures.
+
+ :param table: The name of the table.
+ :type table: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: list of SignedIdentifier, or the result of cls(response)
+ :rtype: list[~azure_table.models.SignedIdentifier]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[List["models.SignedIdentifier"]]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ comp = "acl"
+
+ # Construct URL
+ url = self.get_access_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Accept'] = 'application/xml'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ deserialized = self._deserialize('[SignedIdentifier]', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ get_access_policy.metadata = {'url': '/{table}'} # type: ignore
+
+ async def set_access_policy(
+ self,
+ table: str,
+ timeout: Optional[int] = None,
+ request_id_parameter: Optional[str] = None,
+ table_acl: Optional[List["models.SignedIdentifier"]] = None,
+ **kwargs
+ ) -> None:
+ """Sets stored access policies for the table that may be used with Shared Access Signatures.
+
+ :param table: The name of the table.
+ :type table: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param table_acl: The acls for the table.
+ :type table_acl: list[~azure_table.models.SignedIdentifier]
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ comp = "acl"
+ content_type = kwargs.pop("content_type", "application/xml")
+
+ # Construct URL
+ url = self.set_access_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/xml'
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ serialization_ctxt = {'xml': {'name': 'SignedIdentifiers', 'wrapped': True, 'itemsName': 'SignedIdentifier'}}
+ if table_acl is not None:
+ body_content = self._serialize.body(table_acl, '[SignedIdentifier]', is_xml=True, serialization_ctxt=serialization_ctxt)
+ else:
+ body_content = None
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ set_access_policy.metadata = {'url': '/{table}'} # type: ignore
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/__init__.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/__init__.py
new file mode 100644
index 000000000000..944581fccd98
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/__init__.py
@@ -0,0 +1,68 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+try:
+ from ._models_py3 import AccessPolicy
+ from ._models_py3 import CorsRule
+ from ._models_py3 import GeoReplication
+ from ._models_py3 import Logging
+ from ._models_py3 import Metrics
+ from ._models_py3 import QueryOptions
+ from ._models_py3 import RetentionPolicy
+ from ._models_py3 import SignedIdentifier
+ from ._models_py3 import TableEntityQueryResponse
+ from ._models_py3 import TableProperties
+ from ._models_py3 import TableQueryResponse
+ from ._models_py3 import TableResponse
+ from ._models_py3 import TableResponseProperties
+ from ._models_py3 import TableServiceError
+ from ._models_py3 import TableServiceProperties
+ from ._models_py3 import TableServiceStats
+except (SyntaxError, ImportError):
+ from ._models import AccessPolicy # type: ignore
+ from ._models import CorsRule # type: ignore
+ from ._models import GeoReplication # type: ignore
+ from ._models import Logging # type: ignore
+ from ._models import Metrics # type: ignore
+ from ._models import QueryOptions # type: ignore
+ from ._models import RetentionPolicy # type: ignore
+ from ._models import SignedIdentifier # type: ignore
+ from ._models import TableEntityQueryResponse # type: ignore
+ from ._models import TableProperties # type: ignore
+ from ._models import TableQueryResponse # type: ignore
+ from ._models import TableResponse # type: ignore
+ from ._models import TableResponseProperties # type: ignore
+ from ._models import TableServiceError # type: ignore
+ from ._models import TableServiceProperties # type: ignore
+ from ._models import TableServiceStats # type: ignore
+
+from ._azure_table_enums import (
+ GeoReplicationStatusType,
+ OdataMetadataFormat,
+ ResponseFormat,
+)
+
+__all__ = [
+ 'AccessPolicy',
+ 'CorsRule',
+ 'GeoReplication',
+ 'Logging',
+ 'Metrics',
+ 'QueryOptions',
+ 'RetentionPolicy',
+ 'SignedIdentifier',
+ 'TableEntityQueryResponse',
+ 'TableProperties',
+ 'TableQueryResponse',
+ 'TableResponse',
+ 'TableResponseProperties',
+ 'TableServiceError',
+ 'TableServiceProperties',
+ 'TableServiceStats',
+ 'GeoReplicationStatusType',
+ 'OdataMetadataFormat',
+ 'ResponseFormat',
+]
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_azure_table_enums.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_azure_table_enums.py
new file mode 100644
index 000000000000..ef8e90bd92c9
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_azure_table_enums.py
@@ -0,0 +1,26 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from enum import Enum
+
+class GeoReplicationStatusType(str, Enum):
+ """The status of the secondary location.
+ """
+
+ live = "live"
+ bootstrap = "bootstrap"
+ unavailable = "unavailable"
+
+class OdataMetadataFormat(str, Enum):
+
+ application_json_odata_nometadata = "application/json;odata=nometadata"
+ application_json_odata_minimalmetadata = "application/json;odata=minimalmetadata"
+ application_json_odata_fullmetadata = "application/json;odata=fullmetadata"
+
+class ResponseFormat(str, Enum):
+
+ return_no_content = "return-no-content"
+ return_content = "return-content"
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_models.py
new file mode 100644
index 000000000000..3ca6eee7318e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_models.py
@@ -0,0 +1,539 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+
+class AccessPolicy(msrest.serialization.Model):
+ """An Access policy.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param start: Required. The start datetime from which the policy is active.
+ :type start: ~datetime.datetime
+ :param expiry: Required. The datetime that the policy expires.
+ :type expiry: ~datetime.datetime
+ :param permission: Required. The permissions for the acl policy.
+ :type permission: str
+ """
+
+ _validation = {
+ 'start': {'required': True},
+ 'expiry': {'required': True},
+ 'permission': {'required': True},
+ }
+
+ _attribute_map = {
+ 'start': {'key': 'Start', 'type': 'str', 'xml': {'name': 'Start'}},
+ 'expiry': {'key': 'Expiry', 'type': 'str', 'xml': {'name': 'Expiry'}},
+ 'permission': {'key': 'Permission', 'type': 'str', 'xml': {'name': 'Permission'}},
+ }
+ _xml_map = {
+ 'name': 'AccessPolicy'
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(AccessPolicy, self).__init__(**kwargs)
+ self.start = kwargs['start']
+ self.expiry = kwargs['expiry']
+ self.permission = kwargs['permission']
+
+
+class CorsRule(msrest.serialization.Model):
+ """CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param allowed_origins: Required. The origin domains that are permitted to make a request
+ against the service via CORS. The origin domain is the domain from which the request
+ originates. Note that the origin must be an exact case-sensitive match with the origin that the
+ user age sends to the service. You can also use the wildcard character '*' to allow all origin
+ domains to make requests via CORS.
+ :type allowed_origins: str
+ :param allowed_methods: Required. The methods (HTTP request verbs) that the origin domain may
+ use for a CORS request. (comma separated).
+ :type allowed_methods: str
+ :param allowed_headers: Required. The request headers that the origin domain may specify on the
+ CORS request.
+ :type allowed_headers: str
+ :param exposed_headers: Required. The response headers that may be sent in the response to the
+ CORS request and exposed by the browser to the request issuer.
+ :type exposed_headers: str
+ :param max_age_in_seconds: Required. The maximum amount time that a browser should cache the
+ preflight OPTIONS request.
+ :type max_age_in_seconds: int
+ """
+
+ _validation = {
+ 'allowed_origins': {'required': True},
+ 'allowed_methods': {'required': True},
+ 'allowed_headers': {'required': True},
+ 'exposed_headers': {'required': True},
+ 'max_age_in_seconds': {'required': True, 'minimum': 0},
+ }
+
+ _attribute_map = {
+ 'allowed_origins': {'key': 'AllowedOrigins', 'type': 'str', 'xml': {'name': 'AllowedOrigins'}},
+ 'allowed_methods': {'key': 'AllowedMethods', 'type': 'str', 'xml': {'name': 'AllowedMethods'}},
+ 'allowed_headers': {'key': 'AllowedHeaders', 'type': 'str', 'xml': {'name': 'AllowedHeaders'}},
+ 'exposed_headers': {'key': 'ExposedHeaders', 'type': 'str', 'xml': {'name': 'ExposedHeaders'}},
+ 'max_age_in_seconds': {'key': 'MaxAgeInSeconds', 'type': 'int', 'xml': {'name': 'MaxAgeInSeconds'}},
+ }
+ _xml_map = {
+ 'name': 'CorsRule'
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(CorsRule, self).__init__(**kwargs)
+ self.allowed_origins = kwargs['allowed_origins']
+ self.allowed_methods = kwargs['allowed_methods']
+ self.allowed_headers = kwargs['allowed_headers']
+ self.exposed_headers = kwargs['exposed_headers']
+ self.max_age_in_seconds = kwargs['max_age_in_seconds']
+
+
+class GeoReplication(msrest.serialization.Model):
+ """GeoReplication.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param status: Required. The status of the secondary location. Possible values include: "live",
+ "bootstrap", "unavailable".
+ :type status: str or ~azure_table.models.GeoReplicationStatusType
+ :param last_sync_time: Required. A GMT date/time value, to the second. All primary writes
+ preceding this value are guaranteed to be available for read operations at the secondary.
+ Primary writes after this point in time may or may not be available for reads.
+ :type last_sync_time: ~datetime.datetime
+ """
+
+ _validation = {
+ 'status': {'required': True},
+ 'last_sync_time': {'required': True},
+ }
+
+ _attribute_map = {
+ 'status': {'key': 'Status', 'type': 'str', 'xml': {'name': 'Status'}},
+ 'last_sync_time': {'key': 'LastSyncTime', 'type': 'rfc-1123', 'xml': {'name': 'LastSyncTime'}},
+ }
+ _xml_map = {
+ 'name': 'GeoReplication'
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(GeoReplication, self).__init__(**kwargs)
+ self.status = kwargs['status']
+ self.last_sync_time = kwargs['last_sync_time']
+
+
+class Logging(msrest.serialization.Model):
+ """Azure Analytics Logging settings.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param version: Required. The version of Analytics to configure.
+ :type version: str
+ :param delete: Required. Indicates whether all delete requests should be logged.
+ :type delete: bool
+ :param read: Required. Indicates whether all read requests should be logged.
+ :type read: bool
+ :param write: Required. Indicates whether all write requests should be logged.
+ :type write: bool
+ :param retention_policy: Required. The retention policy.
+ :type retention_policy: ~azure_table.models.RetentionPolicy
+ """
+
+ _validation = {
+ 'version': {'required': True},
+ 'delete': {'required': True},
+ 'read': {'required': True},
+ 'write': {'required': True},
+ 'retention_policy': {'required': True},
+ }
+
+ _attribute_map = {
+ 'version': {'key': 'Version', 'type': 'str', 'xml': {'name': 'Version'}},
+ 'delete': {'key': 'Delete', 'type': 'bool', 'xml': {'name': 'Delete'}},
+ 'read': {'key': 'Read', 'type': 'bool', 'xml': {'name': 'Read'}},
+ 'write': {'key': 'Write', 'type': 'bool', 'xml': {'name': 'Write'}},
+ 'retention_policy': {'key': 'RetentionPolicy', 'type': 'RetentionPolicy'},
+ }
+ _xml_map = {
+ 'name': 'Logging'
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(Logging, self).__init__(**kwargs)
+ self.version = kwargs['version']
+ self.delete = kwargs['delete']
+ self.read = kwargs['read']
+ self.write = kwargs['write']
+ self.retention_policy = kwargs['retention_policy']
+
+
+class Metrics(msrest.serialization.Model):
+ """Metrics.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param version: The version of Analytics to configure.
+ :type version: str
+ :param enabled: Required. Indicates whether metrics are enabled for the Table service.
+ :type enabled: bool
+ :param include_apis: Indicates whether metrics should generate summary statistics for called
+ API operations.
+ :type include_apis: bool
+ :param retention_policy: The retention policy.
+ :type retention_policy: ~azure_table.models.RetentionPolicy
+ """
+
+ _validation = {
+ 'enabled': {'required': True},
+ }
+
+ _attribute_map = {
+ 'version': {'key': 'Version', 'type': 'str', 'xml': {'name': 'Version'}},
+ 'enabled': {'key': 'Enabled', 'type': 'bool', 'xml': {'name': 'Enabled'}},
+ 'include_apis': {'key': 'IncludeAPIs', 'type': 'bool', 'xml': {'name': 'IncludeAPIs'}},
+ 'retention_policy': {'key': 'RetentionPolicy', 'type': 'RetentionPolicy'},
+ }
+ _xml_map = {
+
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(Metrics, self).__init__(**kwargs)
+ self.version = kwargs.get('version', None)
+ self.enabled = kwargs['enabled']
+ self.include_apis = kwargs.get('include_apis', None)
+ self.retention_policy = kwargs.get('retention_policy', None)
+
+
+class QueryOptions(msrest.serialization.Model):
+ """Parameter group.
+
+ :param format: Specifies the media type for the response. Possible values include:
+ "application/json;odata=nometadata", "application/json;odata=minimalmetadata",
+ "application/json;odata=fullmetadata".
+ :type format: str or ~azure_table.models.OdataMetadataFormat
+ :param top: Maximum number of records to return.
+ :type top: int
+ :param select: Select expression using OData notation. Limits the columns on each record to
+ just those requested, e.g. "$select=PolicyAssignmentId, ResourceId".
+ :type select: str
+ :param filter: OData filter expression.
+ :type filter: str
+ """
+
+ _validation = {
+ 'top': {'minimum': 0},
+ }
+
+ _attribute_map = {
+ 'format': {'key': 'Format', 'type': 'str'},
+ 'top': {'key': 'Top', 'type': 'int'},
+ 'select': {'key': 'Select', 'type': 'str'},
+ 'filter': {'key': 'Filter', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(QueryOptions, self).__init__(**kwargs)
+ self.format = kwargs.get('format', None)
+ self.top = kwargs.get('top', None)
+ self.select = kwargs.get('select', None)
+ self.filter = kwargs.get('filter', None)
+
+
+class RetentionPolicy(msrest.serialization.Model):
+ """The retention policy.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param enabled: Required. Indicates whether a retention policy is enabled for the service.
+ :type enabled: bool
+ :param days: Indicates the number of days that metrics or logging or soft-deleted data should
+ be retained. All data older than this value will be deleted.
+ :type days: int
+ """
+
+ _validation = {
+ 'enabled': {'required': True},
+ 'days': {'minimum': 1},
+ }
+
+ _attribute_map = {
+ 'enabled': {'key': 'Enabled', 'type': 'bool', 'xml': {'name': 'Enabled'}},
+ 'days': {'key': 'Days', 'type': 'int', 'xml': {'name': 'Days'}},
+ }
+ _xml_map = {
+ 'name': 'RetentionPolicy'
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(RetentionPolicy, self).__init__(**kwargs)
+ self.enabled = kwargs['enabled']
+ self.days = kwargs.get('days', None)
+
+
+class SignedIdentifier(msrest.serialization.Model):
+ """A signed identifier.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param id: Required. A unique id.
+ :type id: str
+ :param access_policy: Required. The access policy.
+ :type access_policy: ~azure_table.models.AccessPolicy
+ """
+
+ _validation = {
+ 'id': {'required': True},
+ 'access_policy': {'required': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'Id', 'type': 'str', 'xml': {'name': 'Id'}},
+ 'access_policy': {'key': 'AccessPolicy', 'type': 'AccessPolicy'},
+ }
+ _xml_map = {
+ 'name': 'SignedIdentifier'
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(SignedIdentifier, self).__init__(**kwargs)
+ self.id = kwargs['id']
+ self.access_policy = kwargs['access_policy']
+
+
+class TableEntityQueryResponse(msrest.serialization.Model):
+ """The properties for the table entity query response.
+
+ :param odata_metadata: The metadata response of the table.
+ :type odata_metadata: str
+ :param value: List of table entities.
+ :type value: list[dict[str, object]]
+ """
+
+ _attribute_map = {
+ 'odata_metadata': {'key': 'odata\\.metadata', 'type': 'str'},
+ 'value': {'key': 'value', 'type': '[{object}]'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TableEntityQueryResponse, self).__init__(**kwargs)
+ self.odata_metadata = kwargs.get('odata_metadata', None)
+ self.value = kwargs.get('value', None)
+
+
+class TableProperties(msrest.serialization.Model):
+ """The properties for creating a table.
+
+ :param table_name: The name of the table to create.
+ :type table_name: str
+ """
+
+ _attribute_map = {
+ 'table_name': {'key': 'TableName', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TableProperties, self).__init__(**kwargs)
+ self.table_name = kwargs.get('table_name', None)
+
+
+class TableQueryResponse(msrest.serialization.Model):
+ """The properties for the table query response.
+
+ :param odata_metadata: The metadata response of the table.
+ :type odata_metadata: str
+ :param value: List of tables.
+ :type value: list[~azure_table.models.TableResponseProperties]
+ """
+
+ _attribute_map = {
+ 'odata_metadata': {'key': 'odata\\.metadata', 'type': 'str'},
+ 'value': {'key': 'value', 'type': '[TableResponseProperties]'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TableQueryResponse, self).__init__(**kwargs)
+ self.odata_metadata = kwargs.get('odata_metadata', None)
+ self.value = kwargs.get('value', None)
+
+
+class TableResponseProperties(msrest.serialization.Model):
+ """The properties for the table response.
+
+ :param table_name: The name of the table.
+ :type table_name: str
+ :param odata_type: The odata type of the table.
+ :type odata_type: str
+ :param odata_id: The id of the table.
+ :type odata_id: str
+ :param odata_edit_link: The edit link of the table.
+ :type odata_edit_link: str
+ """
+
+ _attribute_map = {
+ 'table_name': {'key': 'TableName', 'type': 'str'},
+ 'odata_type': {'key': 'odata\\.type', 'type': 'str'},
+ 'odata_id': {'key': 'odata\\.id', 'type': 'str'},
+ 'odata_edit_link': {'key': 'odata\\.editLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TableResponseProperties, self).__init__(**kwargs)
+ self.table_name = kwargs.get('table_name', None)
+ self.odata_type = kwargs.get('odata_type', None)
+ self.odata_id = kwargs.get('odata_id', None)
+ self.odata_edit_link = kwargs.get('odata_edit_link', None)
+
+
+class TableResponse(TableResponseProperties):
+ """The response for a single table.
+
+ :param table_name: The name of the table.
+ :type table_name: str
+ :param odata_type: The odata type of the table.
+ :type odata_type: str
+ :param odata_id: The id of the table.
+ :type odata_id: str
+ :param odata_edit_link: The edit link of the table.
+ :type odata_edit_link: str
+ :param odata_metadata: The metadata response of the table.
+ :type odata_metadata: str
+ """
+
+ _attribute_map = {
+ 'table_name': {'key': 'TableName', 'type': 'str'},
+ 'odata_type': {'key': 'odata\\.type', 'type': 'str'},
+ 'odata_id': {'key': 'odata\\.id', 'type': 'str'},
+ 'odata_edit_link': {'key': 'odata\\.editLink', 'type': 'str'},
+ 'odata_metadata': {'key': 'odata\\.metadata', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TableResponse, self).__init__(**kwargs)
+ self.odata_metadata = kwargs.get('odata_metadata', None)
+
+
+class TableServiceError(msrest.serialization.Model):
+ """Table Service error.
+
+ :param message: The error message.
+ :type message: str
+ """
+
+ _attribute_map = {
+ 'message': {'key': 'Message', 'type': 'str', 'xml': {'name': 'Message'}},
+ }
+ _xml_map = {
+
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TableServiceError, self).__init__(**kwargs)
+ self.message = kwargs.get('message', None)
+
+
+class TableServiceProperties(msrest.serialization.Model):
+ """Table Service Properties.
+
+ :param logging: Azure Analytics Logging settings.
+ :type logging: ~azure_table.models.Logging
+ :param hour_metrics: A summary of request statistics grouped by API in hourly aggregates for
+ tables.
+ :type hour_metrics: ~azure_table.models.Metrics
+ :param minute_metrics: A summary of request statistics grouped by API in minute aggregates for
+ tables.
+ :type minute_metrics: ~azure_table.models.Metrics
+ :param cors: The set of CORS rules.
+ :type cors: list[~azure_table.models.CorsRule]
+ """
+
+ _attribute_map = {
+ 'logging': {'key': 'Logging', 'type': 'Logging'},
+ 'hour_metrics': {'key': 'HourMetrics', 'type': 'Metrics'},
+ 'minute_metrics': {'key': 'MinuteMetrics', 'type': 'Metrics'},
+ 'cors': {'key': 'Cors', 'type': '[CorsRule]', 'xml': {'name': 'Cors', 'wrapped': True, 'itemsName': 'CorsRule'}},
+ }
+ _xml_map = {
+ 'name': 'StorageServiceProperties'
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TableServiceProperties, self).__init__(**kwargs)
+ self.logging = kwargs.get('logging', None)
+ self.hour_metrics = kwargs.get('hour_metrics', None)
+ self.minute_metrics = kwargs.get('minute_metrics', None)
+ self.cors = kwargs.get('cors', None)
+
+
+class TableServiceStats(msrest.serialization.Model):
+ """Stats for the service.
+
+ :param geo_replication: Geo-Replication information for the Secondary Storage Service.
+ :type geo_replication: ~azure_table.models.GeoReplication
+ """
+
+ _attribute_map = {
+ 'geo_replication': {'key': 'GeoReplication', 'type': 'GeoReplication'},
+ }
+ _xml_map = {
+ 'name': 'StorageServiceStats'
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TableServiceStats, self).__init__(**kwargs)
+ self.geo_replication = kwargs.get('geo_replication', None)
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_models_py3.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_models_py3.py
new file mode 100644
index 000000000000..001b3ff92b4b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/models/_models_py3.py
@@ -0,0 +1,607 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+import datetime
+from typing import Dict, List, Optional, Union
+
+from azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+from ._azure_table_enums import *
+
+
+class AccessPolicy(msrest.serialization.Model):
+ """An Access policy.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param start: Required. The start datetime from which the policy is active.
+ :type start: ~datetime.datetime
+ :param expiry: Required. The datetime that the policy expires.
+ :type expiry: ~datetime.datetime
+ :param permission: Required. The permissions for the acl policy.
+ :type permission: str
+ """
+
+ _validation = {
+ 'start': {'required': True},
+ 'expiry': {'required': True},
+ 'permission': {'required': True},
+ }
+
+ _attribute_map = {
+ 'start': {'key': 'Start', 'type': 'str', 'xml': {'name': 'Start'}},
+ 'expiry': {'key': 'Expiry', 'type': 'str', 'xml': {'name': 'Expiry'}},
+ 'permission': {'key': 'Permission', 'type': 'str', 'xml': {'name': 'Permission'}},
+ }
+ _xml_map = {
+ 'name': 'AccessPolicy'
+ }
+
+ def __init__(
+ self,
+ *,
+ start: datetime.datetime,
+ expiry: datetime.datetime,
+ permission: str,
+ **kwargs
+ ):
+ super(AccessPolicy, self).__init__(**kwargs)
+ self.start = start
+ self.expiry = expiry
+ self.permission = permission
+
+
+class CorsRule(msrest.serialization.Model):
+ """CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param allowed_origins: Required. The origin domains that are permitted to make a request
+ against the service via CORS. The origin domain is the domain from which the request
+ originates. Note that the origin must be an exact case-sensitive match with the origin that the
+ user age sends to the service. You can also use the wildcard character '*' to allow all origin
+ domains to make requests via CORS.
+ :type allowed_origins: str
+ :param allowed_methods: Required. The methods (HTTP request verbs) that the origin domain may
+ use for a CORS request. (comma separated).
+ :type allowed_methods: str
+ :param allowed_headers: Required. The request headers that the origin domain may specify on the
+ CORS request.
+ :type allowed_headers: str
+ :param exposed_headers: Required. The response headers that may be sent in the response to the
+ CORS request and exposed by the browser to the request issuer.
+ :type exposed_headers: str
+ :param max_age_in_seconds: Required. The maximum amount time that a browser should cache the
+ preflight OPTIONS request.
+ :type max_age_in_seconds: int
+ """
+
+ _validation = {
+ 'allowed_origins': {'required': True},
+ 'allowed_methods': {'required': True},
+ 'allowed_headers': {'required': True},
+ 'exposed_headers': {'required': True},
+ 'max_age_in_seconds': {'required': True, 'minimum': 0},
+ }
+
+ _attribute_map = {
+ 'allowed_origins': {'key': 'AllowedOrigins', 'type': 'str', 'xml': {'name': 'AllowedOrigins'}},
+ 'allowed_methods': {'key': 'AllowedMethods', 'type': 'str', 'xml': {'name': 'AllowedMethods'}},
+ 'allowed_headers': {'key': 'AllowedHeaders', 'type': 'str', 'xml': {'name': 'AllowedHeaders'}},
+ 'exposed_headers': {'key': 'ExposedHeaders', 'type': 'str', 'xml': {'name': 'ExposedHeaders'}},
+ 'max_age_in_seconds': {'key': 'MaxAgeInSeconds', 'type': 'int', 'xml': {'name': 'MaxAgeInSeconds'}},
+ }
+ _xml_map = {
+ 'name': 'CorsRule'
+ }
+
+ def __init__(
+ self,
+ *,
+ allowed_origins: str,
+ allowed_methods: str,
+ allowed_headers: str,
+ exposed_headers: str,
+ max_age_in_seconds: int,
+ **kwargs
+ ):
+ super(CorsRule, self).__init__(**kwargs)
+ self.allowed_origins = allowed_origins
+ self.allowed_methods = allowed_methods
+ self.allowed_headers = allowed_headers
+ self.exposed_headers = exposed_headers
+ self.max_age_in_seconds = max_age_in_seconds
+
+
+class GeoReplication(msrest.serialization.Model):
+ """GeoReplication.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param status: Required. The status of the secondary location. Possible values include: "live",
+ "bootstrap", "unavailable".
+ :type status: str or ~azure_table.models.GeoReplicationStatusType
+ :param last_sync_time: Required. A GMT date/time value, to the second. All primary writes
+ preceding this value are guaranteed to be available for read operations at the secondary.
+ Primary writes after this point in time may or may not be available for reads.
+ :type last_sync_time: ~datetime.datetime
+ """
+
+ _validation = {
+ 'status': {'required': True},
+ 'last_sync_time': {'required': True},
+ }
+
+ _attribute_map = {
+ 'status': {'key': 'Status', 'type': 'str', 'xml': {'name': 'Status'}},
+ 'last_sync_time': {'key': 'LastSyncTime', 'type': 'rfc-1123', 'xml': {'name': 'LastSyncTime'}},
+ }
+ _xml_map = {
+ 'name': 'GeoReplication'
+ }
+
+ def __init__(
+ self,
+ *,
+ status: Union[str, "GeoReplicationStatusType"],
+ last_sync_time: datetime.datetime,
+ **kwargs
+ ):
+ super(GeoReplication, self).__init__(**kwargs)
+ self.status = status
+ self.last_sync_time = last_sync_time
+
+
+class Logging(msrest.serialization.Model):
+ """Azure Analytics Logging settings.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param version: Required. The version of Analytics to configure.
+ :type version: str
+ :param delete: Required. Indicates whether all delete requests should be logged.
+ :type delete: bool
+ :param read: Required. Indicates whether all read requests should be logged.
+ :type read: bool
+ :param write: Required. Indicates whether all write requests should be logged.
+ :type write: bool
+ :param retention_policy: Required. The retention policy.
+ :type retention_policy: ~azure_table.models.RetentionPolicy
+ """
+
+ _validation = {
+ 'version': {'required': True},
+ 'delete': {'required': True},
+ 'read': {'required': True},
+ 'write': {'required': True},
+ 'retention_policy': {'required': True},
+ }
+
+ _attribute_map = {
+ 'version': {'key': 'Version', 'type': 'str', 'xml': {'name': 'Version'}},
+ 'delete': {'key': 'Delete', 'type': 'bool', 'xml': {'name': 'Delete'}},
+ 'read': {'key': 'Read', 'type': 'bool', 'xml': {'name': 'Read'}},
+ 'write': {'key': 'Write', 'type': 'bool', 'xml': {'name': 'Write'}},
+ 'retention_policy': {'key': 'RetentionPolicy', 'type': 'RetentionPolicy'},
+ }
+ _xml_map = {
+ 'name': 'Logging'
+ }
+
+ def __init__(
+ self,
+ *,
+ version: str,
+ delete: bool,
+ read: bool,
+ write: bool,
+ retention_policy: "RetentionPolicy",
+ **kwargs
+ ):
+ super(Logging, self).__init__(**kwargs)
+ self.version = version
+ self.delete = delete
+ self.read = read
+ self.write = write
+ self.retention_policy = retention_policy
+
+
+class Metrics(msrest.serialization.Model):
+ """Metrics.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param version: The version of Analytics to configure.
+ :type version: str
+ :param enabled: Required. Indicates whether metrics are enabled for the Table service.
+ :type enabled: bool
+ :param include_apis: Indicates whether metrics should generate summary statistics for called
+ API operations.
+ :type include_apis: bool
+ :param retention_policy: The retention policy.
+ :type retention_policy: ~azure_table.models.RetentionPolicy
+ """
+
+ _validation = {
+ 'enabled': {'required': True},
+ }
+
+ _attribute_map = {
+ 'version': {'key': 'Version', 'type': 'str', 'xml': {'name': 'Version'}},
+ 'enabled': {'key': 'Enabled', 'type': 'bool', 'xml': {'name': 'Enabled'}},
+ 'include_apis': {'key': 'IncludeAPIs', 'type': 'bool', 'xml': {'name': 'IncludeAPIs'}},
+ 'retention_policy': {'key': 'RetentionPolicy', 'type': 'RetentionPolicy'},
+ }
+ _xml_map = {
+
+ }
+
+ def __init__(
+ self,
+ *,
+ enabled: bool,
+ version: Optional[str] = None,
+ include_apis: Optional[bool] = None,
+ retention_policy: Optional["RetentionPolicy"] = None,
+ **kwargs
+ ):
+ super(Metrics, self).__init__(**kwargs)
+ self.version = version
+ self.enabled = enabled
+ self.include_apis = include_apis
+ self.retention_policy = retention_policy
+
+
+class QueryOptions(msrest.serialization.Model):
+ """Parameter group.
+
+ :param format: Specifies the media type for the response. Possible values include:
+ "application/json;odata=nometadata", "application/json;odata=minimalmetadata",
+ "application/json;odata=fullmetadata".
+ :type format: str or ~azure_table.models.OdataMetadataFormat
+ :param top: Maximum number of records to return.
+ :type top: int
+ :param select: Select expression using OData notation. Limits the columns on each record to
+ just those requested, e.g. "$select=PolicyAssignmentId, ResourceId".
+ :type select: str
+ :param filter: OData filter expression.
+ :type filter: str
+ """
+
+ _validation = {
+ 'top': {'minimum': 0},
+ }
+
+ _attribute_map = {
+ 'format': {'key': 'Format', 'type': 'str'},
+ 'top': {'key': 'Top', 'type': 'int'},
+ 'select': {'key': 'Select', 'type': 'str'},
+ 'filter': {'key': 'Filter', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ format: Optional[Union[str, "OdataMetadataFormat"]] = None,
+ top: Optional[int] = None,
+ select: Optional[str] = None,
+ filter: Optional[str] = None,
+ **kwargs
+ ):
+ super(QueryOptions, self).__init__(**kwargs)
+ self.format = format
+ self.top = top
+ self.select = select
+ self.filter = filter
+
+
+class RetentionPolicy(msrest.serialization.Model):
+ """The retention policy.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param enabled: Required. Indicates whether a retention policy is enabled for the service.
+ :type enabled: bool
+ :param days: Indicates the number of days that metrics or logging or soft-deleted data should
+ be retained. All data older than this value will be deleted.
+ :type days: int
+ """
+
+ _validation = {
+ 'enabled': {'required': True},
+ 'days': {'minimum': 1},
+ }
+
+ _attribute_map = {
+ 'enabled': {'key': 'Enabled', 'type': 'bool', 'xml': {'name': 'Enabled'}},
+ 'days': {'key': 'Days', 'type': 'int', 'xml': {'name': 'Days'}},
+ }
+ _xml_map = {
+ 'name': 'RetentionPolicy'
+ }
+
+ def __init__(
+ self,
+ *,
+ enabled: bool,
+ days: Optional[int] = None,
+ **kwargs
+ ):
+ super(RetentionPolicy, self).__init__(**kwargs)
+ self.enabled = enabled
+ self.days = days
+
+
+class SignedIdentifier(msrest.serialization.Model):
+ """A signed identifier.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param id: Required. A unique id.
+ :type id: str
+ :param access_policy: Required. The access policy.
+ :type access_policy: ~azure_table.models.AccessPolicy
+ """
+
+ _validation = {
+ 'id': {'required': True},
+ 'access_policy': {'required': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'Id', 'type': 'str', 'xml': {'name': 'Id'}},
+ 'access_policy': {'key': 'AccessPolicy', 'type': 'AccessPolicy'},
+ }
+ _xml_map = {
+ 'name': 'SignedIdentifier'
+ }
+
+ def __init__(
+ self,
+ *,
+ id: str,
+ access_policy: "AccessPolicy",
+ **kwargs
+ ):
+ super(SignedIdentifier, self).__init__(**kwargs)
+ self.id = id
+ self.access_policy = access_policy
+
+
+class TableEntityQueryResponse(msrest.serialization.Model):
+ """The properties for the table entity query response.
+
+ :param odata_metadata: The metadata response of the table.
+ :type odata_metadata: str
+ :param value: List of table entities.
+ :type value: list[dict[str, object]]
+ """
+
+ _attribute_map = {
+ 'odata_metadata': {'key': 'odata\\.metadata', 'type': 'str'},
+ 'value': {'key': 'value', 'type': '[{object}]'},
+ }
+
+ def __init__(
+ self,
+ *,
+ odata_metadata: Optional[str] = None,
+ value: Optional[List[Dict[str, object]]] = None,
+ **kwargs
+ ):
+ super(TableEntityQueryResponse, self).__init__(**kwargs)
+ self.odata_metadata = odata_metadata
+ self.value = value
+
+
+class TableProperties(msrest.serialization.Model):
+ """The properties for creating a table.
+
+ :param table_name: The name of the table to create.
+ :type table_name: str
+ """
+
+ _attribute_map = {
+ 'table_name': {'key': 'TableName', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ table_name: Optional[str] = None,
+ **kwargs
+ ):
+ super(TableProperties, self).__init__(**kwargs)
+ self.table_name = table_name
+
+
+class TableQueryResponse(msrest.serialization.Model):
+ """The properties for the table query response.
+
+ :param odata_metadata: The metadata response of the table.
+ :type odata_metadata: str
+ :param value: List of tables.
+ :type value: list[~azure_table.models.TableResponseProperties]
+ """
+
+ _attribute_map = {
+ 'odata_metadata': {'key': 'odata\\.metadata', 'type': 'str'},
+ 'value': {'key': 'value', 'type': '[TableResponseProperties]'},
+ }
+
+ def __init__(
+ self,
+ *,
+ odata_metadata: Optional[str] = None,
+ value: Optional[List["TableResponseProperties"]] = None,
+ **kwargs
+ ):
+ super(TableQueryResponse, self).__init__(**kwargs)
+ self.odata_metadata = odata_metadata
+ self.value = value
+
+
+class TableResponseProperties(msrest.serialization.Model):
+ """The properties for the table response.
+
+ :param table_name: The name of the table.
+ :type table_name: str
+ :param odata_type: The odata type of the table.
+ :type odata_type: str
+ :param odata_id: The id of the table.
+ :type odata_id: str
+ :param odata_edit_link: The edit link of the table.
+ :type odata_edit_link: str
+ """
+
+ _attribute_map = {
+ 'table_name': {'key': 'TableName', 'type': 'str'},
+ 'odata_type': {'key': 'odata\\.type', 'type': 'str'},
+ 'odata_id': {'key': 'odata\\.id', 'type': 'str'},
+ 'odata_edit_link': {'key': 'odata\\.editLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ table_name: Optional[str] = None,
+ odata_type: Optional[str] = None,
+ odata_id: Optional[str] = None,
+ odata_edit_link: Optional[str] = None,
+ **kwargs
+ ):
+ super(TableResponseProperties, self).__init__(**kwargs)
+ self.table_name = table_name
+ self.odata_type = odata_type
+ self.odata_id = odata_id
+ self.odata_edit_link = odata_edit_link
+
+
+class TableResponse(TableResponseProperties):
+ """The response for a single table.
+
+ :param table_name: The name of the table.
+ :type table_name: str
+ :param odata_type: The odata type of the table.
+ :type odata_type: str
+ :param odata_id: The id of the table.
+ :type odata_id: str
+ :param odata_edit_link: The edit link of the table.
+ :type odata_edit_link: str
+ :param odata_metadata: The metadata response of the table.
+ :type odata_metadata: str
+ """
+
+ _attribute_map = {
+ 'table_name': {'key': 'TableName', 'type': 'str'},
+ 'odata_type': {'key': 'odata\\.type', 'type': 'str'},
+ 'odata_id': {'key': 'odata\\.id', 'type': 'str'},
+ 'odata_edit_link': {'key': 'odata\\.editLink', 'type': 'str'},
+ 'odata_metadata': {'key': 'odata\\.metadata', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ table_name: Optional[str] = None,
+ odata_type: Optional[str] = None,
+ odata_id: Optional[str] = None,
+ odata_edit_link: Optional[str] = None,
+ odata_metadata: Optional[str] = None,
+ **kwargs
+ ):
+ super(TableResponse, self).__init__(table_name=table_name, odata_type=odata_type, odata_id=odata_id, odata_edit_link=odata_edit_link, **kwargs)
+ self.odata_metadata = odata_metadata
+
+
+class TableServiceError(msrest.serialization.Model):
+ """Table Service error.
+
+ :param message: The error message.
+ :type message: str
+ """
+
+ _attribute_map = {
+ 'message': {'key': 'Message', 'type': 'str', 'xml': {'name': 'Message'}},
+ }
+ _xml_map = {
+
+ }
+
+ def __init__(
+ self,
+ *,
+ message: Optional[str] = None,
+ **kwargs
+ ):
+ super(TableServiceError, self).__init__(**kwargs)
+ self.message = message
+
+
+class TableServiceProperties(msrest.serialization.Model):
+ """Table Service Properties.
+
+ :param logging: Azure Analytics Logging settings.
+ :type logging: ~azure_table.models.Logging
+ :param hour_metrics: A summary of request statistics grouped by API in hourly aggregates for
+ tables.
+ :type hour_metrics: ~azure_table.models.Metrics
+ :param minute_metrics: A summary of request statistics grouped by API in minute aggregates for
+ tables.
+ :type minute_metrics: ~azure_table.models.Metrics
+ :param cors: The set of CORS rules.
+ :type cors: list[~azure_table.models.CorsRule]
+ """
+
+ _attribute_map = {
+ 'logging': {'key': 'Logging', 'type': 'Logging'},
+ 'hour_metrics': {'key': 'HourMetrics', 'type': 'Metrics'},
+ 'minute_metrics': {'key': 'MinuteMetrics', 'type': 'Metrics'},
+ 'cors': {'key': 'Cors', 'type': '[CorsRule]', 'xml': {'name': 'Cors', 'wrapped': True, 'itemsName': 'CorsRule'}},
+ }
+ _xml_map = {
+ 'name': 'StorageServiceProperties'
+ }
+
+ def __init__(
+ self,
+ *,
+ logging: Optional["Logging"] = None,
+ hour_metrics: Optional["Metrics"] = None,
+ minute_metrics: Optional["Metrics"] = None,
+ cors: Optional[List["CorsRule"]] = None,
+ **kwargs
+ ):
+ super(TableServiceProperties, self).__init__(**kwargs)
+ self.logging = logging
+ self.hour_metrics = hour_metrics
+ self.minute_metrics = minute_metrics
+ self.cors = cors
+
+
+class TableServiceStats(msrest.serialization.Model):
+ """Stats for the service.
+
+ :param geo_replication: Geo-Replication information for the Secondary Storage Service.
+ :type geo_replication: ~azure_table.models.GeoReplication
+ """
+
+ _attribute_map = {
+ 'geo_replication': {'key': 'GeoReplication', 'type': 'GeoReplication'},
+ }
+ _xml_map = {
+ 'name': 'StorageServiceStats'
+ }
+
+ def __init__(
+ self,
+ *,
+ geo_replication: Optional["GeoReplication"] = None,
+ **kwargs
+ ):
+ super(TableServiceStats, self).__init__(**kwargs)
+ self.geo_replication = geo_replication
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/__init__.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/__init__.py
new file mode 100644
index 000000000000..1298fa41c6f8
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/__init__.py
@@ -0,0 +1,13 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from ._table_operations import TableOperations
+from ._service_operations import ServiceOperations
+
+__all__ = [
+ 'TableOperations',
+ 'ServiceOperations',
+]
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_service_operations.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_service_operations.py
new file mode 100644
index 000000000000..be2f182e168a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_service_operations.py
@@ -0,0 +1,253 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class ServiceOperations(object):
+ """ServiceOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~azure_table.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def set_properties(
+ self,
+ table_service_properties, # type: "models.TableServiceProperties"
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Sets properties for an account's Table service endpoint, including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.
+
+ :param table_service_properties: The Table Service properties.
+ :type table_service_properties: ~azure_table.models.TableServiceProperties
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ restype = "service"
+ comp = "properties"
+ content_type = kwargs.pop("content_type", "application/xml")
+
+ # Construct URL
+ url = self.set_properties.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['restype'] = self._serialize.query("restype", restype, 'str')
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(table_service_properties, 'TableServiceProperties', is_xml=True)
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ set_properties.metadata = {'url': '/'} # type: ignore
+
+ def get_properties(
+ self,
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.TableServiceProperties"
+ """Gets the properties of an account's Table service, including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.
+
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableServiceProperties, or the result of cls(response)
+ :rtype: ~azure_table.models.TableServiceProperties
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableServiceProperties"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ restype = "service"
+ comp = "properties"
+
+ # Construct URL
+ url = self.get_properties.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['restype'] = self._serialize.query("restype", restype, 'str')
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Accept'] = 'application/xml'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ deserialized = self._deserialize('TableServiceProperties', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ get_properties.metadata = {'url': '/'} # type: ignore
+
+ def get_statistics(
+ self,
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.TableServiceStats"
+ """Retrieves statistics related to replication for the Table service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the account.
+
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableServiceStats, or the result of cls(response)
+ :rtype: ~azure_table.models.TableServiceStats
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableServiceStats"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ restype = "service"
+ comp = "stats"
+
+ # Construct URL
+ url = self.get_statistics.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['restype'] = self._serialize.query("restype", restype, 'str')
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Accept'] = 'application/xml'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ deserialized = self._deserialize('TableServiceStats', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ get_statistics.metadata = {'url': '/'} # type: ignore
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_table_operations.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_table_operations.py
new file mode 100644
index 000000000000..9686ea544832
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_table_operations.py
@@ -0,0 +1,1058 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator})
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class TableOperations(object):
+ """TableOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~azure_table.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def query(
+ self,
+ request_id_parameter=None, # type: Optional[str]
+ next_table_name=None, # type: Optional[str]
+ query_options=None, # type: Optional["models.QueryOptions"]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.TableQueryResponse"
+ """Queries tables under the given account.
+
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param next_table_name: A table query continuation token from a previous call.
+ :type next_table_name: str
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableQueryResponse, or the result of cls(response)
+ :rtype: ~azure_table.models.TableQueryResponse
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableQueryResponse"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ _top = None
+ _select = None
+ _filter = None
+ if query_options is not None:
+ _format = query_options.format
+ _top = query_options.top
+ _select = query_options.select
+ _filter = query_options.filter
+ data_service_version = "3.0"
+
+ # Construct URL
+ url = self.query.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+ if _top is not None:
+ query_parameters['$top'] = self._serialize.query("top", _top, 'int', minimum=0)
+ if _select is not None:
+ query_parameters['$select'] = self._serialize.query("select", _select, 'str')
+ if _filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str')
+ if next_table_name is not None:
+ query_parameters['NextTableName'] = self._serialize.query("next_table_name", next_table_name, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['x-ms-continuation-NextTableName']=self._deserialize('str', response.headers.get('x-ms-continuation-NextTableName'))
+ deserialized = self._deserialize('TableQueryResponse', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ query.metadata = {'url': '/Tables'} # type: ignore
+
+ def create(
+ self,
+ table_properties, # type: "models.TableProperties"
+ request_id_parameter=None, # type: Optional[str]
+ response_preference=None, # type: Optional[Union[str, "models.ResponseFormat"]]
+ query_options=None, # type: Optional["models.QueryOptions"]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.TableResponse"
+ """Creates a new table under the given account.
+
+ :param table_properties: The Table properties.
+ :type table_properties: ~azure_table.models.TableProperties
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param response_preference: Specifies whether the response should include the inserted entity
+ in the payload. Possible values are return-no-content and return-content.
+ :type response_preference: str or ~azure_table.models.ResponseFormat
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableResponse, or the result of cls(response)
+ :rtype: ~azure_table.models.TableResponse or None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableResponse"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+ content_type = kwargs.pop("content_type", "application/json;odata=nometadata")
+
+ # Construct URL
+ url = self.create.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ if response_preference is not None:
+ header_parameters['Prefer'] = self._serialize.header("response_preference", response_preference, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(table_properties, 'TableProperties')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [201, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ deserialized = None
+ if response.status_code == 201:
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['Preference-Applied']=self._deserialize('str', response.headers.get('Preference-Applied'))
+ deserialized = self._deserialize('TableResponse', pipeline_response)
+
+ if response.status_code == 204:
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['Preference-Applied']=self._deserialize('str', response.headers.get('Preference-Applied'))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ create.metadata = {'url': '/Tables'} # type: ignore
+
+ def delete(
+ self,
+ table, # type: str
+ request_id_parameter=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Operation permanently deletes the specified table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ # Construct URL
+ url = self.delete.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ delete.metadata = {'url': '/Tables(\'{table}\')'} # type: ignore
+
+ def query_entities(
+ self,
+ table, # type: str
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ next_partition_key=None, # type: Optional[str]
+ next_row_key=None, # type: Optional[str]
+ query_options=None, # type: Optional["models.QueryOptions"]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.TableEntityQueryResponse"
+ """Queries entities in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param next_partition_key: An entity query continuation token from a previous call.
+ :type next_partition_key: str
+ :param next_row_key: An entity query continuation token from a previous call.
+ :type next_row_key: str
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableEntityQueryResponse, or the result of cls(response)
+ :rtype: ~azure_table.models.TableEntityQueryResponse
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableEntityQueryResponse"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ _top = None
+ _select = None
+ _filter = None
+ if query_options is not None:
+ _format = query_options.format
+ _top = query_options.top
+ _select = query_options.select
+ _filter = query_options.filter
+ data_service_version = "3.0"
+
+ # Construct URL
+ url = self.query_entities.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+ if _top is not None:
+ query_parameters['$top'] = self._serialize.query("top", _top, 'int', minimum=0)
+ if _select is not None:
+ query_parameters['$select'] = self._serialize.query("select", _select, 'str')
+ if _filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str')
+ if next_partition_key is not None:
+ query_parameters['NextPartitionKey'] = self._serialize.query("next_partition_key", next_partition_key, 'str')
+ if next_row_key is not None:
+ query_parameters['NextRowKey'] = self._serialize.query("next_row_key", next_row_key, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['x-ms-continuation-NextPartitionKey']=self._deserialize('str', response.headers.get('x-ms-continuation-NextPartitionKey'))
+ response_headers['x-ms-continuation-NextRowKey']=self._deserialize('str', response.headers.get('x-ms-continuation-NextRowKey'))
+ deserialized = self._deserialize('TableEntityQueryResponse', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ query_entities.metadata = {'url': '/{table}()'} # type: ignore
+
+ def query_entities_with_partition_and_row_key(
+ self,
+ table, # type: str
+ partition_key, # type: str
+ row_key, # type: str
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ query_options=None, # type: Optional["models.QueryOptions"]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.TableEntityQueryResponse"
+ """Queries entities in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableEntityQueryResponse, or the result of cls(response)
+ :rtype: ~azure_table.models.TableEntityQueryResponse
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TableEntityQueryResponse"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ _select = None
+ _filter = None
+ if query_options is not None:
+ _format = query_options.format
+ _select = query_options.select
+ _filter = query_options.filter
+ data_service_version = "3.0"
+
+ # Construct URL
+ url = self.query_entities_with_partition_and_row_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ 'partitionKey': self._serialize.url("partition_key", partition_key, 'str'),
+ 'rowKey': self._serialize.url("row_key", row_key, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+ if _select is not None:
+ query_parameters['$select'] = self._serialize.query("select", _select, 'str')
+ if _filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+ response_headers['x-ms-continuation-NextPartitionKey']=self._deserialize('str', response.headers.get('x-ms-continuation-NextPartitionKey'))
+ response_headers['x-ms-continuation-NextRowKey']=self._deserialize('str', response.headers.get('x-ms-continuation-NextRowKey'))
+ deserialized = self._deserialize('TableEntityQueryResponse', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ query_entities_with_partition_and_row_key.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
+
+ def update_entity(
+ self,
+ table, # type: str
+ partition_key, # type: str
+ row_key, # type: str
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ if_match=None, # type: Optional[str]
+ table_entity_properties=None, # type: Optional[Dict[str, object]]
+ query_options=None, # type: Optional["models.QueryOptions"]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Update entity in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param if_match: Match condition for an entity to be updated. If specified and a matching
+ entity is not found, an error will be raised. To force an unconditional update, set to the
+ wildcard character (*). If not specified, an insert will be performed when no existing entity
+ is found to update and a replace will be performed if an existing entity is found.
+ :type if_match: str
+ :param table_entity_properties: The properties for the table entity.
+ :type table_entity_properties: dict[str, object]
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_entity.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ 'partitionKey': self._serialize.url("partition_key", partition_key, 'str'),
+ 'rowKey': self._serialize.url("row_key", row_key, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ if if_match is not None:
+ header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ if table_entity_properties is not None:
+ body_content = self._serialize.body(table_entity_properties, '{object}')
+ else:
+ body_content = None
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ update_entity.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
+
+ def merge_entity(
+ self,
+ table, # type: str
+ partition_key, # type: str
+ row_key, # type: str
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ if_match=None, # type: Optional[str]
+ table_entity_properties=None, # type: Optional[Dict[str, object]]
+ query_options=None, # type: Optional["models.QueryOptions"]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Merge entity in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param if_match: Match condition for an entity to be updated. If specified and a matching
+ entity is not found, an error will be raised. To force an unconditional update, set to the
+ wildcard character (*). If not specified, an insert will be performed when no existing entity
+ is found to update and a merge will be performed if an existing entity is found.
+ :type if_match: str
+ :param table_entity_properties: The properties for the table entity.
+ :type table_entity_properties: dict[str, object]
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.merge_entity.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ 'partitionKey': self._serialize.url("partition_key", partition_key, 'str'),
+ 'rowKey': self._serialize.url("row_key", row_key, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ if if_match is not None:
+ header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ if table_entity_properties is not None:
+ body_content = self._serialize.body(table_entity_properties, '{object}')
+ else:
+ body_content = None
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ merge_entity.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
+
+ def delete_entity(
+ self,
+ table, # type: str
+ partition_key, # type: str
+ row_key, # type: str
+ if_match, # type: str
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ query_options=None, # type: Optional["models.QueryOptions"]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Deletes the specified entity in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param if_match: Match condition for an entity to be deleted. If specified and a matching
+ entity is not found, an error will be raised. To force an unconditional delete, set to the
+ wildcard character (*).
+ :type if_match: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+
+ # Construct URL
+ url = self.delete_entity.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ 'partitionKey': self._serialize.url("partition_key", partition_key, 'str'),
+ 'rowKey': self._serialize.url("row_key", row_key, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ delete_entity.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
+
+ def insert_entity(
+ self,
+ table, # type: str
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ response_preference=None, # type: Optional[Union[str, "models.ResponseFormat"]]
+ table_entity_properties=None, # type: Optional[Dict[str, object]]
+ query_options=None, # type: Optional["models.QueryOptions"]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Dict[str, object]
+ """Insert entity in a table.
+
+ :param table: The name of the table.
+ :type table: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param response_preference: Specifies whether the response should include the inserted entity
+ in the payload. Possible values are return-no-content and return-content.
+ :type response_preference: str or ~azure_table.models.ResponseFormat
+ :param table_entity_properties: The properties for the table entity.
+ :type table_entity_properties: dict[str, object]
+ :param query_options: Parameter group.
+ :type query_options: ~azure_table.models.QueryOptions
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: dict mapping str to object, or the result of cls(response)
+ :rtype: dict[str, object] or None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, object]]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+
+ _format = None
+ if query_options is not None:
+ _format = query_options.format
+ data_service_version = "3.0"
+ content_type = kwargs.pop("content_type", "application/json;odata=nometadata")
+
+ # Construct URL
+ url = self.insert_entity.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ if _format is not None:
+ query_parameters['$format'] = self._serialize.query("format", _format, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['DataServiceVersion'] = self._serialize.header("data_service_version", data_service_version, 'str')
+ if response_preference is not None:
+ header_parameters['Prefer'] = self._serialize.header("response_preference", response_preference, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json;odata=minimalmetadata'
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ if table_entity_properties is not None:
+ body_content = self._serialize.body(table_entity_properties, '{object}')
+ else:
+ body_content = None
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [201, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ deserialized = None
+ if response.status_code == 201:
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+ response_headers['Preference-Applied']=self._deserialize('str', response.headers.get('Preference-Applied'))
+ response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
+ deserialized = self._deserialize('{object}', pipeline_response)
+
+ if response.status_code == 204:
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
+ response_headers['Preference-Applied']=self._deserialize('str', response.headers.get('Preference-Applied'))
+ response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ insert_entity.metadata = {'url': '/{table}'} # type: ignore
+
+ def get_access_policy(
+ self,
+ table, # type: str
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> List["models.SignedIdentifier"]
+ """Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures.
+
+ :param table: The name of the table.
+ :type table: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: list of SignedIdentifier, or the result of cls(response)
+ :rtype: list[~azure_table.models.SignedIdentifier]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[List["models.SignedIdentifier"]]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ comp = "acl"
+
+ # Construct URL
+ url = self.get_access_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Accept'] = 'application/xml'
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+ deserialized = self._deserialize('[SignedIdentifier]', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ get_access_policy.metadata = {'url': '/{table}'} # type: ignore
+
+ def set_access_policy(
+ self,
+ table, # type: str
+ timeout=None, # type: Optional[int]
+ request_id_parameter=None, # type: Optional[str]
+ table_acl=None, # type: Optional[List["models.SignedIdentifier"]]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Sets stored access policies for the table that may be used with Shared Access Signatures.
+
+ :param table: The name of the table.
+ :type table: str
+ :param timeout: The timeout parameter is expressed in seconds.
+ :type timeout: int
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
+ limit that is recorded in the analytics logs when analytics logging is enabled.
+ :type request_id_parameter: str
+ :param table_acl: The acls for the table.
+ :type table_acl: list[~azure_table.models.SignedIdentifier]
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ comp = "acl"
+ content_type = kwargs.pop("content_type", "application/xml")
+
+ # Construct URL
+ url = self.set_access_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
+ 'table': self._serialize.url("table", table, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if timeout is not None:
+ query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0)
+ query_parameters['comp'] = self._serialize.query("comp", comp, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str')
+ if request_id_parameter is not None:
+ header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id_parameter", request_id_parameter, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/xml'
+
+ # Construct and send request
+ body_content_kwargs = {} # type: Dict[str, Any]
+ serialization_ctxt = {'xml': {'name': 'SignedIdentifiers', 'wrapped': True, 'itemsName': 'SignedIdentifier'}}
+ if table_acl is not None:
+ body_content = self._serialize.body(table_acl, '[SignedIdentifier]', is_xml=True, serialization_ctxt=serialization_ctxt)
+ else:
+ body_content = None
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.TableServiceError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ response_headers = {}
+ response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
+ response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
+ response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
+ response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
+
+ if cls:
+ return cls(pipeline_response, None, response_headers)
+
+ set_access_policy.metadata = {'url': '/{table}'} # type: ignore
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/py.typed b/sdk/tables/azure-data-tables/azure/data/tables/_generated/py.typed
new file mode 100644
index 000000000000..e5aff4f83af8
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_generated/version.py b/sdk/tables/azure-data-tables/azure/data/tables/_generated/version.py
new file mode 100644
index 000000000000..629812170000
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_generated/version.py
@@ -0,0 +1,13 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+VERSION = "2019-07-07"
+
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py
new file mode 100644
index 000000000000..36d203b46690
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py
@@ -0,0 +1,499 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from enum import Enum
+from azure.core.exceptions import HttpResponseError
+from azure.core.paging import PageIterator
+from azure.data.tables._generated.models import TableServiceStats as GenTableServiceStats
+
+from ._deserialize import _convert_to_entity
+from ._shared.models import Services
+from ._shared.response_handlers import return_context_and_deserialized, process_table_error
+from ._generated.models import AccessPolicy as GenAccessPolicy
+from ._generated.models import Logging as GeneratedLogging
+from ._generated.models import Metrics as GeneratedMetrics
+from ._generated.models import RetentionPolicy as GeneratedRetentionPolicy
+from ._generated.models import CorsRule as GeneratedCorsRule
+
+
+class TableServiceStats(GenTableServiceStats):
+ """Stats for the service
+ :param geo_replication: Geo-Replication information for the Secondary Storage Service.
+ :type geo_replication: ~azure_table.models.GeoReplication
+ """
+
+ def __init__(self, geo_replication=None, **kwargs): # pylint:disable=W0231
+ self.geo_replication = geo_replication
+
+
+class AccessPolicy(GenAccessPolicy):
+ """Access Policy class used by the set and get access policy methods.
+
+ A stored access policy can specify the start time, expiry time, and
+ permissions for the Shared Access Signatures with which it's associated.
+ Depending on how you want to control access to your resource, you can
+ specify all of these parameters within the stored access policy, and omit
+ them from the URL for the Shared Access Signature. Doing so permits you to
+ modify the associated signature's behavior at any time, as well as to revoke
+ it. Or you can specify one or more of the access policy parameters within
+ the stored access policy, and the others on the URL. Finally, you can
+ specify all of the parameters on the URL. In this case, you can use the
+ stored access policy to revoke the signature, but not to modify its behavior.
+
+ Together the Shared Access Signature and the stored access policy must
+ include all fields required to authenticate the signature. If any required
+ fields are missing, the request will fail. Likewise, if a field is specified
+ both in the Shared Access Signature URL and in the stored access policy, the
+ request will fail with status code 400 (Bad Request).
+
+ :param str permission:
+ The permissions associated with the shared access signature. The
+ user is restricted to operations allowed by the permissions.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has been
+ specified in an associated stored access policy.
+ :param expiry:
+ The time at which the shared access signature becomes invalid.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has
+ been specified in an associated stored access policy. Azure will always
+ convert values to UTC. If a date is passed in without timezone info, it
+ is assumed to be UTC.
+ :type expiry: ~datetime.datetime or str
+ :param start:
+ The time at which the shared access signature becomes valid. If
+ omitted, start time for this call is assumed to be the time when the
+ storage service receives the request. Azure will always convert values
+ to UTC. If a date is passed in without timezone info, it is assumed to
+ be UTC.
+ :type start: ~datetime.datetime or str
+ """
+
+ def __init__(self, permission=None, expiry=None, start=None, **kwargs): # pylint:disable=W0231
+ self.start = start
+ self.expiry = expiry
+ self.permission = permission
+
+
+class TableAnalyticsLogging(GeneratedLogging):
+ """Azure Analytics Logging settings.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :keyword str version: Required. The version of Storage Analytics to configure.
+ :keyword bool delete: Required. Indicates whether all delete requests should be logged.
+ :keyword bool read: Required. Indicates whether all read requests should be logged.
+ :keyword bool write: Required. Indicates whether all write requests should be logged.
+ :keyword ~azure.data.tables.RetentionPolicy retention_policy: Required.
+ The retention policy for the metrics.
+ """
+
+ def __init__( # pylint:disable=W0231
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...)-> None
+
+ self.version = kwargs.get('version', u'1.0')
+ self.delete = kwargs.get('delete', False)
+ self.read = kwargs.get('read', False)
+ self.write = kwargs.get('write', False)
+ self.retention_policy = kwargs.get('retention_policy') or RetentionPolicy()
+
+ @classmethod
+ def _from_generated(cls, generated):
+ if not generated:
+ return cls()
+ return cls(
+ version=generated.version,
+ delete=generated.delete,
+ read=generated.read,
+ write=generated.write,
+ retention_policy=RetentionPolicy._from_generated(generated.retention_policy) # pylint:disable=W0212
+ # pylint: disable=protected-access
+ )
+
+
+class Metrics(GeneratedMetrics):
+ """A summary of request statistics grouped by API in hour or minute aggregates.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :keyword str version: The version of Storage Analytics to configure.
+ :keyword bool enabled: Required. Indicates whether metrics are enabled for the service.
+ :keyword bool include_ap_is: Indicates whether metrics should generate summary
+ statistics for called API operations.
+ :keyword ~azure.data.tables.RetentionPolicy retention_policy: Required.
+ The retention policy for the metrics.
+ """
+
+ def __init__(self, # pylint:disable=W0231
+ **kwargs # type: Any
+ ):
+ self.version = kwargs.get('version', u'1.0')
+ self.enabled = kwargs.get('enabled', False)
+ self.include_apis = kwargs.get('include_apis')
+ self.retention_policy = kwargs.get('retention_policy') or RetentionPolicy()
+
+ @classmethod
+ def _from_generated(cls, generated):
+ # type: (...) -> cls
+ """A summary of request statistics grouped by API in hour or minute aggregates.
+
+ :param Metrics generated: generated Metrics
+ """
+ if not generated:
+ return cls()
+ return cls(
+ version=generated.version,
+ enabled=generated.enabled,
+ include_apis=generated.include_apis,
+ retention_policy=RetentionPolicy._from_generated(generated.retention_policy) # pylint:disable=W0212
+ # pylint: disable=protected-access
+ )
+
+
+class RetentionPolicy(GeneratedRetentionPolicy):
+
+ def __init__( # pylint:disable=W0231
+ self,
+ enabled=False, # type: bool
+ days=None, # type: int
+ **kwargs # type: Any
+ ):
+ # type: (...) ->None
+ """The retention policy which determines how long the associated data should
+ persist.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param bool enabled: Required. Indicates whether a retention policy is enabled
+ for the storage service.
+ :param int days: Indicates the number of days that metrics or logging or
+ soft-deleted data should be retained. All data older than this value will
+ be deleted.
+ :param Any kwargs:
+ """
+ self.enabled = enabled
+ self.days = days
+ if self.enabled and (self.days is None):
+ raise ValueError("If policy is enabled, 'days' must be specified.")
+
+ @classmethod
+ def _from_generated(cls, generated, **kwargs): # pylint:disable=W0613
+ # type: (...) -> cls
+ """The retention policy which determines how long the associated data should
+ persist.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param RetentionPolicy generated: Generated Retention Policy
+ """
+
+ if not generated:
+ return cls()
+ return cls(
+ enabled=generated.enabled,
+ days=generated.days,
+ )
+
+
+class CorsRule(GeneratedCorsRule):
+ """CORS is an HTTP feature that enables a web application running under one
+ domain to access resources in another domain. Web browsers implement a
+ security restriction known as same-origin policy that prevents a web page
+ from calling APIs in a different domain; CORS provides a secure way to
+ allow one domain (the origin domain) to call APIs in another domain.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param list[str] allowed_origins:
+ A list of origin domains that will be allowed via CORS, or "*" to allow
+ all domains. The list of must contain at least one entry. Limited to 64
+ origin domains. Each allowed origin can have up to 256 characters.
+ :param list[str] allowed_methods:
+ A list of HTTP methods that are allowed to be executed by the origin.
+ The list of must contain at least one entry. For Azure Storage,
+ permitted methods are DELETE, GET, HEAD, MERGE, POST, OPTIONS or PUT.
+ :keyword int max_age_in_seconds:
+ The number of seconds that the client/browser should cache a
+ pre-flight response.
+ :keyword list[str] exposed_headers:
+ Defaults to an empty list. A list of response headers to expose to CORS
+ clients. Limited to 64 defined headers and two prefixed headers. Each
+ header can be up to 256 characters.
+ :keyword list[str] allowed_headers:
+ Defaults to an empty list. A list of headers allowed to be part of
+ the cross-origin request. Limited to 64 defined headers and 2 prefixed
+ headers. Each header can be up to 256 characters.
+ """
+
+ def __init__( # pylint:disable=W0231
+ self,
+ allowed_origins, # type: list[str]
+ allowed_methods, # type: list[str]
+ **kwargs # type: Any
+ ):
+ # type: (...)-> None
+
+ self.allowed_origins = ','.join(allowed_origins)
+ self.allowed_methods = ','.join(allowed_methods)
+ self.allowed_headers = ','.join(kwargs.get('allowed_headers', []))
+ self.exposed_headers = ','.join(kwargs.get('exposed_headers', []))
+ self.max_age_in_seconds = kwargs.get('max_age_in_seconds', 0)
+
+ @classmethod
+ def _from_generated(cls, generated):
+ return cls(
+ [generated.allowed_origins],
+ [generated.allowed_methods],
+ allowed_headers=[generated.allowed_headers],
+ exposed_headers=[generated.exposed_headers],
+ max_age_in_seconds=generated.max_age_in_seconds,
+ )
+
+
+class TablePropertiesPaged(PageIterator):
+ """An iterable of Table properties.
+
+ :keyword str service_endpoint: The service URL.
+ :keyword str prefix: A queue name prefix being used to filter the list.
+ :keyword str marker: The continuation token of the current page of results.
+ :keyword int results_per_page: The maximum number of results retrieved per API call.
+ :keyword str next_marker: The continuation token to retrieve the next page of results.
+ :keyword str location_mode: The location mode being used to list results. The available
+ options include "primary" and "secondary".
+ :param callable command: Function to retrieve the next page of items.
+ :param str prefix: Filters the results to return only queues whose names
+ begin with the specified prefix.
+ :param int results_per_page: The maximum number of queue names to retrieve per
+ call.
+ :param str continuation_token: An opaque continuation token.
+ """
+
+ def __init__(self, command, prefix=None, continuation_token=None):
+ super(TablePropertiesPaged, self).__init__(
+ self._get_next_cb,
+ self._extract_data_cb,
+ continuation_token=continuation_token or ""
+ )
+ self._command = command
+ self.prefix = prefix
+ self.next_table_name = None
+ self._headers = None
+ self.location_mode = None
+
+ def _get_next_cb(self, continuation_token):
+ try:
+ return self._command(
+ next_table_name=continuation_token or None,
+ cls=return_context_and_deserialized,
+ use_location=self.location_mode
+ )
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ def _extract_data_cb(self, get_next_return):
+ self.location_mode, self._response, self._headers = get_next_return
+ props_list = []
+ props_list = [Table(t) for t in self._response.value]
+ return self._headers['x-ms-continuation-NextTableName'] or None, props_list
+
+
+class TableEntityPropertiesPaged(PageIterator):
+ """An iterable of TableEntity properties.
+
+ :keyword str service_endpoint: The service URL.
+ :keyword str prefix: A queue name prefix being used to filter the list.
+ :keyword str marker: The continuation token of the current page of results.
+ :keyword int results_per_page: The maximum number of results retrieved per API call.
+ :keyword str next_marker: The continuation token to retrieve the next page of results.
+ :keyword str location_mode: The location mode being used to list results. The available
+ options include "primary" and "secondary".
+ :param callable command: Function to retrieve the next page of items.
+ :param str prefix: Filters the results to return only queues whose names
+ begin with the specified prefix.
+ :param int results_per_page: The maximum number of queue names to retrieve per
+ call.
+ :param str continuation_token: An opaque continuation token.
+ """
+
+ def __init__(self, command, results_per_page=None, table=None,
+ continuation_token=None):
+ super(TableEntityPropertiesPaged, self).__init__(
+ self._get_next_cb,
+ self._extract_data_cb,
+ continuation_token=continuation_token or {}
+ )
+ self._command = command
+ self._headers = None
+ self.results_per_page = results_per_page
+ self.table = table
+ self.location_mode = None
+
+ def _get_next_cb(self, continuation_token):
+ row_key = ""
+ partition_key = ""
+ for key, value in continuation_token.items():
+ if key == "RowKey":
+ row_key = value
+ if key == "PartitionKey":
+ partition_key = value
+ try:
+ return self._command(
+ query_options=self.results_per_page or None,
+ next_row_key=row_key or None,
+ next_partition_key=partition_key or None,
+ table=self.table,
+ cls=return_context_and_deserialized,
+ use_location=self.location_mode
+ )
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ def _extract_data_cb(self, get_next_return):
+ self.location_mode, self._response, self._headers = get_next_return
+ props_list = [_convert_to_entity(t) for t in self._response.value]
+ next_entity = {}
+ if self._headers['x-ms-continuation-NextPartitionKey'] or self._headers['x-ms-continuation-NextRowKey']:
+ next_entity = {'PartitionKey': self._headers['x-ms-continuation-NextPartitionKey'],
+ 'RowKey': self._headers['x-ms-continuation-NextRowKey']}
+ return next_entity or None, props_list
+
+
+class TableSasPermissions(object):
+ def __init__(
+ self,
+ _str=None, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """
+ :keyword bool read:
+ Get entities and query entities.
+ :keyword bool add:
+ Add entities. Add and Update permissions are required for upsert operations.
+ :keyword bool update:
+ Update entities. Add and Update permissions are required for upsert operations.
+ :keyword bool delete:
+ Delete entities.
+ :param str _str:
+ A string representing the permissions.
+ """
+ if not _str:
+ _str = ''
+ self.read = kwargs.pop('read', None) or ('r' in _str)
+ self.add = kwargs.pop('add', None) or ('a' in _str)
+ self.update = kwargs.pop('update', None) or ('u' in _str)
+ self.delete = kwargs.pop('delete', None) or ('d' in _str)
+
+ def __or__(self, other):
+ return TableSasPermissions(_str=str(self) + str(other))
+
+ def __add__(self, other):
+ return TableSasPermissions(_str=str(self) + str(other))
+
+ def __str__(self):
+ return (('r' if self.read else '') +
+ ('a' if self.add else '') +
+ ('u' if self.update else '') +
+ ('d' if self.delete else ''))
+
+ @classmethod
+ def from_string(cls,
+ permission, # type: str
+ **kwargs): # pylint:disable=W0613
+ """Create AccountSasPermissions from a string.
+
+ To specify read, write, delete, etc. permissions you need only to
+ include the first letter of the word in the string. E.g. for read and write
+ permissions you would provide a string "rw".
+
+ :param str permission: Specify permissions in
+ the string with the first letter of the word.
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: A AccountSasPermissions object
+ :rtype: ~azure.data.tables.AccountSasPermissions
+ """
+ p_read = 'r' in permission
+ p_add = 'a' in permission
+ p_delete = 'd' in permission
+ p_update = 'u' in permission
+
+ parsed = cls(
+ **dict(kwargs, read=p_read, add=p_add, delete=p_delete, update=p_update))
+ parsed._str = permission # pylint: disable = W0201
+ return parsed
+
+
+TableSasPermissions.READ = TableSasPermissions(**dict(read=True))
+TableSasPermissions.ADD = TableSasPermissions(**dict(add=True))
+TableSasPermissions.UPDATE = TableSasPermissions(**dict(update=True))
+TableSasPermissions.DELETE = TableSasPermissions(**dict(delete=True))
+
+
+def service_stats_deserialize(generated):
+ """Deserialize a ServiceStats objects into a dict.
+ """
+ return {
+ 'geo_replication': {
+ 'status': generated.geo_replication.status,
+ 'last_sync_time': generated.geo_replication.last_sync_time,
+ }
+ }
+
+
+def service_properties_deserialize(generated):
+ """Deserialize a ServiceProperties objects into a dict.
+ """
+ return {
+ 'analytics_logging': TableAnalyticsLogging._from_generated(generated.logging),
+ # pylint: disable=protected-access
+ 'hour_metrics': Metrics._from_generated(generated.hour_metrics), # pylint: disable=protected-access
+ 'minute_metrics': Metrics._from_generated(generated.minute_metrics), # pylint: disable=protected-access
+ 'cors': [CorsRule._from_generated(cors) for cors in generated.cors], # pylint: disable=protected-access
+ }
+
+
+class TableServices(Services):
+ def __str__(self):
+ return 't'
+
+
+class Table(object):
+ """
+ Represents an Azure Table. Returned by list_tables.
+
+ :ivar str name: The name of the table.
+ """
+
+ def __init__(self, table):
+ self.table_name = table
+
+
+class TablePayloadFormat(object):
+ '''
+ Specifies the accepted content type of the response payload. More information
+ can be found here: https://msdn.microsoft.com/en-us/library/azure/dn535600.aspx
+ '''
+
+ JSON_NO_METADATA = 'application/json;odata=nometadata'
+ '''Returns no type information for the entity properties.'''
+
+ JSON_MINIMAL_METADATA = 'application/json;odata=minimalmetadata'
+ '''Returns minimal type information for the entity properties.'''
+
+ JSON_FULL_METADATA = 'application/json;odata=fullmetadata'
+ '''Returns minimal type information for the entity properties plus some extra odata properties.'''
+
+
+class UpdateMode(str, Enum):
+ REPLACE = "replace"
+ MERGE = "merge"
+
+
+class SASProtocol(str, Enum):
+ HTTPS = "https"
+ HTTP = "http"
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py b/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py
new file mode 100644
index 000000000000..32e9db432c57
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py
@@ -0,0 +1,217 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+# pylint: disable=no-self-use
+import sys
+import uuid
+from uuid import UUID
+from datetime import datetime
+
+from math import (
+ isnan,
+)
+
+from azure.core import MatchConditions
+from ._entity import EdmType, EntityProperty
+from ._models import TablePayloadFormat
+from ._shared._common_conversion import _to_str, _encode_base64, _to_utc_datetime
+from ._shared._error import _ERROR_VALUE_TOO_LARGE, _ERROR_TYPE_NOT_SUPPORTED
+
+
+
+_SUPPORTED_API_VERSIONS = [
+ '2019-02-02',
+ '2019-07-07'
+]
+
+
+def _get_match_headers(kwargs, match_param, etag_param):
+ if_match = None
+ if_none_match = None
+ match_condition = kwargs.pop(match_param, None)
+ if match_condition == MatchConditions.IfNotModified:
+ if_match = kwargs.pop(etag_param, None)
+ if not if_match:
+ raise ValueError("'{}' specified without '{}'.".format(match_param, etag_param))
+ elif match_condition == MatchConditions.IfPresent:
+ if_match = '*'
+ elif match_condition == MatchConditions.IfModified:
+ if_none_match = kwargs.pop(etag_param, None)
+ if not if_none_match:
+ raise ValueError("'{}' specified without '{}'.".format(match_param, etag_param))
+ elif match_condition == MatchConditions.IfMissing:
+ if_none_match = '*'
+ elif match_condition is None:
+ if kwargs.get(etag_param):
+ raise ValueError("'{}' specified without '{}'.".format(etag_param, match_param))
+ else:
+ raise TypeError("Invalid match condition: {}".format(match_condition))
+ return if_match, if_none_match
+
+
+def get_api_version(kwargs, default):
+ # type: (Dict[str, Any]) -> str
+ api_version = kwargs.pop('api_version', None)
+ if api_version and api_version not in _SUPPORTED_API_VERSIONS:
+ versions = '\n'.join(_SUPPORTED_API_VERSIONS)
+ raise ValueError("Unsupported API version '{}'. Please select from:\n{}".format(api_version, versions))
+ return api_version or default
+
+
+if sys.version_info < (3,):
+ def _new_boundary():
+ return str(uuid.uuid1())
+else:
+ def _new_boundary():
+ return str(uuid.uuid1()).encode('utf-8')
+
+_DEFAULT_ACCEPT_HEADER = ('Accept', TablePayloadFormat.JSON_MINIMAL_METADATA)
+_DEFAULT_CONTENT_TYPE_HEADER = ('Content-Type', 'application/json')
+_DEFAULT_PREFER_HEADER = ('Prefer', 'return-no-content')
+_SUB_HEADERS = ['If-Match', 'Prefer', 'Accept', 'Content-Type', 'DataServiceVersion']
+
+
+def _get_entity_path(table_name, partition_key, row_key):
+ return '/{0}(PartitionKey=\'{1}\',RowKey=\'{2}\')'.format(
+ _to_str(table_name),
+ _to_str(partition_key.replace('\'', '\'\'')),
+ _to_str(row_key.replace('\'', '\'\'')))
+
+
+def _update_storage_table_header(request):
+ ''' add additional headers for storage table request. '''
+
+ # set service version
+ request.headers['DataServiceVersion'] = '3.0;NetFx'
+ request.headers['MaxDataServiceVersion'] = '3.0'
+
+
+def _to_entity_binary(value):
+ return EdmType.BINARY, _encode_base64(value)
+
+
+def _to_entity_bool(value):
+ return None, value
+
+
+def _to_entity_datetime(value):
+ return EdmType.DATETIME, _to_utc_datetime(value)
+
+
+def _to_entity_float(value):
+ if isnan(value):
+ return EdmType.DOUBLE, 'NaN'
+ if value == float('inf'):
+ return EdmType.DOUBLE, 'Infinity'
+ if value == float('-inf'):
+ return EdmType.DOUBLE, '-Infinity'
+ return None, value
+
+
+def _to_entity_guid(value):
+ return EdmType.GUID, str(value)
+
+
+def _to_entity_int32(value):
+ if sys.version_info < (3,):
+ value = int(value)
+ else:
+ value = int(value)
+ if value >= 2 ** 31 or value < -(2 ** 31):
+ raise TypeError(_ERROR_VALUE_TOO_LARGE.format(str(value), EdmType.INT32))
+ return None, value
+
+
+def _to_entity_int64(value):
+ if sys.version_info < (3,):
+ ivalue = int(value)
+ else:
+ ivalue = int(value)
+ if ivalue >= 2 ** 63 or ivalue < -(2 ** 63):
+ raise TypeError(_ERROR_VALUE_TOO_LARGE.format(str(value), EdmType.INT64))
+ return EdmType.INT64, str(value)
+
+
+def _to_entity_str(value):
+ return None, value
+
+
+def _to_entity_none(value): # pylint:disable=W0613
+ return None, None
+
+
+# Conversion from Python type to a function which returns a tuple of the
+# type string and content string.
+_PYTHON_TO_ENTITY_CONVERSIONS = {
+ int: _to_entity_int64,
+ bool: _to_entity_bool,
+ datetime: _to_entity_datetime,
+ float: _to_entity_float,
+ str: _to_entity_str,
+ bytes: _to_entity_binary,
+ UUID: _to_entity_guid
+}
+
+# Conversion from Edm type to a function which returns a tuple of the
+# type string and content string.
+_EDM_TO_ENTITY_CONVERSIONS = {
+ EdmType.BINARY: _to_entity_binary,
+ EdmType.BOOLEAN: _to_entity_bool,
+ EdmType.DATETIME: _to_entity_datetime,
+ EdmType.DOUBLE: _to_entity_float,
+ EdmType.GUID: _to_entity_guid,
+ EdmType.INT32: _to_entity_int32,
+ EdmType.INT64: _to_entity_int64,
+ EdmType.STRING: _to_entity_str,
+}
+
+
+def _add_entity_properties(source):
+ """ Converts an entity object to json to send.
+ The entity format is:
+ {
+ "Address":"Mountain View",
+ "Age":23,
+ "AmountDue":200.23,
+ "CustomerCode@odata.type":"Edm.Guid",
+ "CustomerCode":"c9da6455-213d-42c9-9a79-3e9149a57833",
+ "CustomerSince@odata.type":"Edm.DateTime",
+ "CustomerSince":"2008-07-10T00:00:00",
+ "IsActive":true,
+ "NumberOfOrders@odata.type":"Edm.Int64",
+ "NumberOfOrders":"255",
+ "PartitionKey":"mypartitionkey",
+ "RowKey":"myrowkey"
+ }
+ """
+
+ properties = {}
+
+ # set properties type for types we know if value has no type info.
+ # if value has type info, then set the type to value.type
+ for name, value in source.items():
+ mtype = ''
+
+ if isinstance(value, EntityProperty):
+ conv = _EDM_TO_ENTITY_CONVERSIONS.get(value.type)
+ if conv is None:
+ raise TypeError(
+ _ERROR_TYPE_NOT_SUPPORTED.format(value.type))
+ mtype, value = conv(value.value)
+ else:
+ conv = _PYTHON_TO_ENTITY_CONVERSIONS.get(type(value))
+ if conv is None or value is None:
+ conv = _to_entity_none # something with this
+
+ mtype, value = conv(value)
+
+ # form the property node
+ if value is not None:
+ properties[name] = value
+ if mtype:
+ properties[name + '@odata.type'] = mtype.value
+
+ # generate the entity_body
+ return properties
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/__init__.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/__init__.py
new file mode 100644
index 000000000000..160f88223820
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/__init__.py
@@ -0,0 +1,56 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import base64
+import hashlib
+import hmac
+
+try:
+ from urllib.parse import quote, unquote
+except ImportError:
+ from urllib2 import quote, unquote # type: ignore
+
+import six
+
+
+def url_quote(url):
+ return quote(url)
+
+
+def url_unquote(url):
+ return unquote(url)
+
+
+def encode_base64(data):
+ if isinstance(data, six.text_type):
+ data = data.encode('utf-8')
+ encoded = base64.b64encode(data)
+ return encoded.decode('utf-8')
+
+
+def decode_base64_to_bytes(data):
+ if isinstance(data, six.text_type):
+ data = data.encode('utf-8')
+ return base64.b64decode(data)
+
+
+def decode_base64_to_text(data):
+ decoded_bytes = decode_base64_to_bytes(data)
+ return decoded_bytes.decode('utf-8')
+
+
+def sign_string(key, string_to_sign, key_is_base64=True):
+ if key_is_base64:
+ key = decode_base64_to_bytes(key)
+ else:
+ if isinstance(key, six.text_type):
+ key = key.encode('utf-8')
+ if isinstance(string_to_sign, six.text_type):
+ string_to_sign = string_to_sign.encode('utf-8')
+ signed_hmac_sha256 = hmac.HMAC(key, string_to_sign, hashlib.sha256)
+ digest = signed_hmac_sha256.digest()
+ encoded_digest = encode_base64(digest)
+ return encoded_digest
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/_common_conversion.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_common_conversion.py
new file mode 100644
index 000000000000..4de22559aba8
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_common_conversion.py
@@ -0,0 +1,107 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import base64
+import hashlib
+import hmac
+from io import (SEEK_SET)
+import six
+from azure.data.tables._shared.parser import _str
+
+
+from ._error import (
+ _ERROR_VALUE_SHOULD_BE_BYTES_OR_STREAM,
+ _ERROR_VALUE_SHOULD_BE_SEEKABLE_STREAM,
+)
+
+
+def _to_str(value):
+ return _str(value) if value is not None else None
+
+
+def _int_to_str(value):
+ return str(int(value)) if value is not None else None
+
+
+def _bool_to_str(value):
+ if value is None:
+ return None
+
+ if isinstance(value, bool):
+ if value: # pylint: disable=R1705
+ return 'true'
+ else:
+ return 'false'
+
+ return str(value)
+
+
+def _to_utc_datetime(value):
+ return value.strftime('%Y-%m-%dT%H:%M:%SZ')
+
+
+def _datetime_to_utc_string(value):
+ # Azure expects the date value passed in to be UTC.
+ # Azure will always return values as UTC.
+ # If a date is passed in without timezone info, it is assumed to be UTC.
+ if value is None:
+ return None
+
+ return value.strftime('%a, %d %b %Y %H:%M:%S GMT')
+
+
+def _encode_base64(data):
+ if isinstance(data, six.text_type):
+ data = data.encode('utf-8')
+ encoded = base64.b64encode(data)
+ return encoded.decode('utf-8')
+
+
+def _decode_base64_to_bytes(data):
+ if isinstance(data, six.text_type):
+ data = data.encode('utf-8')
+ return base64.b64decode(data)
+
+
+def _decode_base64_to_text(data):
+ decoded_bytes = _decode_base64_to_bytes(data)
+ return decoded_bytes.decode('utf-8')
+
+
+def _sign_string(key, string_to_sign, key_is_base64=True):
+ if key_is_base64:
+ key = _decode_base64_to_bytes(key)
+ else:
+ if isinstance(key, six.text_type):
+ key = key.encode('utf-8')
+ if isinstance(string_to_sign, six.text_type):
+ string_to_sign = string_to_sign.encode('utf-8')
+ signed_hmac_sha256 = hmac.HMAC(key, string_to_sign, hashlib.sha256)
+ digest = signed_hmac_sha256.digest()
+ encoded_digest = _encode_base64(digest)
+ return encoded_digest
+
+
+def _get_content_md5(data):
+ md5 = hashlib.md5() # nosec
+ if isinstance(data, bytes):
+ md5.update(data)
+ elif hasattr(data, 'read'):
+ pos = 0
+ pos = data.tell()
+ for chunk in iter(lambda: data.read(4096), b""):
+ md5.update(chunk)
+ try:
+ data.seek(pos, SEEK_SET)
+ except (AttributeError, IOError):
+ raise ValueError(_ERROR_VALUE_SHOULD_BE_SEEKABLE_STREAM.format('data'))
+ else:
+ raise ValueError(_ERROR_VALUE_SHOULD_BE_BYTES_OR_STREAM.format('data'))
+
+ return base64.b64encode(md5.digest()).decode('utf-8')
+
+
+def _lower(text):
+ return text.lower()
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/_constants.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_constants.py
new file mode 100644
index 000000000000..858875b6af28
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_constants.py
@@ -0,0 +1,51 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import platform
+import sys
+
+__author__ = 'Microsoft Corp. '
+__version__ = '1.4.2'
+
+# UserAgent string sample: 'Azure-Storage/0.37.0-0.38.0 (Python CPython 3.4.2; Windows 8)'
+# First version(0.37.0) is the common package, and the second version(0.38.0) is the service package
+USER_AGENT_STRING_PREFIX = 'Azure-Storage/{}-'.format(__version__)
+USER_AGENT_STRING_SUFFIX = '(Python {} {}; {} {})'.format(platform.python_implementation(),
+ platform.python_version(), platform.system(),
+ platform.release())
+
+# default values for common package, in case it is used directly
+DEFAULT_X_MS_VERSION = '2018-03-28'
+DEFAULT_USER_AGENT_STRING = '{}None {}'.format(USER_AGENT_STRING_PREFIX, USER_AGENT_STRING_SUFFIX)
+
+# Live ServiceClient URLs
+SERVICE_HOST_BASE = 'core.windows.net'
+DEFAULT_PROTOCOL = 'https'
+
+# Development ServiceClient URLs
+DEV_BLOB_HOST = '127.0.0.1:10000'
+DEV_QUEUE_HOST = '127.0.0.1:10001'
+
+# Default credentials for Development Storage Service
+DEV_ACCOUNT_NAME = 'devstoreaccount1'
+DEV_ACCOUNT_SECONDARY_NAME = 'devstoreaccount1-secondary'
+DEV_ACCOUNT_KEY = 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=='
+
+# Socket timeout in seconds
+DEFAULT_SOCKET_TIMEOUT = 20
+
+# for python 3.5+, there was a change to the definition of the socket timeout (as far as socket.sendall is concerned)
+# The socket timeout is now the maximum total duration to send all data.
+if sys.version_info >= (3, 5):
+ # the timeout to connect is 20 seconds, and the read timeout is 2000 seconds
+ # the 2000 seconds was calculated with: 100MB (max block size)/ 50KB/s (an arbitrarily chosen minimum upload speed)
+ DEFAULT_SOCKET_TIMEOUT = (20, 2000)
+
+# Encryption constants
+_ENCRYPTION_PROTOCOL_V1 = '1.0'
+
+_AUTHORIZATION_HEADER_NAME = 'Authorization'
+_COPY_SOURCE_HEADER_NAME = 'x-ms-copy-source'
+_REDACTED_VALUE = 'REDACTED'
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/_error.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_error.py
new file mode 100644
index 000000000000..32d9e7705378
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_error.py
@@ -0,0 +1,230 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from sys import version_info
+from re import match
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError
+from azure.data.tables._shared.parser import _str
+
+from ._constants import (
+ _ENCRYPTION_PROTOCOL_V1,
+)
+
+def _to_str(value):
+ return _str(value) if value is not None else None
+
+
+_ERROR_ATTRIBUTE_MISSING = '\'{0}\' object has no attribute \'{1}\''
+_ERROR_BATCH_COMMIT_FAIL = 'Batch Commit Fail'
+_ERROR_CANNOT_FIND_PARTITION_KEY = 'Cannot find partition key in request.'
+_ERROR_CANNOT_FIND_ROW_KEY = 'Cannot find row key in request.'
+_ERROR_CANNOT_SERIALIZE_VALUE_TO_ENTITY = \
+ 'Cannot serialize the specified value ({0}) to an entity. Please use ' + \
+ 'an EntityProperty (which can specify custom types), int, str, bool, ' + \
+ 'or datetime.'
+_ERROR_CANNOT_DESERIALIZE_VALUE_TO_ENTITY = \
+ 'Cannot deserialize the specified value ({0}).'
+_ERROR_DUPLICATE_ROW_KEY_IN_BATCH = \
+ 'Row Keys should not be the same in a batch operations'
+_ERROR_INCORRECT_PARTITION_KEY_IN_BATCH = \
+ 'Partition Key should be the same in a batch operations'
+_ERROR_INVALID_ENTITY_TYPE = 'The entity must be either in dict format or an entity object.'
+_ERROR_INVALID_PROPERTY_RESOLVER = \
+ 'The specified property resolver returned an invalid type. Name: {0}, Value: {1}, ' + \
+ 'EdmType: {2}'
+_ERROR_PROPERTY_NAME_TOO_LONG = 'The property name exceeds the maximum allowed length.'
+_ERROR_TOO_MANY_ENTITIES_IN_BATCH = \
+ 'Batches may only contain 100 operations'
+_ERROR_TOO_MANY_PROPERTIES = 'The entity contains more properties than allowed.'
+_ERROR_TYPE_NOT_SUPPORTED = 'Type not supported when sending data to the service: {0}.'
+_ERROR_VALUE_TOO_LARGE = '{0} is too large to be cast to type {1}.'
+_ERROR_UNSUPPORTED_TYPE_FOR_ENCRYPTION = 'Encryption is only supported for not None strings.'
+_ERROR_ENTITY_NOT_ENCRYPTED = 'Entity was not encrypted.'
+_ERROR_ATTRIBUTE_MISSING = '\'{0}\' object has no attribute \'{1}\''
+_ERROR_CONFLICT = 'Conflict ({0})'
+_ERROR_NOT_FOUND = 'Not found ({0})'
+_ERROR_UNKNOWN = 'Unknown error ({0})'
+_ERROR_STORAGE_MISSING_INFO = \
+ 'You need to provide an account name and either an account_key or sas_token when creating a storage service.'
+_ERROR_EMULATOR_DOES_NOT_SUPPORT_FILES = \
+ 'The emulator does not support the file service.'
+_ERROR_ACCESS_POLICY = \
+ 'share_access_policy must be either SignedIdentifier or AccessPolicy ' + \
+ 'instance'
+_ERROR_PARALLEL_NOT_SEEKABLE = 'Parallel operations require a seekable stream.'
+_ERROR_VALUE_SHOULD_BE_BYTES = '{0} should be of type bytes.'
+_ERROR_VALUE_SHOULD_BE_BYTES_OR_STREAM = '{0} should be of type bytes or a readable file-like/io.IOBase stream object.'
+_ERROR_VALUE_SHOULD_BE_SEEKABLE_STREAM = '{0} should be a seekable file-like/io.IOBase type stream object.'
+_ERROR_VALUE_SHOULD_BE_STREAM = '{0} should be a file-like/io.IOBase type stream object with a read method.'
+_ERROR_VALUE_NONE = '{0} should not be None.'
+_ERROR_VALUE_NONE_OR_EMPTY = '{0} should not be None or empty.'
+_ERROR_VALUE_NEGATIVE = '{0} should not be negative.'
+_ERROR_START_END_NEEDED_FOR_MD5 = \
+ 'Both end_range and start_range need to be specified ' + \
+ 'for getting content MD5.'
+_ERROR_RANGE_TOO_LARGE_FOR_MD5 = \
+ 'Getting content MD5 for a range greater than 4MB ' + \
+ 'is not supported.'
+_ERROR_MD5_MISMATCH = \
+ 'MD5 mismatch. Expected value is \'{0}\', computed value is \'{1}\'.'
+_ERROR_TOO_MANY_ACCESS_POLICIES = \
+ 'Too many access policies provided. ' \
+ 'The server does not support setting more than 5 access policies on a single resource.'
+_ERROR_OBJECT_INVALID = \
+ '{0} does not define a complete interface. Value of {1} is either missing or invalid.'
+_ERROR_UNSUPPORTED_ENCRYPTION_VERSION = \
+ 'Encryption version is not supported.'
+_ERROR_DECRYPTION_FAILURE = \
+ 'Decryption failed'
+_ERROR_ENCRYPTION_REQUIRED = \
+ 'Encryption required but no key was provided.'
+_ERROR_DECRYPTION_REQUIRED = \
+ 'Decryption required but neither key nor resolver was provided.' + \
+ ' If you do not want to decypt, please do not set the require encryption flag.'
+_ERROR_INVALID_KID = \
+ 'Provided or resolved key-encryption-key does not match the id of key used to encrypt.'
+_ERROR_UNSUPPORTED_ENCRYPTION_ALGORITHM = \
+ 'Specified encryption algorithm is not supported.'
+_ERROR_UNSUPPORTED_METHOD_FOR_ENCRYPTION = 'The require_encryption flag is set, but encryption is not supported' + \
+ ' for this method.'
+_ERROR_UNKNOWN_KEY_WRAP_ALGORITHM = 'Unknown key wrap algorithm.'
+_ERROR_DATA_NOT_ENCRYPTED = 'Encryption required, but received data does not contain appropriate metatadata.' + \
+ 'Data was either not encrypted or metadata has been lost.'
+
+
+def _dont_fail_on_exist(error):
+ """ don't throw exception if the resource exists.
+ This is called by create_* APIs with fail_on_exist=False"""
+ if isinstance(error, ResourceExistsError): # pylint: disable=R1705
+ return False
+ else:
+ raise error
+
+
+def _dont_fail_not_exist(error):
+ """ don't throw exception if the resource doesn't exist.
+ This is called by create_* APIs with fail_on_exist=False"""
+ if isinstance(error, ResourceNotFoundError): # pylint: disable=R1705
+ return False
+ else:
+ raise error
+
+
+def _http_error_handler(http_error):
+ """ Simple error handler for azure."""
+ message = str(http_error)
+ error_code = None
+
+ if 'x-ms-error-code' in http_error.respheader:
+ error_code = http_error.respheader['x-ms-error-code']
+ message += ' ErrorCode: ' + error_code
+
+ if http_error.respbody is not None:
+ message += '\n' + http_error.respbody.decode('utf-8-sig')
+
+ ex = HttpResponseError(message, http_error.status)
+ ex.error_code = error_code
+
+ raise ex
+
+
+def _validate_type_bytes(param_name, param):
+ if not isinstance(param, bytes):
+ raise TypeError(_ERROR_VALUE_SHOULD_BE_BYTES.format(param_name))
+
+
+def _validate_type_bytes_or_stream(param_name, param):
+ if not (isinstance(param, bytes) or hasattr(param, 'read')):
+ raise TypeError(_ERROR_VALUE_SHOULD_BE_BYTES_OR_STREAM.format(param_name))
+
+
+def _validate_not_none(param_name, param):
+ if param is None:
+ raise ValueError(_ERROR_VALUE_NONE.format(param_name))
+
+
+def _validate_content_match(server_md5, computed_md5):
+ if server_md5 != computed_md5:
+ raise Exception(_ERROR_MD5_MISMATCH.format(server_md5, computed_md5))
+
+
+def _validate_access_policies(identifiers):
+ if identifiers and len(identifiers) > 5:
+ raise Exception(_ERROR_TOO_MANY_ACCESS_POLICIES)
+
+
+def _validate_key_encryption_key_wrap(kek):
+ # Note that None is not callable and so will fail the second clause of each check.
+ if not hasattr(kek, 'wrap_key') or not callable(kek.wrap_key):
+ raise AttributeError(_ERROR_OBJECT_INVALID.format('key encryption key', 'wrap_key'))
+ if not hasattr(kek, 'get_kid') or not callable(kek.get_kid):
+ raise AttributeError(_ERROR_OBJECT_INVALID.format('key encryption key', 'get_kid'))
+ if not hasattr(kek, 'get_key_wrap_algorithm') or not callable(kek.get_key_wrap_algorithm):
+ raise AttributeError(_ERROR_OBJECT_INVALID.format('key encryption key', 'get_key_wrap_algorithm'))
+
+
+def _validate_key_encryption_key_unwrap(kek):
+ if not hasattr(kek, 'get_kid') or not callable(kek.get_kid):
+ raise AttributeError(_ERROR_OBJECT_INVALID.format('key encryption key', 'get_kid'))
+ if not hasattr(kek, 'unwrap_key') or not callable(kek.unwrap_key):
+ raise AttributeError(_ERROR_OBJECT_INVALID.format('key encryption key', 'unwrap_key'))
+
+
+def _validate_encryption_required(require_encryption, kek):
+ if require_encryption and (kek is None):
+ raise ValueError(_ERROR_ENCRYPTION_REQUIRED)
+
+
+def _validate_decryption_required(require_encryption, kek, resolver):
+ if (require_encryption and (kek is None) and
+ (resolver is None)):
+ raise ValueError(_ERROR_DECRYPTION_REQUIRED)
+
+
+def _validate_encryption_protocol_version(encryption_protocol):
+ if not _ENCRYPTION_PROTOCOL_V1 == encryption_protocol:
+ raise ValueError(_ERROR_UNSUPPORTED_ENCRYPTION_VERSION)
+
+
+def _validate_kek_id(kid, resolved_id):
+ if not kid == resolved_id:
+ raise ValueError(_ERROR_INVALID_KID)
+
+
+def _validate_encryption_unsupported(require_encryption, key_encryption_key):
+ if require_encryption or (key_encryption_key is not None):
+ raise ValueError(_ERROR_UNSUPPORTED_METHOD_FOR_ENCRYPTION)
+
+
+# wraps a given exception with the desired exception type
+def _wrap_exception(ex, desired_type):
+ msg = ""
+ if len(ex.args) > 0: # pylint: disable=C1801
+ msg = ex.args[0]
+ if version_info >= (3,): # pylint: disable=R1705
+ # Automatic chaining in Python 3 means we keep the trace
+ return desired_type(msg)
+ else:
+ # There isn't a good solution in 2 for keeping the stack trace
+ # in general, or that will not result in an error in 3
+ # However, we can keep the previous error type and message
+ # TODO: In the future we will log the trace
+ return desired_type('{}: {}'.format(ex.__class__.__name__, msg))
+
+
+def _validate_table_name(table_name):
+ if match("^[a-zA-Z]{1}[a-zA-Z0-9]{2,62}$", table_name) is None:
+ raise ValueError(
+ "Table names must be alphanumeric, cannot begin with a number, and must be between 3-63 characters long."
+ )
+
+
+class AzureSigningError(Exception):
+ """
+ Represents a fatal error when attempting to sign a request.
+ In general, the cause of this exception is user error. For example, the given account key is not valid.
+ Please visit https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account for more info.
+ """
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/_table_client_base.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_table_client_base.py
new file mode 100644
index 000000000000..54e0b360fac6
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_table_client_base.py
@@ -0,0 +1,98 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+try:
+ from urllib.parse import urlparse
+except ImportError:
+ from urlparse import urlparse # type: ignore
+
+from azure.data.tables._shared._error import _validate_table_name
+from azure.data.tables._shared.base_client import parse_query
+from .base_client import StorageAccountHostsMixin
+
+
+class TableClientBase(StorageAccountHostsMixin):
+ """Create TableClientBase from a Credential.
+
+ :param account_url:
+ A url to an Azure Storage account.
+ :type account_url: str
+ :param table_name: The table name.
+ :type table_name: str
+ :param credential:
+ The credentials with which to authenticate. This is optional if the
+ account URL already has a SAS token, or the connection string already has shared
+ access key values. The value can be a SAS token string, an account shared access
+ key.
+ :type credential: Union[str,TokenCredential]
+
+ :returns: None
+ """
+
+ def __init__(
+ self, account_url, # type: str
+ table_name, # type: str
+ credential=None, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+
+ _validate_table_name(table_name)
+
+ try:
+ if not account_url.lower().startswith('http'):
+ account_url = "https://" + account_url
+ except AttributeError:
+ raise ValueError("Account URL must be a string.")
+ parsed_url = urlparse(account_url.rstrip('/'))
+ if not table_name:
+ raise ValueError("Please specify a table name.")
+ if not parsed_url.netloc:
+ raise ValueError("Invalid URL: {}".format(parsed_url))
+
+ _, sas_token = parse_query(parsed_url.query)
+ if not sas_token and not credential:
+ raise ValueError("You need to provide either a SAS token or an account shared key to authenticate.")
+
+ self.table_name = table_name
+ self._query_str, credential = self._format_query_string(sas_token, credential)
+ super(TableClientBase, self).__init__(parsed_url, service='table', credential=credential, **kwargs)
+
+ def _format_url(self, hostname):
+ """Format the endpoint URL according to the current location
+ mode hostname.
+ """
+ return "{}://{}{}".format(self.scheme, hostname, self._query_str)
+
+ @classmethod
+ def _validate_signed_identifiers(cls, signed_identifiers):
+ # type: (...) -> None
+ """Validate the number of signed identifiers is less than five
+
+ :param signed_identifiers:
+ :type signed_identifiers: dict[str,AccessPolicy]
+ """
+ if len(signed_identifiers) > 5:
+ raise ValueError(
+ 'Too many access policies provided. The server does not support setting '
+ 'more than 5 access policies on a single resource.')
+
+ def _parameter_filter_substitution( # pylint: disable = R0201
+ self,
+ parameters, # type: dict[str,str]
+ filter # type: str # pylint: disable = W0622
+ ):
+ """Replace user defined parameter in filter
+ :param parameters: User defined parameters
+ :param filter: Filter for querying
+ """
+ if parameters:
+ filter_start = filter.split('@')[0]
+ selected = filter.split('@')[1]
+ for key, value in parameters.items():
+ if key == selected:
+ filter = filter_start.replace('@', value) # pylint: disable = W0622
+ return filter # pylint: disable = W0622
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/_table_service_client_base.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_table_service_client_base.py
new file mode 100644
index 000000000000..99967f590e94
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/_table_service_client_base.py
@@ -0,0 +1,75 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+try:
+ from urllib.parse import urlparse
+except ImportError:
+ from urlparse import urlparse # type: ignore
+
+from azure.data.tables._shared.base_client import parse_query
+from .base_client import StorageAccountHostsMixin
+
+
+class TableServiceClientBase(StorageAccountHostsMixin):
+ """ :ivar str account_name: Name of the storage account (Cosmos or Azure)
+ Create TableServiceClientBase class for sync and async code.
+
+ :param account_url:
+ A account_url url to an Azure Storage account.
+ :type service: str
+ :param credential:
+ The credentials with which to authenticate. This is optional if the
+ account URL already has a SAS token, or the connection string already has shared
+ access key values. The value can be a SAS token string, an account shared access
+ key, or an instance of a TokenCredentials class from azure.identity.
+ :type credential: str
+ :returns: None
+ """
+ def __init__(
+ self, account_url, # type: Any
+ service, # type: str
+ credential=None, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+
+ try:
+ if not account_url.lower().startswith('http'):
+ account_url = "https://" + account_url
+ except AttributeError:
+ raise ValueError("Account URL must be a string.")
+ parsed_url = urlparse(account_url.rstrip('/'))
+ if not parsed_url.netloc:
+ raise ValueError("Invalid URL: {}".format(account_url))
+
+ _, sas_token = parse_query(parsed_url.query)
+ if not sas_token and not credential:
+ raise ValueError("You need to provide either a SAS token or an account shared key to authenticate.")
+ self._query_str, credential = self._format_query_string(sas_token, credential)
+ super(TableServiceClientBase, self).__init__(parsed_url, service=service, credential=credential, **kwargs)
+
+ def _format_url(self, hostname):
+ """Format the endpoint URL according to the current location
+ mode hostname.
+ """
+ return "{}://{}{}".format(self.scheme, hostname, self._query_str)
+
+ def _parameter_filter_substitution( # pylint: disable = R0201
+ self,
+ parameters, # type: dict[str,str]
+ filter # type: str # pylint: disable = W0622
+ ):
+ """Replace user defined parameter in filter
+ :param parameters: User defined parameters
+ :param filter: Filter for querying
+ """
+ if parameters:
+ filter_start = filter.split('@')[0]
+ selected = filter.split('@')[1]
+ for key, value in parameters.items():
+ if key == selected:
+ filter = filter_start.replace('@', value) # pylint: disable = W0622
+ return filter # pylint: disable = W0622
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/authentication.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/authentication.py
new file mode 100644
index 000000000000..c479b6a51963
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/authentication.py
@@ -0,0 +1,138 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import logging
+import sys
+try:
+ from urllib.parse import urlparse
+except ImportError:
+ from urlparse import urlparse # type: ignore
+
+
+
+from azure.core.exceptions import ClientAuthenticationError
+from azure.core.pipeline.policies import SansIOHTTPPolicy
+
+from azure.data.tables._shared._constants import (
+ DEV_ACCOUNT_NAME,
+ DEV_ACCOUNT_SECONDARY_NAME
+)
+
+from ._common_conversion import (
+ _sign_string,
+)
+
+from ._error import (
+ _wrap_exception,
+)
+
+logger = logging.getLogger(__name__)
+
+
+# wraps a given exception with the desired exception type
+def _wrap_exception(ex, desired_type):
+ msg = ""
+ if ex.args:
+ msg = ex.args[0]
+ if sys.version_info >= (3,):
+ # Automatic chaining in Python 3 means we keep the trace
+ return desired_type(msg)
+ # There isn't a good solution in 2 for keeping the stack trace
+ # in general, or that will not result in an error in 3
+ # However, we can keep the previous error type and message
+ # TODO: In the future we will log the trace
+ return desired_type('{}: {}'.format(ex.__class__.__name__, msg))
+
+
+class AzureSigningError(ClientAuthenticationError):
+ """
+ Represents a fatal error when attempting to sign a request.
+ In general, the cause of this exception is user error. For example, the given account key is not valid.
+ Please visit https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account for more info.
+ """
+
+
+# pylint: disable=no-self-use
+class SharedKeyCredentialPolicy(SansIOHTTPPolicy):
+
+ def __init__(self, account_name, account_key, is_emulated=False):
+ self.account_name = account_name
+ self.account_key = account_key
+ self.is_emulated = is_emulated
+
+ def _get_headers(self, request, headers_to_sign):
+ headers = dict((name.lower(), value) for name, value in request.headers.items() if value)
+ if 'content-length' in headers and headers['content-length'] == '0':
+ del headers['content-length']
+ return '\n'.join(headers.get(x, '') for x in headers_to_sign) + '\n'
+
+ def _get_verb(self, request):
+ return request.method + '\n'
+
+ def _get_canonicalized_resource(self, request):
+ # uri_path = request.path.split('?')[0]
+ uri_path = urlparse(request.url).path
+
+ # for emulator, use the DEV_ACCOUNT_NAME instead of DEV_ACCOUNT_SECONDARY_NAME
+ # as this is how the emulator works
+ if self.is_emulated and uri_path.find(DEV_ACCOUNT_SECONDARY_NAME) == 1:
+ # only replace the first instance
+ uri_path = uri_path.replace(DEV_ACCOUNT_SECONDARY_NAME, DEV_ACCOUNT_NAME, 1)
+
+ return '/' + self.account_name + uri_path
+
+ def _get_canonicalized_headers(self, request):
+ string_to_sign = ''
+ x_ms_headers = []
+ for name, value in request.headers.items():
+ if name.startswith('x-ms-'):
+ x_ms_headers.append((name.lower(), value))
+ x_ms_headers.sort()
+ for name, value in x_ms_headers:
+ if value is not None:
+ string_to_sign += ''.join([name, ':', value, '\n'])
+ return string_to_sign
+
+ def _add_authorization_header(self, request, string_to_sign):
+ try:
+ signature = _sign_string(self.account_key, string_to_sign)
+ auth_string = 'SharedKey ' + self.account_name + ':' + signature
+ request.headers['Authorization'] = auth_string
+ except Exception as ex:
+ # Wrap any error that occurred as signing error
+ # Doing so will clarify/locate the source of problem
+ raise _wrap_exception(ex, AzureSigningError)
+
+ def on_request(self, request): # type: (PipelineRequest) -> Union[None, Awaitable[None]]
+ self.sign_request(request.http_request)
+
+ def sign_request(self, request):
+ string_to_sign = \
+ self._get_verb(request) + \
+ self._get_headers(
+ request,
+ ['content-md5', 'content-type', 'x-ms-date'],
+ ) + \
+ self._get_canonicalized_resource(request) + \
+ self._get_canonicalized_resource_query(request)
+ self._add_authorization_header(request, string_to_sign)
+ logger.debug("String_to_sign=%s", string_to_sign)
+
+ def _get_canonicalized_resource_query(self, request):
+ for name, value in request.query.items():
+ if name == 'comp':
+ return '?comp=' + value
+ return ''
+
+ # def _get_canonicalized_resource_query(self, request):
+ # sorted_queries = [(name, value) for name, value in request.query.items()]
+ # sorted_queries.sort()
+ #
+ # string_to_sign = ''
+ # for name, value in sorted_queries:
+ # if value is not None:
+ # string_to_sign += '\n' + name.lower() + ':' + value
+ # return string_to_sign
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/base_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/base_client.py
new file mode 100644
index 000000000000..30007bf7b9b9
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/base_client.py
@@ -0,0 +1,434 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+from typing import ( # pylint: disable=unused-import
+ Union,
+ Optional,
+ Any,
+ Iterable,
+ Dict,
+ List,
+ Type,
+ Tuple,
+ TYPE_CHECKING,
+)
+import logging
+
+
+
+try:
+ from urllib.parse import parse_qs, quote
+except ImportError:
+ from urlparse import parse_qs # type: ignore
+ from urllib2 import quote # type: ignore
+
+import six
+from azure.data.tables._shared.shared_access_signature import QueryStringConstants
+from azure.core.configuration import Configuration
+from azure.core.exceptions import HttpResponseError
+from azure.core.pipeline import Pipeline
+from azure.core.pipeline.transport import RequestsTransport, HttpTransport
+from azure.core.pipeline.policies import (
+ RedirectPolicy,
+ ContentDecodePolicy,
+ BearerTokenCredentialPolicy,
+ ProxyPolicy,
+ DistributedTracingPolicy,
+ HttpLoggingPolicy,
+ UserAgentPolicy
+)
+
+from .constants import STORAGE_OAUTH_SCOPE, SERVICE_HOST_BASE, CONNECTION_TIMEOUT, READ_TIMEOUT
+from .models import LocationMode
+from .authentication import SharedKeyCredentialPolicy
+from .policies import (
+ StorageHeadersPolicy,
+ StorageContentValidation,
+ StorageRequestHook,
+ StorageResponseHook,
+ StorageLoggingPolicy,
+ StorageHosts, ExponentialRetry,
+)
+from .._version import VERSION
+from .response_handlers import process_table_error, PartialBatchErrorException
+
+
+_LOGGER = logging.getLogger(__name__)
+_SERVICE_PARAMS = {
+ "blob": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"},
+ "queue": {"primary": "QueueEndpoint", "secondary": "QueueSecondaryEndpoint"},
+ "file": {"primary": "FileEndpoint", "secondary": "FileSecondaryEndpoint"},
+ "dfs": {"primary": "BlobEndpoint", "secondary": "BlobEndpoint"},
+ "table": {"primary": "TableEndpoint", "secondary": "TableSecondaryEndpoint"},
+}
+
+
+class StorageAccountHostsMixin(object): # pylint: disable=too-many-instance-attributes
+ def __init__(
+ self,
+ parsed_url, # type: Any
+ service, # type: str
+ credential=None, # type: Optional[Any]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ self._location_mode = kwargs.get("_location_mode", LocationMode.PRIMARY)
+ self._hosts = kwargs.get("_hosts")
+ self.scheme = parsed_url.scheme
+
+ if service not in ["blob", "queue", "file-share", "dfs", "table"]:
+ raise ValueError("Invalid service: {}".format(service))
+ service_name = service.split('-')[0]
+ account = parsed_url.netloc.split(".{}.core.".format(service_name))
+ self.account_name = account[0] if len(account) > 1 else None
+ secondary_hostname = None
+
+ self.credential = format_shared_key_credential(account, credential)
+ if self.scheme.lower() != "https" and hasattr(self.credential, "get_token"):
+ raise ValueError("Token credential is only supported with HTTPS.")
+ if hasattr(self.credential, "account_name"):
+ self.account_name = self.credential.account_name
+ secondary_hostname = "{}-secondary.{}.{}".format(
+ self.credential.account_name, service_name, SERVICE_HOST_BASE)
+
+ if not self._hosts:
+ if len(account) > 1:
+ secondary_hostname = parsed_url.netloc.replace(account[0], account[0] + "-secondary")
+ if kwargs.get("secondary_hostname"):
+ secondary_hostname = kwargs["secondary_hostname"]
+ primary_hostname = (parsed_url.netloc + parsed_url.path).rstrip('/')
+ self._hosts = {LocationMode.PRIMARY: primary_hostname, LocationMode.SECONDARY: secondary_hostname}
+
+ self.require_encryption = kwargs.get("require_encryption", False)
+ self.key_encryption_key = kwargs.get("key_encryption_key")
+ self.key_resolver_function = kwargs.get("key_resolver_function")
+ self._config, self._pipeline = self._create_pipeline(self.credential, storage_sdk=service, **kwargs)
+
+ def __enter__(self):
+ self._client.__enter__()
+ return self
+
+ def __exit__(self, *args):
+ self._client.__exit__(*args)
+
+ def close(self):
+ """ This method is to close the sockets opened by the client.
+ It need not be used when using with a context manager.
+ """
+ self._client.close()
+
+ @property
+ def url(self):
+ """The full endpoint URL to this entity, including SAS token if used.
+
+ This could be either the primary endpoint,
+ or the secondary endpoint depending on the current :func:`location_mode`.
+ """
+ return self._format_url(self._hosts[self._location_mode])
+
+ @property
+ def _primary_endpoint(self):
+ """The full primary endpoint URL.
+
+ :type: str
+ """
+ return self._format_url(self._hosts[LocationMode.PRIMARY])
+
+ @property
+ def _primary_hostname(self):
+ """The hostname of the primary endpoint.
+
+ :type: str
+ """
+ return self._hosts[LocationMode.PRIMARY]
+
+ @property
+ def _secondary_endpoint(self):
+ """The full secondary endpoint URL if configured.
+
+ If not available a ValueError will be raised. To explicitly specify a secondary hostname, use the optional
+ `secondary_hostname` keyword argument on instantiation.
+
+ :type: str
+ :raise ValueError:
+ """
+ if not self._hosts[LocationMode.SECONDARY]:
+ raise ValueError("No secondary host configured.")
+ return self._format_url(self._hosts[LocationMode.SECONDARY])
+
+ @property
+ def _secondary_hostname(self):
+ """The hostname of the secondary endpoint.
+
+ If not available this will be None. To explicitly specify a secondary hostname, use the optional
+ `secondary_hostname` keyword argument on instantiation.
+
+ :type: str or None
+ """
+ return self._hosts[LocationMode.SECONDARY]
+
+ @property
+ def location_mode(self):
+ """The location mode that the client is currently using.
+
+ By default this will be "primary". Options include "primary" and "secondary".
+
+ :type: str
+ """
+
+ return self._location_mode
+
+ @location_mode.setter
+ def location_mode(self, value):
+ if self._hosts.get(value):
+ self._location_mode = value
+ self._client._config.url = self.url # pylint: disable=protected-access
+ else:
+ raise ValueError("No host URL for location mode: {}".format(value))
+
+ @property
+ def api_version(self):
+ """The version of the Storage API used for requests.
+
+ :type: str
+ """
+ return self._client._config.version # pylint: disable=protected-access
+
+ def _format_query_string(self, sas_token, credential, snapshot=None, share_snapshot=None):
+ query_str = "?"
+ if snapshot:
+ query_str += "snapshot={}&".format(self.snapshot)
+ if share_snapshot:
+ query_str += "sharesnapshot={}&".format(self.snapshot)
+ if sas_token and not credential:
+ query_str += sas_token
+ elif is_credential_sastoken(credential):
+ query_str += credential.lstrip("?")
+ credential = None
+ return query_str.rstrip("?&"), credential
+
+ def _create_pipeline(self, credential, **kwargs):
+ # type: (Any, **Any) -> Tuple[Configuration, Pipeline]
+ self._credential_policy = None
+ if hasattr(credential, "get_token"):
+ self._credential_policy = BearerTokenCredentialPolicy(credential, STORAGE_OAUTH_SCOPE)
+ elif isinstance(credential, SharedKeyCredentialPolicy):
+ self._credential_policy = credential
+ elif credential is not None:
+ raise TypeError("Unsupported credential: {}".format(credential))
+
+ config = kwargs.get("_configuration") or create_configuration(**kwargs)
+ if kwargs.get("_pipeline"):
+ return config, kwargs["_pipeline"]
+ config.transport = kwargs.get("transport") # type: ignore
+ kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT)
+ kwargs.setdefault("read_timeout", READ_TIMEOUT)
+ if not config.transport:
+ config.transport = RequestsTransport(**kwargs)
+ policies = [
+ config.headers_policy,
+ config.proxy_policy,
+ config.user_agent_policy,
+ StorageContentValidation(),
+ StorageRequestHook(**kwargs),
+ self._credential_policy,
+ ContentDecodePolicy(response_encoding="utf-8"),
+ RedirectPolicy(**kwargs),
+ StorageHosts(hosts=self._hosts, **kwargs),
+ config.retry_policy,
+ config.logging_policy,
+ StorageResponseHook(**kwargs),
+ DistributedTracingPolicy(**kwargs),
+ HttpLoggingPolicy(**kwargs)
+ ]
+ return config, Pipeline(config.transport, policies=policies)
+
+ def _batch_send(
+ self, *reqs, # type: HttpRequest
+ **kwargs
+ ):
+ """Given a series of request, do a Storage batch call.
+ """
+ # Pop it here, so requests doesn't feel bad about additional kwarg
+ raise_on_any_failure = kwargs.pop("raise_on_any_failure", True)
+ request = self._client._client.post( # pylint: disable=protected-access
+ url='{}://{}/?comp=batch{}{}'.format(
+ self.scheme,
+ self._primary_hostname,
+ kwargs.pop('sas', None),
+ kwargs.pop('timeout', None)
+ ),
+ headers={
+ 'x-ms-version': self.api_version
+ }
+ )
+
+ policies = [StorageHeadersPolicy()]
+ if self._credential_policy:
+ policies.append(self._credential_policy)
+
+ request.set_multipart_mixed(
+ *reqs,
+ policies=policies,
+ enforce_https=False
+ )
+
+ pipeline_response = self._pipeline.run(
+ request, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ try:
+ if response.status_code not in [202]:
+ raise HttpResponseError(response=response)
+ parts = response.parts()
+ if raise_on_any_failure:
+ parts = list(response.parts())
+ if any(p for p in parts if not 200 <= p.status_code < 300):
+ error = PartialBatchErrorException(
+ message="There is a partial failure in the batch operation.",
+ response=response, parts=parts
+ )
+ raise error
+ return iter(parts)
+ return parts
+ except HttpResponseError as error:
+ process_table_error(error)
+
+class TransportWrapper(HttpTransport):
+ """Wrapper class that ensures that an inner client created
+ by a `get_client` method does not close the outer transport for the parent
+ when used in a context manager.
+ """
+ def __init__(self, transport):
+ self._transport = transport
+
+ def send(self, request, **kwargs):
+ return self._transport.send(request, **kwargs)
+
+ def open(self):
+ pass
+
+ def close(self):
+ pass
+
+ def __enter__(self):
+ pass
+
+ def __exit__(self, *args): # pylint: disable=arguments-differ
+ pass
+
+
+def format_shared_key_credential(account, credential):
+ if isinstance(credential, six.string_types):
+ if len(account) < 2:
+ raise ValueError("Unable to determine account name for shared key credential.")
+ credential = {"account_name": account[0], "account_key": credential}
+ if isinstance(credential, dict):
+ if "account_name" not in credential:
+ raise ValueError("Shared key credential missing 'account_name")
+ if "account_key" not in credential:
+ raise ValueError("Shared key credential missing 'account_key")
+ return SharedKeyCredentialPolicy(**credential)
+ return credential
+
+
+def parse_connection_str(conn_str, credential, service):
+ conn_str = conn_str.rstrip(";")
+ conn_settings = [s.split("=", 1) for s in conn_str.split(";")]
+ if any(len(tup) != 2 for tup in conn_settings):
+ raise ValueError("Connection string is either blank or malformed.")
+ conn_settings = dict(conn_settings)
+ endpoints = _SERVICE_PARAMS[service]
+ primary = None
+ secondary = None
+ if not credential:
+ try:
+ credential = {"account_name": conn_settings["AccountName"], "account_key": conn_settings["AccountKey"]}
+ except KeyError:
+ credential = conn_settings.get("SharedAccessSignature")
+ if endpoints["primary"] in conn_settings:
+ primary = conn_settings[endpoints["primary"]]
+ if endpoints["secondary"] in conn_settings:
+ secondary = conn_settings[endpoints["secondary"]]
+ else:
+ if endpoints["secondary"] in conn_settings:
+ raise ValueError("Connection string specifies only secondary endpoint.")
+ try:
+ primary = "{}://{}.{}.{}".format(
+ conn_settings["DefaultEndpointsProtocol"],
+ conn_settings["AccountName"],
+ service,
+ conn_settings["EndpointSuffix"],
+ )
+ secondary = "{}-secondary.{}.{}".format(
+ conn_settings["AccountName"], service, conn_settings["EndpointSuffix"]
+ )
+ except KeyError:
+ pass
+
+ if not primary:
+ try:
+ primary = "https://{}.{}.{}".format(
+ conn_settings["AccountName"], service, conn_settings.get("EndpointSuffix", SERVICE_HOST_BASE)
+ )
+ except KeyError:
+ raise ValueError("Connection string missing required connection details.")
+ return primary, secondary, credential
+
+
+def create_configuration(**kwargs):
+ # type: (**Any) -> Configuration
+ config = Configuration(**kwargs)
+ config.headers_policy = StorageHeadersPolicy(**kwargs)
+ config.user_agent_policy = UserAgentPolicy(
+ sdk_moniker="storage-{}/{}".format(kwargs.pop('storage_sdk'), VERSION), **kwargs)
+ config.retry_policy = kwargs.get("retry_policy") or ExponentialRetry(**kwargs)
+ config.logging_policy = StorageLoggingPolicy(**kwargs)
+ config.proxy_policy = ProxyPolicy(**kwargs)
+
+ # Storage settings
+ config.max_single_put_size = kwargs.get("max_single_put_size", 64 * 1024 * 1024)
+ config.copy_polling_interval = 15
+
+ # Block blob uploads
+ config.max_block_size = kwargs.get("max_block_size", 4 * 1024 * 1024)
+ config.min_large_block_upload_threshold = kwargs.get("min_large_block_upload_threshold", 4 * 1024 * 1024 + 1)
+ config.use_byte_buffer = kwargs.get("use_byte_buffer", False)
+
+ # Page blob uploads
+ config.max_page_size = kwargs.get("max_page_size", 4 * 1024 * 1024)
+
+ # Blob downloads
+ config.max_single_get_size = kwargs.get("max_single_get_size", 32 * 1024 * 1024)
+ config.max_chunk_get_size = kwargs.get("max_chunk_get_size", 4 * 1024 * 1024)
+
+ # File uploads
+ config.max_range_size = kwargs.get("max_range_size", 4 * 1024 * 1024)
+ return config
+
+
+def parse_query(query_str):
+ sas_values = QueryStringConstants.to_list()
+ parsed_query = {k: v[0] for k, v in parse_qs(query_str).items()}
+ sas_params = ["{}={}".format(k, quote(v, safe='')) for k, v in parsed_query.items() if k in sas_values]
+ sas_token = None
+ if sas_params:
+ sas_token = "&".join(sas_params)
+
+ snapshot = parsed_query.get("snapshot") or parsed_query.get("sharesnapshot")
+ return snapshot, sas_token
+
+
+def is_credential_sastoken(credential):
+ if not credential or not isinstance(credential, six.string_types):
+ return False
+
+ sas_values = QueryStringConstants.to_list()
+ parsed_query = parse_qs(credential.lstrip("?"))
+ if parsed_query and all([k in sas_values for k in parsed_query.keys()]):
+ return True
+ return False
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/base_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/base_client_async.py
new file mode 100644
index 000000000000..18597c9a5a29
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/base_client_async.py
@@ -0,0 +1,174 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+from typing import ( # pylint: disable=unused-import
+ Union, Optional, Any, Iterable, Dict, List, Type, Tuple,
+ TYPE_CHECKING
+)
+import logging
+from azure.core.pipeline import AsyncPipeline
+from azure.core.async_paging import AsyncList
+from azure.core.exceptions import HttpResponseError
+from azure.core.pipeline.policies import (
+ ContentDecodePolicy,
+ AsyncBearerTokenCredentialPolicy,
+ AsyncRedirectPolicy,
+ DistributedTracingPolicy,
+ HttpLoggingPolicy,
+)
+from azure.core.pipeline.transport import AsyncHttpTransport
+
+from .constants import STORAGE_OAUTH_SCOPE, CONNECTION_TIMEOUT, READ_TIMEOUT
+from .authentication import SharedKeyCredentialPolicy
+from .base_client import create_configuration
+from .policies import (
+ StorageContentValidation,
+ StorageRequestHook,
+ StorageHosts,
+ StorageHeadersPolicy
+)
+from .policies_async import AsyncStorageResponseHook
+
+from .response_handlers import process_table_error, PartialBatchErrorException
+
+if TYPE_CHECKING:
+ from azure.core.pipeline import Pipeline
+ from azure.core.pipeline.transport import HttpRequest
+ from azure.core.configuration import Configuration
+_LOGGER = logging.getLogger(__name__)
+
+
+class AsyncStorageAccountHostsMixin(object):
+
+ def __enter__(self):
+ raise TypeError("Async client only supports 'async with'.")
+
+ def __exit__(self, *args):
+ pass
+
+ async def __aenter__(self):
+ await self._client.__aenter__()
+ return self
+
+ async def __aexit__(self, *args):
+ await self._client.__aexit__(*args)
+
+ async def close(self):
+ """ This method is to close the sockets opened by the client.
+ It need not be used when using with a context manager.
+ """
+ await self._client.close()
+
+ def _create_pipeline(self, credential, **kwargs):
+ # type: (Any, **Any) -> Tuple[Configuration, Pipeline]
+ self._credential_policy = None
+ if hasattr(credential, 'get_token'):
+ self._credential_policy = AsyncBearerTokenCredentialPolicy(credential, STORAGE_OAUTH_SCOPE)
+ elif isinstance(credential, SharedKeyCredentialPolicy):
+ self._credential_policy = credential
+ elif credential is not None:
+ raise TypeError("Unsupported credential: {}".format(credential))
+ config = kwargs.get('_configuration') or create_configuration(**kwargs)
+ if kwargs.get('_pipeline'):
+ return config, kwargs['_pipeline']
+ config.transport = kwargs.get('transport') # type: ignore
+ kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT)
+ kwargs.setdefault("read_timeout", READ_TIMEOUT)
+ if not config.transport:
+ try:
+ from azure.core.pipeline.transport import AioHttpTransport
+ except ImportError:
+ raise ImportError("Unable to create async transport. Please check aiohttp is installed.")
+ config.transport = AioHttpTransport(**kwargs)
+ policies = [
+ config.headers_policy,
+ config.proxy_policy,
+ config.user_agent_policy,
+ StorageContentValidation(),
+ StorageRequestHook(**kwargs),
+ self._credential_policy,
+ ContentDecodePolicy(response_encoding="utf-8"),
+ AsyncRedirectPolicy(**kwargs),
+ StorageHosts(hosts=self._hosts, **kwargs), # type: ignore
+ config.retry_policy,
+ config.logging_policy,
+ AsyncStorageResponseHook(**kwargs),
+ DistributedTracingPolicy(**kwargs),
+ HttpLoggingPolicy(**kwargs),
+ ]
+ return config, AsyncPipeline(config.transport, policies=policies)
+
+ async def _batch_send(
+ self, *reqs: 'HttpRequest',
+ **kwargs
+ ):
+ """Given a series of request, do a Storage batch call.
+ """
+ # Pop it here, so requests doesn't feel bad about additional kwarg
+ raise_on_any_failure = kwargs.pop("raise_on_any_failure", True)
+ request = self._client._client.post( # pylint: disable=protected-access
+ url='https://{}/?comp=batch'.format(self.primary_hostname),
+ headers={
+ 'x-ms-version': self.api_version
+ }
+ )
+
+ request.set_multipart_mixed(
+ *reqs,
+ policies=[
+ StorageHeadersPolicy(),
+ self._credential_policy
+ ],
+ enforce_https=False
+ )
+
+ pipeline_response = await self._pipeline.run(
+ request, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ try:
+ if response.status_code not in [202]:
+ raise HttpResponseError(response=response)
+ parts = response.parts() # Return an AsyncIterator
+ if raise_on_any_failure:
+ parts_list = []
+ async for part in parts:
+ parts_list.append(part)
+ if any(p for p in parts_list if not 200 <= p.status_code < 300):
+ error = PartialBatchErrorException(
+ message="There is a partial failure in the batch operation.",
+ response=response, parts=parts_list
+ )
+ raise error
+ return AsyncList(parts_list)
+ return parts
+ except HttpResponseError as error:
+ process_table_error(error)
+
+
+class AsyncTransportWrapper(AsyncHttpTransport):
+ """Wrapper class that ensures that an inner client created
+ by a `get_client` method does not close the outer transport for the parent
+ when used in a context manager.
+ """
+ def __init__(self, async_transport):
+ self._transport = async_transport
+
+ async def send(self, request, **kwargs):
+ return await self._transport.send(request, **kwargs)
+
+ async def open(self):
+ pass
+
+ async def close(self):
+ pass
+
+ async def __aenter__(self):
+ pass
+
+ async def __aexit__(self, *args): # pylint: disable=arguments-differ
+ pass
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/constants.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/constants.py
new file mode 100644
index 000000000000..7fb05b559850
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/constants.py
@@ -0,0 +1,26 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import sys
+from .._generated.version import VERSION
+
+
+X_MS_VERSION = VERSION
+
+# Socket timeout in seconds
+CONNECTION_TIMEOUT = 20
+READ_TIMEOUT = 20
+
+# for python 3.5+, there was a change to the definition of the socket timeout (as far as socket.sendall is concerned)
+# The socket timeout is now the maximum total duration to send all data.
+if sys.version_info >= (3, 5):
+ # the timeout to connect is 20 seconds, and the read timeout is 2000 seconds
+ # the 2000 seconds was calculated with: 100MB (max block size)/ 50KB/s (an arbitrarily chosen minimum upload speed)
+ READ_TIMEOUT = 2000
+
+STORAGE_OAUTH_SCOPE = "https://storage.azure.com/.default"
+
+SERVICE_HOST_BASE = 'core.windows.net'
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/models.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/models.py
new file mode 100644
index 000000000000..c7ff9db66035
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/models.py
@@ -0,0 +1,350 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from enum import Enum
+
+
+def get_enum_value(value):
+ if value is None or value in ["None", ""]:
+ return None
+ try:
+ return value.value
+ except AttributeError:
+ return value
+
+
+class TableErrorCode(str, Enum):
+ # Generic storage values
+ account_already_exists = "AccountAlreadyExists"
+ account_being_created = "AccountBeingCreated"
+ account_is_disabled = "AccountIsDisabled"
+ authentication_failed = "AuthenticationFailed"
+ authorization_failure = "AuthorizationFailure"
+ no_authentication_information = "NoAuthenticationInformation"
+ condition_headers_not_supported = "ConditionHeadersNotSupported"
+ condition_not_met = "ConditionNotMet"
+ empty_metadata_key = "EmptyMetadataKey"
+ insufficient_account_permissions = "InsufficientAccountPermissions"
+ internal_error = "InternalError"
+ invalid_authentication_info = "InvalidAuthenticationInfo"
+ invalid_header_value = "InvalidHeaderValue"
+ invalid_http_verb = "InvalidHttpVerb"
+ invalid_input = "InvalidInput"
+ invalid_md5 = "InvalidMd5"
+ invalid_metadata = "InvalidMetadata"
+ invalid_query_parameter_value = "InvalidQueryParameterValue"
+ invalid_range = "InvalidRange"
+ invalid_resource_name = "InvalidResourceName"
+ invalid_uri = "InvalidUri"
+ invalid_xml_document = "InvalidXmlDocument"
+ invalid_xml_node_value = "InvalidXmlNodeValue"
+ md5_mismatch = "Md5Mismatch"
+ metadata_too_large = "MetadataTooLarge"
+ missing_content_length_header = "MissingContentLengthHeader"
+ missing_required_query_parameter = "MissingRequiredQueryParameter"
+ missing_required_header = "MissingRequiredHeader"
+ missing_required_xml_node = "MissingRequiredXmlNode"
+ multiple_condition_headers_not_supported = "MultipleConditionHeadersNotSupported"
+ operation_timed_out = "OperationTimedOut"
+ out_of_range_input = "OutOfRangeInput"
+ out_of_range_query_parameter_value = "OutOfRangeQueryParameterValue"
+ request_body_too_large = "RequestBodyTooLarge"
+ resource_type_mismatch = "ResourceTypeMismatch"
+ request_url_failed_to_parse = "RequestUrlFailedToParse"
+ resource_already_exists = "ResourceAlreadyExists"
+ resource_not_found = "ResourceNotFound"
+ server_busy = "ServerBusy"
+ unsupported_header = "UnsupportedHeader"
+ unsupported_xml_node = "UnsupportedXmlNode"
+ unsupported_query_parameter = "UnsupportedQueryParameter"
+ unsupported_http_verb = "UnsupportedHttpVerb"
+
+ # table error codes
+ duplicate_properties_specified = "DuplicatePropertiesSpecified"
+ entity_not_found = "EntityNotFound"
+ entity_already_exists = "EntityAlreadyExists"
+ entity_too_large = "EntityTooLarge"
+ host_information_not_present = "HostInformationNotPresent"
+ invalid_duplicate_row = "InvalidDuplicateRow"
+ invalid_value_type = "InvalidValueType"
+ json_format_not_supported = "JsonFormatNotSupported"
+ method_not_allowed = "MethodNotAllowed"
+ not_implemented = "NotImplemented"
+ properties_need_value = "PropertiesNeedValue"
+ property_name_invalid = "PropertyNameInvalid"
+ property_name_too_long = "PropertyNameTooLong"
+ property_value_too_large = "PropertyValueTooLarge"
+ table_already_exists = "TableAlreadyExists"
+ table_being_deleted = "TableBeingDeleted"
+ table_not_found = "TableNotFound"
+ too_many_properties = "TooManyProperties"
+ update_condition_not_satisfied = "UpdateConditionNotSatisfied"
+ x_method_incorrect_count = "XMethodIncorrectCount"
+ x_method_incorrect_value = "XMethodIncorrectValue"
+ x_method_not_using_post = "XMethodNotUsingPost"
+
+
+class DictMixin(object):
+
+ def __setitem__(self, key, item):
+ self.__dict__[key] = item
+
+ def __getitem__(self, key):
+ return self.__dict__[key]
+
+ def __repr__(self):
+ return str(self)
+
+ def __len__(self):
+ return len(self.keys())
+
+ def __delitem__(self, key):
+ self.__dict__[key] = None
+
+ def __eq__(self, other):
+ """Compare objects by comparing all attributes."""
+ if isinstance(other, self.__class__):
+ return self.__dict__ == other.__dict__
+ return False
+
+ def __ne__(self, other):
+ """Compare objects by comparing all attributes."""
+ return not self.__eq__(other)
+
+ def __str__(self):
+ return str({k: v for k, v in self.__dict__.items() if not k.startswith('_')})
+
+ def has_key(self, k):
+ return k in self.__dict__
+
+ def update(self, *args, **kwargs):
+ return self.__dict__.update(*args, **kwargs)
+
+ def keys(self):
+ return [k for k in self.__dict__ if not k.startswith('_')]
+
+ def values(self):
+ return [v for k, v in self.__dict__.items() if not k.startswith('_')]
+
+ def items(self):
+ return [(k, v) for k, v in self.__dict__.items() if not k.startswith('_')]
+
+ def get(self, key, default=None):
+ if key in self.__dict__:
+ return self.__dict__[key]
+ return default
+
+
+class LocationMode(object):
+ """
+ Specifies the location the request should be sent to. This mode only applies
+ for RA-GRS accounts which allow secondary read access. All other account types
+ must use PRIMARY.
+ """
+
+ PRIMARY = 'primary' #: Requests should be sent to the primary location.
+ SECONDARY = 'secondary' #: Requests should be sent to the secondary location, if possible.
+
+
+class ResourceTypes(object):
+ """
+ Specifies the resource types that are accessible with the account SAS.
+
+ :param bool service:
+ Access to service-level APIs (e.g., Get/Set Service Properties,
+ Get Service Stats, List Containers/Queues/Shares)
+ :param bool object:
+ Access to object-level APIs for blobs, queue messages, and
+ files(e.g. Put Blob, Query Entity, Get Messages, Create File, etc.)
+ """
+
+ def __init__(self, service=False, object=False): # pylint: disable=redefined-builtin
+ self.service = service
+ self.object = object
+ self._str = (('s' if self.service else '') +
+ ('o' if self.object else ''))
+
+ def __str__(self):
+ return self._str
+
+ @classmethod
+ def from_string(cls, string):
+ """Create a ResourceTypes from a string.
+
+ To specify service, container, or object you need only to
+ include the first letter of the word in the string. E.g. service and container,
+ you would provide a string "sc".
+
+ :param str string: Specify service, container, or object in
+ in the string with the first letter of the word.
+ :return: A ResourceTypes object
+ :rtype: ~azure.data.tables.ResourceTypes
+ """
+ res_service = 's' in string
+ res_object = 'o' in string
+
+ parsed = cls(res_service, res_object)
+ parsed._str = string # pylint: disable = protected-access
+ return parsed
+
+
+class AccountSasPermissions(object):
+ """
+ :class:`~ResourceTypes` class to be used with generate_account_sas
+ function and for the AccessPolicies used with set_*_acl. There are two types of
+ SAS which may be used to grant resource access. One is to grant access to a
+ specific resource (resource-specific). Another is to grant access to the
+ entire service for a specific account and allow certain operations based on
+ perms found here.
+
+ :ivar bool read:
+ Valid for all signed resources types (Service, Container, and Object).
+ Permits read permissions to the specified resource type.
+ :ivar bool write:
+ Valid for all signed resources types (Service, Container, and Object).
+ Permits write permissions to the specified resource type.
+ :ivar bool delete:
+ Valid for Container and Object resource types, except for queue messages.
+ :ivar bool list:
+ Valid for Service and Container resource types only.
+ :ivar bool add:
+ Valid for the following Object resource types only: queue messages, and append blobs.
+ :ivar bool create:
+ Valid for the following Object resource types only: blobs and files.
+ Users can create new blobs or files, but may not overwrite existing
+ blobs or files.
+ :ivar bool update:
+ Valid for the following Object resource types only: queue messages.
+ :ivar bool process:
+ Valid for the following Object resource type only: queue messages.
+ """
+
+ def __init__(self, **kwargs): # pylint: disable=redefined-builtin
+ self.read = kwargs.pop('read', None)
+ self.write = kwargs.pop('write', None)
+ self.delete = kwargs.pop('delete', None)
+ self.list = kwargs.pop('list', None)
+ self.add = kwargs.pop('add', None)
+ self.create = kwargs.pop('create', None)
+ self.update = kwargs.pop('update', None)
+ self.process = kwargs.pop('process', None)
+ self._str = (('r' if self.read else '') +
+ ('w' if self.write else '') +
+ ('d' if self.delete else '') +
+ ('l' if self.list else '') +
+ ('a' if self.add else '') +
+ ('c' if self.create else '') +
+ ('u' if self.update else '') +
+ ('p' if self.process else ''))
+
+ def __str__(self):
+ return self._str
+
+ @classmethod
+ def from_string(cls, permission, **kwargs): # pylint:disable=W0613
+ """Create AccountSasPermissions from a string.
+
+ To specify read, write, delete, etc. permissions you need only to
+ include the first letter of the word in the string. E.g. for read and write
+ permissions you would provide a string "rw".
+
+ :param str permission: Specify permissions in
+ the string with the first letter of the word.
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: A AccountSasPermissions object
+ :rtype: ~azure.data.tables.AccountSasPermissions
+ """
+ p_read = 'r' in permission
+ p_write = 'w' in permission
+ p_delete = 'd' in permission
+ p_list = 'l' in permission
+ p_add = 'a' in permission
+ p_create = 'c' in permission
+ p_update = 'u' in permission
+ p_process = 'p' in permission
+
+ parsed = cls(
+ **dict(kwargs, read=p_read, write=p_write, delete=p_delete, list=p_list, add=p_add, create=p_create,
+ update=p_update, process=p_process))
+ parsed._str = permission # pylint: disable = protected-access
+ return parsed
+
+
+class Services(object):
+ """Specifies the services accessible with the account SAS.
+
+ :param bool blob:
+ Access for the `~azure.storage.blob.BlobServiceClient`
+ :param bool queue:
+ Access for the `~azure.data.tables.QueueServiceClient`
+ :param bool fileshare:
+ Access for the `~azure.storage.fileshare.ShareServiceClient`
+ """
+
+ def __init__(self, blob=False, queue=False, fileshare=False):
+ self.blob = blob
+ self.queue = queue
+ self.fileshare = fileshare
+ self._str = (('b' if self.blob else '') +
+ ('q' if self.queue else '') +
+ ('f' if self.fileshare else ''))
+
+ def __str__(self):
+ return self._str
+
+ @classmethod
+ def from_string(cls, string):
+ """Create Services from a string.
+
+ To specify blob, queue, or file you need only to
+ include the first letter of the word in the string. E.g. for blob and queue
+ you would provide a string "bq".
+
+ :param str string: Specify blob, queue, or file in
+ in the string with the first letter of the word.
+ :return: A Services object
+ :rtype: ~azure.data.tables.Services
+ """
+ res_blob = 'b' in string
+ res_queue = 'q' in string
+ res_file = 'f' in string
+
+ parsed = cls(res_blob, res_queue, res_file)
+ parsed._str = string # pylint: disable = protected-access
+ return parsed
+
+
+class UserDelegationKey(object):
+ """
+ Represents a user delegation key, provided to the user by Azure Storage
+ based on their Azure Active Directory access token.
+
+ The fields are saved as simple strings since the user does not have to interact with this object;
+ to generate an identify SAS, the user can simply pass it to the right API.
+
+ :ivar str signed_oid:
+ Object ID of this token.
+ :ivar str signed_tid:
+ Tenant ID of the tenant that issued this token.
+ :ivar str signed_start:
+ The datetime this token becomes valid.
+ :ivar str signed_expiry:
+ The datetime this token expires.
+ :ivar str signed_service:
+ What service this key is valid for.
+ :ivar str signed_version:
+ The version identifier of the REST service that created this token.
+ :ivar str value:
+ The user delegation key.
+ """
+
+ def __init__(self):
+ self.signed_oid = None
+ self.signed_tid = None
+ self.signed_start = None
+ self.signed_expiry = None
+ self.signed_service = None
+ self.signed_version = None
+ self.value = None
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/parser.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/parser.py
new file mode 100644
index 000000000000..c6feba8a6393
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/parser.py
@@ -0,0 +1,20 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import sys
+
+if sys.version_info < (3,):
+ def _str(value):
+ if isinstance(value, unicode): # pylint: disable=undefined-variable
+ return value.encode('utf-8')
+
+ return str(value)
+else:
+ _str = str
+
+
+def _to_utc_datetime(value):
+ return value.strftime('%Y-%m-%dT%H:%M:%SZ')
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/policies.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/policies.py
new file mode 100644
index 000000000000..adc84c59dded
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/policies.py
@@ -0,0 +1,628 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import base64
+import hashlib
+import re
+import random
+from time import time
+from io import SEEK_SET, UnsupportedOperation
+import logging
+import uuid
+import types
+from typing import Any, TYPE_CHECKING
+from wsgiref.handlers import format_date_time
+
+try:
+ from urllib.parse import (
+ urlparse,
+ parse_qsl,
+ urlunparse,
+ urlencode,
+ )
+except ImportError:
+ from urllib import urlencode # type: ignore
+ from urlparse import ( # type: ignore
+ urlparse,
+ parse_qsl,
+ urlunparse,
+ )
+
+from azure.core.pipeline.policies import (
+ HeadersPolicy,
+ SansIOHTTPPolicy,
+ NetworkTraceLoggingPolicy,
+ HTTPPolicy,
+ RequestHistory
+)
+from azure.core.exceptions import AzureError, ServiceRequestError, ServiceResponseError
+
+from .models import LocationMode
+
+try:
+ _unicode_type = unicode # type: ignore
+except NameError:
+ _unicode_type = str
+
+if TYPE_CHECKING:
+ from azure.core.pipeline import PipelineRequest, PipelineResponse
+
+_LOGGER = logging.getLogger(__name__)
+
+
+def encode_base64(data):
+ if isinstance(data, _unicode_type):
+ data = data.encode('utf-8')
+ encoded = base64.b64encode(data)
+ return encoded.decode('utf-8')
+
+
+def is_exhausted(settings):
+ """Are we out of retries?"""
+ retry_counts = (settings['total'], settings['connect'], settings['read'], settings['status'])
+ retry_counts = list(filter(None, retry_counts))
+ if not retry_counts:
+ return False
+ return min(retry_counts) < 0
+
+
+def retry_hook(settings, **kwargs):
+ if settings['hook']:
+ settings['hook'](retry_count=settings['count'] - 1, location_mode=settings['mode'], **kwargs)
+
+
+def is_retry(response, mode):
+ """Is this method/status code retryable? (Based on whitelists and control
+ variables such as the number of total retries to allow, whether to
+ respect the Retry-After header, whether this header is present, and
+ whether the returned status code is on the list of status codes to
+ be retried upon on the presence of the aforementioned header)
+ """
+ status = response.http_response.status_code
+ if 300 <= status < 500:
+ # An exception occured, but in most cases it was expected. Examples could
+ # include a 309 Conflict or 412 Precondition Failed.
+ if status == 404 and mode == LocationMode.SECONDARY:
+ # Response code 404 should be retried if secondary was used.
+ return True
+ if status == 408:
+ # Response code 408 is a timeout and should be retried.
+ return True
+ return False
+ if status >= 500:
+ # Response codes above 500 with the exception of 501 Not Implemented and
+ # 505 Version Not Supported indicate a server issue and should be retried.
+ if status in [501, 505]:
+ return False
+ return True
+ return False
+
+
+def urljoin(base_url, stub_url):
+ parsed = urlparse(base_url)
+ parsed = parsed._replace(path=parsed.path + '/' + stub_url)
+ return parsed.geturl()
+
+
+class StorageHeadersPolicy(HeadersPolicy):
+ request_id_header_name = 'x-ms-client-request-id'
+
+ def on_request(self, request):
+ # type: (PipelineRequest, Any) -> None
+ super(StorageHeadersPolicy, self).on_request(request)
+ current_time = format_date_time(time())
+ request.http_request.headers['x-ms-date'] = current_time
+ request.http_request.headers['Date'] = current_time
+ custom_id = request.context.options.pop('client_request_id', None)
+ request.http_request.headers['x-ms-client-request-id'] = custom_id or str(uuid.uuid1())
+
+ def on_response(self, request, response):
+ # raise exception if the echoed client request id from the service is not identical to the one we sent
+ if self.request_id_header_name in response.http_response.headers:
+
+ client_request_id = request.http_request.headers.get(self.request_id_header_name)
+
+ if response.http_response.headers[self.request_id_header_name] != client_request_id:
+ raise AzureError(
+ "Echoed client request ID: {} does not match sent client request ID: {}. "
+ "Service request ID: {}".format(
+ response.http_response.headers[self.request_id_header_name], client_request_id,
+ response.http_response.headers['x-ms-request-id']),
+ response=response.http_response
+ )
+
+
+class StorageHosts(SansIOHTTPPolicy):
+
+ def __init__(self, hosts=None, **kwargs): # pylint: disable=unused-argument
+ self.hosts = hosts
+ super(StorageHosts, self).__init__()
+
+ def on_request(self, request):
+ # type: (PipelineRequest, Any) -> None
+ request.context.options['hosts'] = self.hosts
+ parsed_url = urlparse(request.http_request.url)
+
+ # Detect what location mode we're currently requesting with
+ location_mode = LocationMode.PRIMARY
+ for key, value in self.hosts.items():
+ if parsed_url.netloc == value:
+ location_mode = key
+
+ # See if a specific location mode has been specified, and if so, redirect
+ use_location = request.context.options.pop('use_location', None)
+ if use_location:
+ # Lock retries to the specific location
+ request.context.options['retry_to_secondary'] = False
+ if use_location not in self.hosts:
+ raise ValueError("Attempting to use undefined host location {}".format(use_location))
+ if use_location != location_mode:
+ # Update request URL to use the specified location
+ updated = parsed_url._replace(netloc=self.hosts[use_location])
+ request.http_request.url = updated.geturl()
+ location_mode = use_location
+
+ request.context.options['location_mode'] = location_mode
+
+
+class StorageLoggingPolicy(NetworkTraceLoggingPolicy):
+ """A policy that logs HTTP request and response to the DEBUG logger.
+
+ This accepts both global configuration, and per-request level with "enable_http_logger"
+ """
+
+ def on_request(self, request):
+ # type: (PipelineRequest, Any) -> None
+ http_request = request.http_request
+ options = request.context.options
+ if options.pop("logging_enable", self.enable_http_logger):
+ request.context["logging_enable"] = True
+ if not _LOGGER.isEnabledFor(logging.DEBUG):
+ return
+
+ try:
+ log_url = http_request.url
+ query_params = http_request.query
+ if 'sig' in query_params:
+ log_url = log_url.replace(query_params['sig'], "sig=*****")
+ _LOGGER.debug("Request URL: %r", log_url)
+ _LOGGER.debug("Request method: %r", http_request.method)
+ _LOGGER.debug("Request headers:")
+ for header, value in http_request.headers.items():
+ if header.lower() == 'authorization':
+ value = '*****'
+ elif header.lower() == 'x-ms-copy-source' and 'sig' in value:
+ # take the url apart and scrub away the signed signature
+ scheme, netloc, path, params, query, fragment = urlparse(value)
+ parsed_qs = dict(parse_qsl(query))
+ parsed_qs['sig'] = '*****'
+
+ # the SAS needs to be put back together
+ value = urlunparse((scheme, netloc, path, params, urlencode(parsed_qs), fragment))
+
+ _LOGGER.debug(" %r: %r", header, value)
+ _LOGGER.debug("Request body:")
+
+ # We don't want to log the binary data of a file upload.
+ if isinstance(http_request.body, types.GeneratorType):
+ _LOGGER.debug("File upload")
+ else:
+ _LOGGER.debug(str(http_request.body))
+ except Exception as err: # pylint: disable=broad-except
+ _LOGGER.debug("Failed to log request: %r", err)
+
+ def on_response(self, request, response):
+ # type: (PipelineRequest, PipelineResponse, Any) -> None
+ if response.context.pop("logging_enable", self.enable_http_logger):
+ if not _LOGGER.isEnabledFor(logging.DEBUG):
+ return
+
+ try:
+ _LOGGER.debug("Response status: %r", response.http_response.status_code)
+ _LOGGER.debug("Response headers:")
+ for res_header, value in response.http_response.headers.items():
+ _LOGGER.debug(" %r: %r", res_header, value)
+
+ # We don't want to log binary data if the response is a file.
+ _LOGGER.debug("Response content:")
+ pattern = re.compile(r'attachment; ?filename=["\w.]+', re.IGNORECASE)
+ header = response.http_response.headers.get('content-disposition')
+
+ if header and pattern.match(header):
+ filename = header.partition('=')[2]
+ _LOGGER.debug("File attachments: %s", filename)
+ elif response.http_response.headers.get("content-type", "").endswith("octet-stream"):
+ _LOGGER.debug("Body contains binary data.")
+ elif response.http_response.headers.get("content-type", "").startswith("image"):
+ _LOGGER.debug("Body contains image data.")
+ else:
+ if response.context.options.get('stream', False):
+ _LOGGER.debug("Body is streamable")
+ else:
+ _LOGGER.debug(response.http_response.text())
+ except Exception as err: # pylint: disable=broad-except
+ _LOGGER.debug("Failed to log response: %s", repr(err))
+
+
+class StorageRequestHook(SansIOHTTPPolicy):
+
+ def __init__(self, **kwargs): # pylint: disable=unused-argument
+ self._request_callback = kwargs.get('raw_request_hook')
+ super(StorageRequestHook, self).__init__()
+
+ def on_request(self, request):
+ # type: (PipelineRequest, **Any) -> PipelineResponse
+ request_callback = request.context.options.pop('raw_request_hook', self._request_callback)
+ if request_callback:
+ request_callback(request)
+
+
+class StorageResponseHook(HTTPPolicy):
+
+ def __init__(self, **kwargs): # pylint: disable=unused-argument
+ self._response_callback = kwargs.get('raw_response_hook')
+ super(StorageResponseHook, self).__init__()
+
+ def send(self, request):
+ # type: (PipelineRequest) -> PipelineResponse
+ data_stream_total = request.context.get('data_stream_total') or \
+ request.context.options.pop('data_stream_total', None)
+ download_stream_current = request.context.get('download_stream_current') or \
+ request.context.options.pop('download_stream_current', None)
+ upload_stream_current = request.context.get('upload_stream_current') or \
+ request.context.options.pop('upload_stream_current', None)
+ response_callback = request.context.get('response_callback') or \
+ request.context.options.pop('raw_response_hook', self._response_callback)
+
+ response = self.next.send(request)
+ will_retry = is_retry(response, request.context.options.get('mode'))
+ if not will_retry and download_stream_current is not None:
+ download_stream_current += int(response.http_response.headers.get('Content-Length', 0))
+ if data_stream_total is None:
+ content_range = response.http_response.headers.get('Content-Range')
+ if content_range:
+ data_stream_total = int(content_range.split(' ', 1)[1].split('/', 1)[1])
+ else:
+ data_stream_total = download_stream_current
+ elif not will_retry and upload_stream_current is not None:
+ upload_stream_current += int(response.http_request.headers.get('Content-Length', 0))
+ for pipeline_obj in [request, response]:
+ pipeline_obj.context['data_stream_total'] = data_stream_total
+ pipeline_obj.context['download_stream_current'] = download_stream_current
+ pipeline_obj.context['upload_stream_current'] = upload_stream_current
+ if response_callback:
+ response_callback(response)
+ request.context['response_callback'] = response_callback
+ return response
+
+
+class StorageContentValidation(SansIOHTTPPolicy):
+ """A simple policy that sends the given headers
+ with the request.
+
+ This will overwrite any headers already defined in the request.
+ """
+ header_name = 'Content-MD5'
+
+ def __init__(self, **kwargs): # pylint: disable=unused-argument
+ super(StorageContentValidation, self).__init__()
+
+ @staticmethod
+ def get_content_md5(data):
+ md5 = hashlib.md5() # nosec
+ if isinstance(data, bytes):
+ md5.update(data)
+ elif hasattr(data, 'read'):
+ pos = 0
+ try:
+ pos = data.tell()
+ except: # pylint: disable=bare-except
+ pass
+ for chunk in iter(lambda: data.read(4096), b""):
+ md5.update(chunk)
+ try:
+ data.seek(pos, SEEK_SET)
+ except (AttributeError, IOError):
+ raise ValueError("Data should be bytes or a seekable file-like object.")
+ else:
+ raise ValueError("Data should be bytes or a seekable file-like object.")
+
+ return md5.digest()
+
+ def on_request(self, request):
+ # type: (PipelineRequest, Any) -> None
+ validate_content = request.context.options.pop('validate_content', False)
+ if validate_content and request.http_request.method != 'GET':
+ computed_md5 = encode_base64(StorageContentValidation.get_content_md5(request.http_request.data))
+ request.http_request.headers[self.header_name] = computed_md5
+ request.context['validate_content_md5'] = computed_md5
+ request.context['validate_content'] = validate_content
+
+ def on_response(self, request, response):
+ if response.context.get('validate_content', False) and response.http_response.headers.get('content-md5'):
+ computed_md5 = request.context.get('validate_content_md5') or \
+ encode_base64(StorageContentValidation.get_content_md5(response.http_response.body()))
+ if response.http_response.headers['content-md5'] != computed_md5:
+ raise AzureError(
+ 'MD5 mismatch. Expected value is \'{0}\', computed value is \'{1}\'.'.format(
+ response.http_response.headers['content-md5'], computed_md5),
+ response=response.http_response
+ )
+
+
+class StorageRetryPolicy(HTTPPolicy):
+ """
+ The base class for Exponential and Linear retries containing shared code.
+ """
+
+ def __init__(self, **kwargs):
+ self.total_retries = kwargs.pop('retry_total', 10)
+ self.connect_retries = kwargs.pop('retry_connect', 3)
+ self.read_retries = kwargs.pop('retry_read', 3)
+ self.status_retries = kwargs.pop('retry_status', 3)
+ self.retry_to_secondary = kwargs.pop('retry_to_secondary', False)
+ super(StorageRetryPolicy, self).__init__()
+
+ def _set_next_host_location(self, settings, request): # pylint: disable=no-self-use
+ """
+ A function which sets the next host location on the request, if applicable.
+
+ :param ~azure.storage.models.RetryContext context:
+ The retry context containing the previous host location and the request
+ to evaluate and possibly modify.
+ """
+ if settings['hosts'] and all(settings['hosts'].values()):
+ url = urlparse(request.url)
+ # If there's more than one possible location, retry to the alternative
+ if settings['mode'] == LocationMode.PRIMARY:
+ settings['mode'] = LocationMode.SECONDARY
+ else:
+ settings['mode'] = LocationMode.PRIMARY
+ updated = url._replace(netloc=settings['hosts'].get(settings['mode']))
+ request.url = updated.geturl()
+
+ def configure_retries(self, request): # pylint: disable=no-self-use
+ # type: (...)-> dict
+ """
+ :param Any request:
+ :param kwargs:
+ :return:
+ :rtype:dict
+ """
+ body_position = None
+ if hasattr(request.http_request.body, 'read'):
+ try:
+ body_position = request.http_request.body.tell()
+ except (AttributeError, UnsupportedOperation):
+ # if body position cannot be obtained, then retries will not work
+ pass
+ options = request.context.options
+ return {
+ 'total': options.pop("retry_total", self.total_retries),
+ 'connect': options.pop("retry_connect", self.connect_retries),
+ 'read': options.pop("retry_read", self.read_retries),
+ 'status': options.pop("retry_status", self.status_retries),
+ 'retry_secondary': options.pop("retry_to_secondary", self.retry_to_secondary),
+ 'mode': options.pop("location_mode", LocationMode.PRIMARY),
+ 'hosts': options.pop("hosts", None),
+ 'hook': options.pop("retry_hook", None),
+ 'body_position': body_position,
+ 'count': 0,
+ 'history': []
+ }
+
+ def get_backoff_time(self, settings, **kwargs): # pylint: disable=unused-argument,no-self-use
+ """ Formula for computing the current backoff.
+ Should be calculated by child class.
+ :param Any settings:
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :rtype: float
+ """
+ return 0
+
+ def sleep(self, settings, transport):
+ # type: (...)->None
+ """
+ :param Any settings:
+ :param Any transport:
+ :return:None
+ """
+ backoff = self.get_backoff_time(settings, )
+ if not backoff or backoff < 0:
+ return
+ transport.sleep(backoff)
+
+ def increment(self, settings, request, response=None, error=None, **kwargs): # pylint:disable=W0613
+ # type: (...)->None
+ """Increment the retry counters.
+
+ :param Any request:
+ :param dict settings:
+ :param Any response: A pipeline response object.
+ :param Any error: An error encountered during the request, or
+ None if the response was received successfully.
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Whether the retry attempts are exhausted.
+ :rtype: None
+ """
+ settings['total'] -= 1
+
+ if error and isinstance(error, ServiceRequestError):
+ # Errors when we're fairly sure that the server did not receive the
+ # request, so it should be safe to retry.
+ settings['connect'] -= 1
+ settings['history'].append(RequestHistory(request, error=error))
+
+ elif error and isinstance(error, ServiceResponseError):
+ # Errors that occur after the request has been started, so we should
+ # assume that the server began processing it.
+ settings['read'] -= 1
+ settings['history'].append(RequestHistory(request, error=error))
+
+ else:
+ # Incrementing because of a server error like a 500 in
+ # status_forcelist and a the given method is in the whitelist
+ if response:
+ settings['status'] -= 1
+ settings['history'].append(RequestHistory(request, http_response=response))
+
+ if not is_exhausted(settings):
+ if request.method not in ['PUT'] and settings['retry_secondary']:
+ self._set_next_host_location(settings, request)
+
+ # rewind the request body if it is a stream
+ if request.body and hasattr(request.body, 'read'):
+ # no position was saved, then retry would not work
+ if settings['body_position'] is None:
+ return False
+ try:
+ # attempt to rewind the body to the initial position
+ request.body.seek(settings['body_position'], SEEK_SET)
+ except (UnsupportedOperation, ValueError):
+ # if body is not seekable, then retry would not work
+ return False
+ settings['count'] += 1
+ return True
+ return False
+
+ def send(self, request):
+ """
+ :param Any request:
+ :return: None
+ """
+ retries_remaining = True
+ response = None
+ retry_settings = self.configure_retries(request)
+ while retries_remaining:
+ try:
+ response = self.next.send(request)
+ if is_retry(response, retry_settings['mode']):
+ retries_remaining = self.increment(
+ retry_settings,
+ request=request.http_request,
+ response=response.http_response)
+ if retries_remaining:
+ retry_hook(
+ retry_settings,
+ request=request.http_request,
+ response=response.http_response,
+ error=None)
+ self.sleep(retry_settings, request.context.transport)
+ continue
+ break
+ except AzureError as err:
+ retries_remaining = self.increment(
+ retry_settings, request=request.http_request, error=err)
+ if retries_remaining:
+ retry_hook(
+ retry_settings,
+ request=request.http_request,
+ response=None,
+ error=err)
+ self.sleep(retry_settings, request.context.transport)
+ continue
+ raise err
+ if retry_settings['history']:
+ response.context['history'] = retry_settings['history']
+ response.http_response.location_mode = retry_settings['mode']
+ return response
+
+
+class ExponentialRetry(StorageRetryPolicy):
+ """Exponential retry."""
+
+ def __init__(self, initial_backoff=15, increment_base=3, retry_total=3,
+ retry_to_secondary=False, random_jitter_range=3, **kwargs):
+ """
+ Constructs an Exponential retry object. The initial_backoff is used for
+ the first retry. Subsequent retries are retried after initial_backoff +
+ increment_power^retry_count seconds. For example, by default the first retry
+ occurs after 15 seconds, the second after (15+3^1) = 18 seconds, and the
+ third after (15+3^2) = 24 seconds.
+
+ :param int initial_backoff:
+ The initial backoff interval, in seconds, for the first retry.
+ :param int increment_base:
+ The base, in seconds, to increment the initial_backoff by after the
+ first retry.
+ :param int max_attempts:
+ The maximum number of retry attempts.
+ :param int retry_total: total number of retries
+ :param bool retry_to_secondary:
+ Whether the request should be retried to secondary, if able. This should
+ only be enabled of RA-GRS accounts are used and potentially stale data
+ can be handled.
+ :param int random_jitter_range:
+ A number in seconds which indicates a range to jitter/randomize for the back-off interval.
+ For example, a random_jitter_range of 3 results in the back-off interval x to vary between x+3 and x-3.
+ """
+ self.initial_backoff = initial_backoff
+ self.increment_base = increment_base
+ self.random_jitter_range = random_jitter_range
+ super(ExponentialRetry, self).__init__(
+ retry_total=retry_total, retry_to_secondary=retry_to_secondary, **kwargs)
+
+ def get_backoff_time(self, settings, **kwargs):
+ """
+ Calculates how long to sleep before retrying.
+ :param **kwargs:
+ :param dict settings:
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return:
+ An integer indicating how long to wait before retrying the request,
+ or None to indicate no retry should be performed.
+ :rtype: int or None
+ """
+ random_generator = random.Random()
+ backoff = self.initial_backoff + (0 if settings['count'] == 0 else pow(self.increment_base, settings['count']))
+ random_range_start = backoff - self.random_jitter_range if backoff > self.random_jitter_range else 0
+ random_range_end = backoff + self.random_jitter_range
+ return random_generator.uniform(random_range_start, random_range_end)
+
+
+class LinearRetry(StorageRetryPolicy):
+ """Linear retry."""
+
+ def __init__(self, backoff=15, retry_total=3, retry_to_secondary=False, random_jitter_range=3, **kwargs):
+ """
+ Constructs a Linear retry object.
+
+ :param int backoff:
+ The backoff interval, in seconds, between retries.
+ :param int max_attempts:
+ The maximum number of retry attempts.
+ :param bool retry_to_secondary:
+ Whether the request should be retried to secondary, if able. This should
+ only be enabled of RA-GRS accounts are used and potentially stale data
+ can be handled.
+ :param int retry_total: total number of retries
+ :param int random_jitter_range:
+ A number in seconds which indicates a range to jitter/randomize for the back-off interval.
+ For example, a random_jitter_range of 3 results in the back-off interval x to vary between x+3 and x-3.
+ """
+ self.backoff = backoff
+ self.random_jitter_range = random_jitter_range
+ super(LinearRetry, self).__init__(
+ retry_total=retry_total, retry_to_secondary=retry_to_secondary, **kwargs)
+
+ def get_backoff_time(self, settings, **kwargs):
+ """
+ Calculates how long to sleep before retrying.
+
+ :param dict settings:
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return:
+ An integer indicating how long to wait before retrying the request,
+ or None to indicate no retry should be performed.
+ :rtype: int or None
+ """
+ random_generator = random.Random()
+ # the backoff interval normally does not change, however there is the possibility
+ # that it was modified by accessing the property directly after initializing the object
+ random_range_start = self.backoff - self.random_jitter_range \
+ if self.backoff > self.random_jitter_range else 0
+ random_range_end = self.backoff + self.random_jitter_range
+ return random_generator.uniform(random_range_start, random_range_end)
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/policies_async.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/policies_async.py
new file mode 100644
index 000000000000..f627df43f9e4
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/policies_async.py
@@ -0,0 +1,221 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import asyncio
+import random
+import logging
+from typing import Any, TYPE_CHECKING
+
+from azure.core.pipeline.policies import AsyncHTTPPolicy
+from azure.core.exceptions import AzureError
+
+from .policies import is_retry, StorageRetryPolicy
+
+if TYPE_CHECKING:
+ from azure.core.pipeline import PipelineRequest, PipelineResponse
+
+
+_LOGGER = logging.getLogger(__name__)
+
+
+async def retry_hook(settings, **kwargs):
+ if settings['hook']:
+ if asyncio.iscoroutine(settings['hook']):
+ await settings['hook'](
+ retry_count=settings['count'] - 1,
+ location_mode=settings['mode'],
+ **kwargs)
+ else:
+ settings['hook'](
+ retry_count=settings['count'] - 1,
+ location_mode=settings['mode'],
+ **kwargs)
+
+
+class AsyncStorageResponseHook(AsyncHTTPPolicy):
+
+ def __init__(self, **kwargs): # pylint: disable=unused-argument
+ self._response_callback = kwargs.get('raw_response_hook')
+ super(AsyncStorageResponseHook, self).__init__()
+
+ async def send(self, request):
+ # type: (PipelineRequest) -> PipelineResponse
+ data_stream_total = request.context.get('data_stream_total') or \
+ request.context.options.pop('data_stream_total', None)
+ download_stream_current = request.context.get('download_stream_current') or \
+ request.context.options.pop('download_stream_current', None)
+ upload_stream_current = request.context.get('upload_stream_current') or \
+ request.context.options.pop('upload_stream_current', None)
+ response_callback = request.context.get('response_callback') or \
+ request.context.options.pop('raw_response_hook', self._response_callback)
+
+ response = await self.next.send(request)
+ await response.http_response.load_body()
+
+ will_retry = is_retry(response, request.context.options.get('mode'))
+ if not will_retry and download_stream_current is not None:
+ download_stream_current += int(response.http_response.headers.get('Content-Length', 0))
+ if data_stream_total is None:
+ content_range = response.http_response.headers.get('Content-Range')
+ if content_range:
+ data_stream_total = int(content_range.split(' ', 1)[1].split('/', 1)[1])
+ else:
+ data_stream_total = download_stream_current
+ elif not will_retry and upload_stream_current is not None:
+ upload_stream_current += int(response.http_request.headers.get('Content-Length', 0))
+ for pipeline_obj in [request, response]:
+ pipeline_obj.context['data_stream_total'] = data_stream_total
+ pipeline_obj.context['download_stream_current'] = download_stream_current
+ pipeline_obj.context['upload_stream_current'] = upload_stream_current
+ if response_callback:
+ if asyncio.iscoroutine(response_callback):
+ await response_callback(response)
+ else:
+ response_callback(response)
+ request.context['response_callback'] = response_callback
+ return response
+
+class AsyncStorageRetryPolicy(StorageRetryPolicy):
+ """
+ The base class for Exponential and Linear retries containing shared code.
+ """
+
+ async def sleep(self, settings, transport): # pylint: disable =W0236
+ backoff = self.get_backoff_time(settings)
+ if not backoff or backoff < 0:
+ return
+ await transport.sleep(backoff)
+
+ async def send(self, request): # pylint: disable =W0236
+ retries_remaining = True
+ response = None
+ retry_settings = self.configure_retries(request)
+ while retries_remaining:
+ try:
+ response = await self.next.send(request)
+ if is_retry(response, retry_settings['mode']):
+ retries_remaining = self.increment(
+ retry_settings,
+ request=request.http_request,
+ response=response.http_response)
+ if retries_remaining:
+ await retry_hook(
+ retry_settings,
+ request=request.http_request,
+ response=response.http_response,
+ error=None)
+ await self.sleep(retry_settings, request.context.transport)
+ continue
+ break
+ except AzureError as err:
+ retries_remaining = self.increment(
+ retry_settings, request=request.http_request, error=err)
+ if retries_remaining:
+ await retry_hook(
+ retry_settings,
+ request=request.http_request,
+ response=None,
+ error=err)
+ await self.sleep(retry_settings, request.context.transport)
+ continue
+ raise err
+ if retry_settings['history']:
+ response.context['history'] = retry_settings['history']
+ response.http_response.location_mode = retry_settings['mode']
+ return response
+
+
+class ExponentialRetry(AsyncStorageRetryPolicy):
+ """Exponential retry."""
+
+ def __init__(self, initial_backoff=15, increment_base=3, retry_total=3,
+ retry_to_secondary=False, random_jitter_range=3, **kwargs):
+ '''
+ Constructs an Exponential retry object. The initial_backoff is used for
+ the first retry. Subsequent retries are retried after initial_backoff +
+ increment_power^retry_count seconds. For example, by default the first retry
+ occurs after 15 seconds, the second after (15+3^1) = 18 seconds, and the
+ third after (15+3^2) = 24 seconds.
+
+ :param int initial_backoff:
+ The initial backoff interval, in seconds, for the first retry.
+ :param int increment_base:
+ The base, in seconds, to increment the initial_backoff by after the
+ first retry.
+ :param int max_attempts:
+ The maximum number of retry attempts.
+ :param bool retry_to_secondary:
+ Whether the request should be retried to secondary, if able. This should
+ only be enabled of RA-GRS accounts are used and potentially stale data
+ can be handled.
+ :param int random_jitter_range:
+ A number in seconds which indicates a range to jitter/randomize for the back-off interval.
+ For example, a random_jitter_range of 3 results in the back-off interval x to vary between x+3 and x-3.
+ '''
+ self.initial_backoff = initial_backoff
+ self.increment_base = increment_base
+ self.random_jitter_range = random_jitter_range
+ super(ExponentialRetry, self).__init__(
+ retry_total=retry_total, retry_to_secondary=retry_to_secondary, **kwargs)
+
+ def get_backoff_time(self, settings, **kwargs):
+ """
+ Calculates how long to sleep before retrying.
+
+ :param **kwargs:
+ :return:
+ An integer indicating how long to wait before retrying the request,
+ or None to indicate no retry should be performed.
+ :rtype: int or None
+ """
+ random_generator = random.Random()
+ backoff = self.initial_backoff + (0 if settings['count'] == 0 else pow(self.increment_base, settings['count']))
+ random_range_start = backoff - self.random_jitter_range if backoff > self.random_jitter_range else 0
+ random_range_end = backoff + self.random_jitter_range
+ return random_generator.uniform(random_range_start, random_range_end)
+
+
+class LinearRetry(AsyncStorageRetryPolicy):
+ """Linear retry."""
+
+ def __init__(self, backoff=15, retry_total=3, retry_to_secondary=False, random_jitter_range=3, **kwargs):
+ """
+ Constructs a Linear retry object.
+
+ :param int backoff:
+ The backoff interval, in seconds, between retries.
+ :param int max_attempts:
+ The maximum number of retry attempts.
+ :param bool retry_to_secondary:
+ Whether the request should be retried to secondary, if able. This should
+ only be enabled of RA-GRS accounts are used and potentially stale data
+ can be handled.
+ :param int random_jitter_range:
+ A number in seconds which indicates a range to jitter/randomize for the back-off interval.
+ For example, a random_jitter_range of 3 results in the back-off interval x to vary between x+3 and x-3.
+ """
+ self.backoff = backoff
+ self.random_jitter_range = random_jitter_range
+ super(LinearRetry, self).__init__(
+ retry_total=retry_total, retry_to_secondary=retry_to_secondary, **kwargs)
+
+ def get_backoff_time(self, settings, **kwargs):
+ """
+ Calculates how long to sleep before retrying.
+
+ :param **kwargs:
+ :return:
+ An integer indicating how long to wait before retrying the request,
+ or None to indicate no retry should be performed.
+ :rtype: int or None
+ """
+ random_generator = random.Random()
+ # the backoff interval normally does not change, however there is the possibility
+ # that it was modified by accessing the property directly after initializing the object
+ random_range_start = self.backoff - self.random_jitter_range \
+ if self.backoff > self.random_jitter_range else 0
+ random_range_end = self.backoff + self.random_jitter_range
+ return random_generator.uniform(random_range_start, random_range_end)
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/request_handlers.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/request_handlers.py
new file mode 100644
index 000000000000..2ce74d43db21
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/request_handlers.py
@@ -0,0 +1,147 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+from typing import ( # pylint: disable=unused-import
+ Union, Optional, Any, Iterable, Dict, List, Type, Tuple,
+ TYPE_CHECKING
+)
+
+import logging
+from os import fstat
+from io import (SEEK_END, SEEK_SET, UnsupportedOperation)
+
+import isodate
+
+from azure.core.exceptions import raise_with_traceback
+
+
+_LOGGER = logging.getLogger(__name__)
+
+
+def serialize_iso(attr):
+ """Serialize Datetime object into ISO-8601 formatted string.
+
+ :param Datetime attr: Object to be serialized.
+ :rtype: str
+ :raises: ValueError if format invalid.
+ """
+ if not attr:
+ return None
+ if isinstance(attr, str):
+ attr = isodate.parse_datetime(attr)
+ try:
+ utc = attr.utctimetuple()
+ if utc.tm_year > 9999 or utc.tm_year < 1:
+ raise OverflowError("Hit max or min date")
+
+ date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format(
+ utc.tm_year, utc.tm_mon, utc.tm_mday,
+ utc.tm_hour, utc.tm_min, utc.tm_sec)
+ return date + 'Z'
+ except (ValueError, OverflowError) as err:
+ msg = "Unable to serialize datetime object."
+ raise_with_traceback(ValueError, msg, err)
+ except AttributeError as err:
+ msg = "ISO-8601 object must be valid Datetime object."
+ raise_with_traceback(TypeError, msg, err)
+
+
+def get_length(data):
+ length = None
+ # Check if object implements the __len__ method, covers most input cases such as bytearray.
+ try:
+ length = len(data)
+ except: # pylint: disable=bare-except
+ pass
+
+ if not length:
+ # Check if the stream is a file-like stream object.
+ # If so, calculate the size using the file descriptor.
+ try:
+ fileno = data.fileno()
+ except (AttributeError, UnsupportedOperation):
+ pass
+ else:
+ try:
+ return fstat(fileno).st_size
+ except OSError:
+ # Not a valid fileno, may be possible requests returned
+ # a socket number?
+ pass
+
+ # If the stream is seekable and tell() is implemented, calculate the stream size.
+ try:
+ current_position = data.tell()
+ data.seek(0, SEEK_END)
+ length = data.tell() - current_position
+ data.seek(current_position, SEEK_SET)
+ except (AttributeError, UnsupportedOperation):
+ pass
+
+ return length
+
+
+def read_length(data):
+ try:
+ if hasattr(data, 'read'):
+ read_data = b''
+ for chunk in iter(lambda: data.read(4096), b""):
+ read_data += chunk
+ return len(read_data), read_data
+ if hasattr(data, '__iter__'):
+ read_data = b''
+ for chunk in data:
+ read_data += chunk
+ return len(read_data), read_data
+ except: # pylint: disable=bare-except
+ pass
+ raise ValueError("Unable to calculate content length, please specify.")
+
+
+def validate_and_format_range_headers(
+ start_range, end_range, start_range_required=True,
+ end_range_required=True, check_content_md5=False, align_to_page=False):
+ # If end range is provided, start range must be provided
+ if (start_range_required or end_range is not None) and start_range is None:
+ raise ValueError("start_range value cannot be None.")
+ if end_range_required and end_range is None:
+ raise ValueError("end_range value cannot be None.")
+
+ # Page ranges must be 512 aligned
+ if align_to_page:
+ if start_range is not None and start_range % 512 != 0:
+ raise ValueError("Invalid page blob start_range: {0}. "
+ "The size must be aligned to a 512-byte boundary.".format(start_range))
+ if end_range is not None and end_range % 512 != 511:
+ raise ValueError("Invalid page blob end_range: {0}. "
+ "The size must be aligned to a 512-byte boundary.".format(end_range))
+
+ # Format based on whether end_range is present
+ range_header = None
+ if end_range is not None:
+ range_header = 'bytes={0}-{1}'.format(start_range, end_range)
+ elif start_range is not None:
+ range_header = "bytes={0}-".format(start_range)
+
+ # Content MD5 can only be provided for a complete range less than 4MB in size
+ range_validation = None
+ if check_content_md5:
+ if start_range is None or end_range is None:
+ raise ValueError("Both start and end range requied for MD5 content validation.")
+ if end_range - start_range > 4 * 1024 * 1024:
+ raise ValueError("Getting content MD5 for a range greater than 4MB is not supported.")
+ range_validation = 'true'
+
+ return range_header, range_validation
+
+
+def add_metadata_headers(metadata=None):
+ # type: (Optional[Dict[str, str]]) -> Dict[str, str]
+ headers = {}
+ if metadata:
+ for key, value in metadata.items():
+ headers['x-ms-meta-{}'.format(key)] = value
+ return headers
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/response_handlers.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/response_handlers.py
new file mode 100644
index 000000000000..2c542ac3c7a7
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/response_handlers.py
@@ -0,0 +1,159 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+from typing import ( # pylint: disable=unused-import
+ Union, Optional, Any, Iterable, Dict, List, Type, Tuple,
+ TYPE_CHECKING
+)
+import logging
+
+from azure.core.pipeline.policies import ContentDecodePolicy
+from azure.core.exceptions import (
+ HttpResponseError,
+ ResourceNotFoundError,
+ ResourceModifiedError,
+ ResourceExistsError,
+ ClientAuthenticationError,
+ DecodeError)
+
+from .parser import _to_utc_datetime
+from .models import TableErrorCode, UserDelegationKey, get_enum_value
+
+
+if TYPE_CHECKING:
+ from datetime import datetime
+ from azure.core.exceptions import AzureError
+
+
+_LOGGER = logging.getLogger(__name__)
+
+
+class PartialBatchErrorException(HttpResponseError):
+ """There is a partial failure in batch operations.
+
+ :param str message: The message of the exception.
+ :param response: Server response to be deserialized.
+ :param list parts: A list of the parts in multipart response.
+ """
+
+ def __init__(self, message, response, parts):
+ self.parts = parts
+ super(PartialBatchErrorException, self).__init__(message=message, response=response)
+
+
+def parse_length_from_content_range(content_range):
+ '''
+ Parses the blob length from the content range header: bytes 1-3/65537
+ '''
+ if content_range is None:
+ return None
+
+ # First, split in space and take the second half: '1-3/65537'
+ # Next, split on slash and take the second half: '65537'
+ # Finally, convert to an int: 65537
+ return int(content_range.split(' ', 1)[1].split('/', 1)[1])
+
+
+def normalize_headers(headers):
+ normalized = {}
+ for key, value in headers.items():
+ if key.startswith('x-ms-'):
+ key = key[5:]
+ normalized[key.lower().replace('-', '_')] = get_enum_value(value)
+ return normalized
+
+
+def deserialize_metadata(response, obj, headers): # pylint: disable=unused-argument
+ raw_metadata = {k: v for k, v in response.headers.items() if k.startswith("x-ms-meta-")}
+ return {k[10:]: v for k, v in raw_metadata.items()}
+
+
+def return_response_headers(response, deserialized, response_headers): # pylint: disable=unused-argument
+ return normalize_headers(response_headers)
+
+
+def return_headers_and_deserialized(response, deserialized, response_headers): # pylint: disable=unused-argument
+ return normalize_headers(response_headers), deserialized
+
+
+def return_context_and_deserialized(response, deserialized, response_headers): # pylint: disable=unused-argument
+ return response.http_response.location_mode, deserialized, response_headers
+
+
+def process_table_error(storage_error):
+ raise_error = HttpResponseError
+ error_code = storage_error.response.headers.get('x-ms-error-code')
+ error_message = storage_error.message
+ additional_data = {}
+ try:
+ error_body = ContentDecodePolicy.deserialize_from_http_generics(storage_error.response)
+ if isinstance(error_body, dict):
+ for info in error_body['odata.error']:
+ if info == 'code':
+ error_code = error_body['odata.error'][info]
+ elif info == 'message':
+ error_message = error_body['odata.error'][info]['value']
+ else:
+ additional_data[info.tag] = info.text
+ else:
+ if error_body:
+ for info in error_body.iter():
+ if info.tag.lower().find('code') != -1:
+ error_code = info.text
+ elif info.tag.lower().find('message') != -1:
+ error_message = info.text
+ else:
+ additional_data[info.tag] = info.text
+ except DecodeError:
+ pass
+
+ try:
+ if error_code:
+ error_code = TableErrorCode(error_code)
+ if error_code in [TableErrorCode.condition_not_met]:
+ raise_error = ResourceModifiedError
+ if error_code in [TableErrorCode.invalid_authentication_info,
+ TableErrorCode.authentication_failed]:
+ raise_error = ClientAuthenticationError
+ if error_code in [TableErrorCode.resource_not_found,
+ TableErrorCode.table_not_found,
+ TableErrorCode.entity_not_found,
+ ResourceNotFoundError]:
+ raise_error = ResourceNotFoundError
+ if error_code in [TableErrorCode.resource_already_exists,
+ TableErrorCode.table_already_exists,
+ TableErrorCode.account_already_exists,
+ TableErrorCode.entity_already_exists,
+ ResourceExistsError]:
+ raise_error = ResourceExistsError
+ except ValueError:
+ # Got an unknown error code
+ pass
+
+ try:
+
+ error_message += "\nErrorCode:{}".format(error_code.value)
+ except AttributeError:
+ error_message += "\nErrorCode:{}".format(error_code)
+ for name, info in additional_data.items():
+ error_message += "\n{}:{}".format(name, info)
+
+ error = raise_error(message=error_message, response=storage_error.response)
+ error.error_code = error_code
+ error.additional_info = additional_data
+ raise error
+
+
+def parse_to_internal_user_delegation_key(service_user_delegation_key):
+ internal_user_delegation_key = UserDelegationKey()
+ internal_user_delegation_key.signed_oid = service_user_delegation_key.signed_oid
+ internal_user_delegation_key.signed_tid = service_user_delegation_key.signed_tid
+ internal_user_delegation_key.signed_start = _to_utc_datetime(service_user_delegation_key.signed_start)
+ internal_user_delegation_key.signed_expiry = _to_utc_datetime(service_user_delegation_key.signed_expiry)
+ internal_user_delegation_key.signed_service = service_user_delegation_key.signed_service
+ internal_user_delegation_key.signed_version = service_user_delegation_key.signed_version
+ internal_user_delegation_key.value = service_user_delegation_key.value
+ return internal_user_delegation_key
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/shared_access_signature.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/shared_access_signature.py
new file mode 100644
index 000000000000..9ce7a0cf9f1a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/shared_access_signature.py
@@ -0,0 +1,243 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from datetime import date
+
+from azure.data.tables._shared import url_quote
+
+
+from ._common_conversion import (
+ _sign_string,
+ _to_str, _to_utc_datetime,
+)
+from ._constants import DEFAULT_X_MS_VERSION
+
+
+class SharedAccessSignature(object):
+ """
+ Provides a factory for creating account access
+ signature tokens with an account name and account key. Users can either
+ use the factory or can construct the appropriate service and use the
+ generate_*_shared_access_signature method directly.
+ """
+
+ def __init__(self, account_name, account_key, x_ms_version=DEFAULT_X_MS_VERSION):
+ """
+ :param str account_name:
+ The storage account name used to generate the shared access signatures.
+ :param str account_key:
+ The access key to generate the shares access signatures.
+ :param str x_ms_version:
+ The service version used to generate the shared access signatures.
+ """
+ self.account_name = account_name
+ self.account_key = account_key
+ self.x_ms_version = x_ms_version
+
+ def generate_account(self, services, resource_types, permission, expiry, start=None,
+ ip_address_or_range=None, protocol=None):
+ '''
+ Generates a shared access signature for the account.
+ Use the returned signature with the sas_token parameter of the service
+ or to create a new account object.
+
+ :param Services services:
+ Specifies the services accessible with the account SAS. You can
+ combine values to provide access to more than one service.
+ :param ResourceTypes resource_types:
+ Specifies the resource types that are accessible with the account
+ SAS. You can combine values to provide access to more than one
+ resource type.
+ :param AccountPermissions permission:
+ The permissions associated with the shared access signature. The
+ user is restricted to operations allowed by the permissions.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has been
+ specified in an associated stored access policy. You can combine
+ values to provide more than one permission.
+ :param expiry:
+ The time at which the shared access signature becomes invalid.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has
+ been specified in an associated stored access policy. Azure will always
+ convert values to UTC. If a date is passed in without timezone info, it
+ is assumed to be UTC.
+ :type expiry: datetime or str
+ :param start:
+ The time at which the shared access signature becomes valid. If
+ omitted, start time for this call is assumed to be the time when the
+ storage service receives the request. Azure will always convert values
+ to UTC. If a date is passed in without timezone info, it is assumed to
+ be UTC.
+ :type start: datetime or str
+ :param str ip_address_or_range:
+ Specifies an IP address or a range of IP addresses from which to accept requests.
+ If the IP address from which the request originates does not match the IP address
+ or address range specified on the SAS token, the request is not authenticated.
+ For example, specifying sip=168.1.5.65 or sip=168.1.5.60-168.1.5.70 on the SAS
+ restricts the request to those IP addresses.
+ :param Union[str, SASProtocol] protocol:
+ Specifies the protocol permitted for a request made. The default value
+ is https,http. See :class:`~azure.cosmosdb.table.common.models.Protocol` for possible values.
+ '''
+ sas = _SharedAccessHelper()
+ sas.add_base(permission, expiry, start, ip_address_or_range, protocol, self.x_ms_version)
+ sas.add_account(services, resource_types)
+ sas.add_account_signature(self.account_name, self.account_key)
+
+ return sas.get_token()
+
+
+class QueryStringConstants(object):
+ SIGNED_SIGNATURE = 'sig'
+ SIGNED_PERMISSION = 'sp'
+ SIGNED_START = 'st'
+ SIGNED_EXPIRY = 'se'
+ SIGNED_RESOURCE = 'sr'
+ SIGNED_IDENTIFIER = 'si'
+ SIGNED_IP = 'sip'
+ SIGNED_PROTOCOL = 'spr'
+ SIGNED_VERSION = 'sv'
+ SIGNED_CACHE_CONTROL = 'rscc'
+ SIGNED_CONTENT_DISPOSITION = 'rscd'
+ SIGNED_CONTENT_ENCODING = 'rsce'
+ SIGNED_CONTENT_LANGUAGE = 'rscl'
+ SIGNED_CONTENT_TYPE = 'rsct'
+ START_PK = 'spk'
+ START_RK = 'srk'
+ END_PK = 'epk'
+ END_RK = 'erk'
+ SIGNED_RESOURCE_TYPES = 'srt'
+ SIGNED_SERVICES = 'ss'
+ TABLE_NAME = 'tn'
+
+ @staticmethod
+ def to_list():
+ return [
+ QueryStringConstants.SIGNED_SIGNATURE,
+ QueryStringConstants.SIGNED_PERMISSION,
+ QueryStringConstants.SIGNED_START,
+ QueryStringConstants.SIGNED_EXPIRY,
+ QueryStringConstants.SIGNED_RESOURCE,
+ QueryStringConstants.SIGNED_IDENTIFIER,
+ QueryStringConstants.SIGNED_IP,
+ QueryStringConstants.SIGNED_PROTOCOL,
+ QueryStringConstants.SIGNED_VERSION,
+ QueryStringConstants.SIGNED_CACHE_CONTROL,
+ QueryStringConstants.SIGNED_CONTENT_DISPOSITION,
+ QueryStringConstants.SIGNED_CONTENT_ENCODING,
+ QueryStringConstants.SIGNED_CONTENT_LANGUAGE,
+ QueryStringConstants.SIGNED_CONTENT_TYPE,
+ QueryStringConstants.START_PK,
+ QueryStringConstants.START_RK,
+ QueryStringConstants.END_PK,
+ QueryStringConstants.END_RK,
+ QueryStringConstants.SIGNED_RESOURCE_TYPES,
+ QueryStringConstants.SIGNED_SERVICES,
+ QueryStringConstants.TABLE_NAME
+ ]
+
+
+class _SharedAccessHelper(object):
+ def __init__(self):
+ self.query_dict = {}
+
+ def _add_query(self, name, val):
+ if val:
+ self.query_dict[name] = _to_str(val)
+
+ def add_base(self, permission, expiry, start, ip, protocol, x_ms_version):
+ if isinstance(start, date):
+ start = _to_utc_datetime(start)
+
+ if isinstance(expiry, date):
+ expiry = _to_utc_datetime(expiry)
+
+ self._add_query(QueryStringConstants.SIGNED_START, start)
+ self._add_query(QueryStringConstants.SIGNED_EXPIRY, expiry)
+ self._add_query(QueryStringConstants.SIGNED_PERMISSION, permission)
+ self._add_query(QueryStringConstants.SIGNED_IP, ip)
+ self._add_query(QueryStringConstants.SIGNED_PROTOCOL, protocol)
+ self._add_query(QueryStringConstants.SIGNED_VERSION, x_ms_version)
+
+ def add_resource(self, resource):
+ self._add_query(QueryStringConstants.SIGNED_RESOURCE, resource)
+
+ def add_id(self, id): # pylint:disable=W0622
+ self._add_query(QueryStringConstants.SIGNED_IDENTIFIER, id)
+
+ def add_account(self, services, resource_types):
+ self._add_query(QueryStringConstants.SIGNED_SERVICES, services)
+ self._add_query(QueryStringConstants.SIGNED_RESOURCE_TYPES, resource_types)
+
+ def add_override_response_headers(self, cache_control,
+ content_disposition,
+ content_encoding,
+ content_language,
+ content_type):
+ self._add_query(QueryStringConstants.SIGNED_CACHE_CONTROL, cache_control)
+ self._add_query(QueryStringConstants.SIGNED_CONTENT_DISPOSITION, content_disposition)
+ self._add_query(QueryStringConstants.SIGNED_CONTENT_ENCODING, content_encoding)
+ self._add_query(QueryStringConstants.SIGNED_CONTENT_LANGUAGE, content_language)
+ self._add_query(QueryStringConstants.SIGNED_CONTENT_TYPE, content_type)
+
+ def add_resource_signature(self, account_name, account_key, service, path):
+ def get_value_to_append(query):
+ return_value = self.query_dict.get(query) or ''
+ return return_value + '\n'
+
+ if path[0] != '/':
+ path = '/' + path
+
+ canonicalized_resource = '/' + service + '/' + account_name + path + '\n'
+
+ # Form the string to sign from shared_access_policy and canonicalized
+ # resource. The order of values is important.
+ string_to_sign = \
+ (get_value_to_append(QueryStringConstants.SIGNED_PERMISSION) +
+ get_value_to_append(QueryStringConstants.SIGNED_START) +
+ get_value_to_append(QueryStringConstants.SIGNED_EXPIRY) +
+ canonicalized_resource +
+ get_value_to_append(QueryStringConstants.SIGNED_IDENTIFIER) +
+ get_value_to_append(QueryStringConstants.SIGNED_IP) +
+ get_value_to_append(QueryStringConstants.SIGNED_PROTOCOL) +
+ get_value_to_append(QueryStringConstants.SIGNED_VERSION))
+
+ if service == 'blob' or service == 'file': # pylint:disable=R1714
+ string_to_sign += \
+ (get_value_to_append(QueryStringConstants.SIGNED_CACHE_CONTROL) +
+ get_value_to_append(QueryStringConstants.SIGNED_CONTENT_DISPOSITION) +
+ get_value_to_append(QueryStringConstants.SIGNED_CONTENT_ENCODING) +
+ get_value_to_append(QueryStringConstants.SIGNED_CONTENT_LANGUAGE) +
+ get_value_to_append(QueryStringConstants.SIGNED_CONTENT_TYPE))
+
+ # remove the trailing newline
+ if string_to_sign[-1] == '\n':
+ string_to_sign = string_to_sign[:-1]
+
+ self._add_query(QueryStringConstants.SIGNED_SIGNATURE,
+ _sign_string(account_key, string_to_sign))
+
+ def add_account_signature(self, account_name, account_key):
+ def get_value_to_append(query):
+ return_value = self.query_dict.get(query) or ''
+ return return_value + '\n'
+
+ string_to_sign = \
+ (account_name + '\n' +
+ get_value_to_append(QueryStringConstants.SIGNED_PERMISSION) +
+ get_value_to_append(QueryStringConstants.SIGNED_SERVICES) +
+ get_value_to_append(QueryStringConstants.SIGNED_RESOURCE_TYPES) +
+ get_value_to_append(QueryStringConstants.SIGNED_START) +
+ get_value_to_append(QueryStringConstants.SIGNED_EXPIRY) +
+ get_value_to_append(QueryStringConstants.SIGNED_IP) +
+ get_value_to_append(QueryStringConstants.SIGNED_PROTOCOL) +
+ get_value_to_append(QueryStringConstants.SIGNED_VERSION))
+
+ self._add_query(QueryStringConstants.SIGNED_SIGNATURE,
+ _sign_string(account_key, string_to_sign))
+
+ def get_token(self):
+ return '&'.join(['{0}={1}'.format(n, url_quote(v)) for n, v in self.query_dict.items() if v is not None])
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_shared/table_shared_access_signature.py b/sdk/tables/azure-data-tables/azure/data/tables/_shared/table_shared_access_signature.py
new file mode 100644
index 000000000000..02e392faf8c3
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_shared/table_shared_access_signature.py
@@ -0,0 +1,298 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from typing import Union
+
+from azure.data.tables._shared.models import AccountSasPermissions
+from azure.data.tables._models import TableServices
+from azure.data.tables._shared._common_conversion import _sign_string
+from azure.data.tables._shared._error import _validate_not_none
+from azure.data.tables._shared.constants import X_MS_VERSION
+from azure.data.tables._shared.shared_access_signature import _SharedAccessHelper,\
+ SharedAccessSignature, QueryStringConstants
+
+
+def generate_account_sas(
+ account_name, # type:str
+ account_key, # type:str
+ resource_types, # type:ResourceTypes
+ permission, # type:Union[str,AccountSasPermissions]
+ expiry, # type:Union[datetime,str]
+ **kwargs # type:Any
+):
+ # type: (...) -> str
+ """
+ Generates a shared access signature for the table service.
+ Use the returned signature with the sas_token parameter of TableService.
+
+ :param account_name: Account name
+ :type account_name:str
+ :param account_key: Account key
+ :type account_key:str
+ :param resource_types:
+ Specifies the resource types that are accessible with the account SAS.
+ :type resource_types: ResourceTypes
+ :param permission:
+ The permissions associated with the shared access signature. The
+ user is restricted to operations allowed by the permissions.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has been
+ specified in an associated stored access policy.
+ :type permission: Union[str, AccountSasPermissions]
+ :param expiry:
+ The time at which the shared access signature becomes invalid.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has
+ been specified in an associated stored access policy. Azure will always
+ convert values to UTC. If a date is passed in without timezone info, it
+ is assumed to be UTC.
+ :type expiry: Union[datetime,str]
+ :keyword Union[datetime,str] start:
+ The time at which the shared access signature becomes valid. If
+ omitted, start time for this call is assumed to be the time when the
+ storage service receives the request. Azure will always convert values
+ to UTC. If a date is passed in without timezone info, it is assumed to
+ be UTC.
+ :keyword str ip_address_or_range:
+ Specifies an IP address or a range of IP addresses from which to accept requests.
+ If the IP address from which the request originates does not match the IP address
+ or address range specified on the SAS token, the request is not authenticated.
+ For example, specifying sip=168.1.5.65 or sip=168.1.5.60-168.1.5.70 on the SAS
+ restricts the request to those IP addresses.
+ :keyword Union[str, SASProtocol] protocol:
+ Specifies the protocol permitted for a request made.
+ :return: A Shared Access Signature (sas) token.
+ :rtype: str
+ """
+ _validate_not_none('account_name', account_name)
+ _validate_not_none('account_key', account_key)
+ if permission is str:
+ permission = AccountSasPermissions.from_string(permission=permission)
+ sas = TableSharedAccessSignature(account_name, account_key)
+ return sas.generate_account(TableServices(), resource_types, permission,
+ expiry, start=kwargs.pop('start', None),
+ ip_address_or_range=kwargs.pop('ip_address_or_range', None),
+ protocol=kwargs.pop('protocol', None))
+
+
+def generate_table_sas(
+ account_name, # type: str
+ account_key, # type: str
+ table_name, # type: str
+ **kwargs # type: Any
+): # type: (...) -> str
+
+ """
+ Generates a shared access signature for the table service.
+ Use the returned signature with the sas_token parameter of TableService.
+
+
+ :param account_key: Account key
+ :type account_key: str
+ :param account_name: Account name
+ :type account_name: str
+ :param table_name: Table name
+ :type table_name: str
+ :keyword TableSasPermissions permission:
+ The permissions associated with the shared access signature. The
+ user is restricted to operations allowed by the permissions.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has been
+ specified in an associated stored access policy.
+ :keyword Union[datetime,str] expiry:
+ The time at which the shared access signature becomes invalid.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has
+ been specified in an associated stored access policy. Azure will always
+ convert values to UTC. If a date is passed in without timezone info, it
+ is assumed to be UTC.
+ :keyword Union[datetime,str] start:
+ The time at which the shared access signature becomes valid. If
+ omitted, start time for this call is assumed to be the time when the
+ storage service receives the request. Azure will always convert values
+ to UTC. If a date is passed in without timezone info, it is assumed to
+ be UTC.
+ :keyword str ip_address_or_range:
+ Specifies an IP address or a range of IP addresses from which to accept requests.
+ If the IP address from which the request originates does not match the IP address
+ or address range specified on the SAS token, the request is not authenticated.
+ For example, specifying sip=168.1.5.65 or sip=168.1.5.60-168.1.5.70 on the SAS
+ restricts the request to those IP addresses.
+ :keyword str policy_id: Access policy ID.
+ :keyword Union[str, SASProtocol] protocol:
+ Specifies the protocol permitted for a request made.
+ :keyword str end_rk: End row key
+ :keyword str end_pk: End partition key
+ :keyword str start_rk: Starting row key
+ :keyword str start_pk: Starting partition key
+ :return: A Shared Access Signature (sas) token.
+ :rtype: str
+ """
+
+ sas = TableSharedAccessSignature(account_name, account_key)
+ return sas.generate_table(
+ table_name=table_name,
+ permission=kwargs.pop('permission', None),
+ expiry=kwargs.pop('expiry', None),
+ start=kwargs.pop('start', None),
+ policy_id=kwargs.pop('policy_id', None),
+ ip=kwargs.pop('ip_address_or_range', None),
+ protocol=kwargs.pop('protocol', None),
+ start_pk=kwargs.pop('start_pk', None),
+ start_rk=kwargs.pop('start_rk', None),
+ end_pk=kwargs.pop('end_pk', None),
+ end_rk=kwargs.pop('end_rk', None),
+ **kwargs
+ ) # type: ignore
+
+
+class TableSharedAccessSignature(SharedAccessSignature):
+ """
+ Provides a factory for creating file and share access
+ signature tokens with a common account name and account key. Users can either
+ use the factory or can construct the appropriate service and use the
+ generate_*_shared_access_signature method directly.
+ """
+
+ def __init__(self, account_name, account_key):
+ """
+ :param account_name:
+ The storage account name used to generate the shared access signatures.
+ :type account_name: str
+ :param account_key:
+ The access key to generate the shares access signatures.
+ :type account_key: str
+ """
+ super(TableSharedAccessSignature, self).__init__(account_name, account_key, x_ms_version=X_MS_VERSION)
+
+ def generate_table(self, table_name, permission=None, # pylint: disable = W0613
+ expiry=None, start=None, policy_id=None,
+ ip_address_or_range=None, protocol=None,
+ start_pk=None, start_rk=None,
+ end_pk=None, end_rk=None, **kwargs):
+ """
+ Generates a shared access signature for the table.
+ Use the returned signature with the sas_token parameter of TableService.
+
+ :param str table_name:
+ Name of table.
+ :param TablePermissions permission:
+ The permissions associated with the shared access signature. The
+ user is restricted to operations allowed by the permissions.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has been
+ specified in an associated stored access policy.
+ :param expiry:
+ The time at which the shared access signature becomes invalid.
+ Required unless an id is given referencing a stored access policy
+ which contains this field. This field must be omitted if it has
+ been specified in an associated stored access policy. Azure will always
+ convert values to UTC. If a date is passed in without timezone info, it
+ is assumed to be UTC.
+ :type expiry: datetime or str
+ :param start:
+ The time at which the shared access signature becomes valid. If
+ omitted, start time for this call is assumed to be the time when the
+ storage service receives the request. Azure will always convert values
+ to UTC. If a date is passed in without timezone info, it is assumed to
+ be UTC.
+ :type start: datetime or str
+ :param str policy_id:
+ A unique value up to 64 characters in length that correlates to a
+ stored access policy. To create a stored access policy, use
+ set_table_service_properties.
+ :param str ip_address_or_range:
+ Specifies an IP address or a range of IP addresses from which to accept requests.
+ If the IP address from which the request originates does not match the IP address
+ or address range specified on the SAS token, the request is not authenticated.
+ For example, specifying sip=168.1.5.65 or sip=168.1.5.60-168.1.5.70 on the SAS
+ restricts the request to those IP addresses.
+ :param str protocol:
+ Specifies the protocol permitted for a request made. The default value
+ is https,http. See :class:`~azure.cosmosdb.table.common.models.Protocol` for possible values.
+ :param str start_pk:
+ The minimum partition key accessible with this shared access
+ signature. startpk must accompany startrk. Key values are inclusive.
+ If omitted, there is no lower bound on the table entities that can
+ be accessed.
+ :param str start_rk:
+ The minimum row key accessible with this shared access signature.
+ startpk must accompany startrk. Key values are inclusive. If
+ omitted, there is no lower bound on the table entities that can be
+ accessed.
+ :param str end_pk:
+ The maximum partition key accessible with this shared access
+ signature. endpk must accompany endrk. Key values are inclusive. If
+ omitted, there is no upper bound on the table entities that can be
+ accessed.
+ :param str end_rk:
+ The maximum row key accessible with this shared access signature.
+ endpk must accompany endrk. Key values are inclusive. If omitted,
+ there is no upper bound on the table entities that can be accessed.
+ """
+ sas = _TableSharedAccessHelper()
+ sas.add_base(permission, expiry, start, ip_address_or_range, protocol, X_MS_VERSION)
+ sas.add_id(policy_id)
+ sas.add_table_access_ranges(table_name, start_pk, start_rk, end_pk, end_rk)
+
+ # Table names must be signed lower case
+ resource_path = table_name.lower()
+ sas.add_resource_signature(self.account_name, self.account_key, 'table', resource_path)
+
+ return sas.get_token()
+
+
+class _TableQueryStringConstants(QueryStringConstants):
+ TABLE_NAME = 'tn'
+
+
+class _TableSharedAccessHelper(_SharedAccessHelper):
+
+ def __init__(self):
+ super().__init__()
+ self.query_dict = {}
+
+ def add_table_access_ranges(self, table_name, start_pk, start_rk,
+ end_pk, end_rk):
+ self._add_query(_TableQueryStringConstants.TABLE_NAME, table_name)
+ self._add_query(_TableQueryStringConstants.START_PK, start_pk)
+ self._add_query(_TableQueryStringConstants.START_RK, start_rk)
+ self._add_query(_TableQueryStringConstants.END_PK, end_pk)
+ self._add_query(_TableQueryStringConstants.END_RK, end_rk)
+
+ def add_resource_signature(self, account_name, account_key, service, path):
+ def get_value_to_append(query):
+ return_value = self.query_dict.get(query) or ''
+ return return_value + '\n'
+
+ if path[0] != '/':
+ path = '/' + path
+
+ canonicalized_resource = '/' + service + '/' + account_name + path + '\n'
+
+ # Form the string to sign from shared_access_policy and canonicalized
+ # resource. The order of values is important.
+ string_to_sign = \
+ (get_value_to_append(QueryStringConstants.SIGNED_PERMISSION) +
+ get_value_to_append(QueryStringConstants.SIGNED_START) +
+ get_value_to_append(QueryStringConstants.SIGNED_EXPIRY) +
+ canonicalized_resource +
+ get_value_to_append(QueryStringConstants.SIGNED_IDENTIFIER) +
+ get_value_to_append(QueryStringConstants.SIGNED_IP) +
+ get_value_to_append(QueryStringConstants.SIGNED_PROTOCOL) +
+ get_value_to_append(QueryStringConstants.SIGNED_VERSION))
+
+ string_to_sign += \
+ (get_value_to_append(QueryStringConstants.START_PK) +
+ get_value_to_append(QueryStringConstants.START_RK) +
+ get_value_to_append(QueryStringConstants.END_PK) +
+ get_value_to_append(QueryStringConstants.END_RK))
+
+ # remove the trailing newline
+ if string_to_sign[-1] == '\n':
+ string_to_sign = string_to_sign[:-1]
+
+ self._add_query(QueryStringConstants.SIGNED_SIGNATURE,
+ _sign_string(account_key, string_to_sign))
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py
new file mode 100644
index 000000000000..ff0918cfd051
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py
@@ -0,0 +1,471 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import functools
+from typing import Optional, Any, Union # pylint: disable = W0611
+
+try:
+ from urllib.parse import urlparse, unquote
+except ImportError:
+ from urlparse import urlparse # type: ignore
+ from urllib2 import unquote # type: ignore
+
+from azure.core.paging import ItemPaged
+from azure.core.exceptions import HttpResponseError, ResourceNotFoundError
+from azure.core.tracing.decorator import distributed_trace
+from ._deserialize import _convert_to_entity
+from ._entity import TableEntity
+from ._generated import AzureTable
+from ._generated.models import AccessPolicy, SignedIdentifier, TableProperties, QueryOptions
+from ._serialize import _get_match_headers, _add_entity_properties
+from ._shared.base_client import parse_connection_str
+from ._shared._table_client_base import TableClientBase
+
+from ._shared.request_handlers import serialize_iso
+from ._shared.response_handlers import process_table_error
+
+from ._version import VERSION
+
+from ._models import TableEntityPropertiesPaged, UpdateMode, Table
+
+from ._shared.response_handlers import return_headers_and_deserialized
+
+
+class TableClient(TableClientBase):
+ """ :ivar str account_name: Name of the storage account (Cosmos or Azure)"""
+
+ def __init__(
+ self, account_url, # type: str
+ table_name, # type: str
+ credential=None, # type: Union[str,TokenCredential]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Create TableClient from a Credential.
+
+ :param account_url:
+ A url to an Azure Storage account.
+ :type account_url: str
+ :param table_name: The table name.
+ :type table_name: str
+ :param credential:
+ The credentials with which to authenticate. This is optional if the
+ account URL already has a SAS token, or the connection string already has shared
+ access key values. The value can be a SAS token string, an account shared access
+ key, or an instance of a TokenCredentials class from azure.identity.
+ :type credential: Union[str,TokenCredential]
+
+ :returns: None
+ """
+ super(TableClient, self).__init__(account_url, table_name, credential=credential, **kwargs)
+ self._client = AzureTable(self.url, pipeline=self._pipeline)
+ self._client._config.version = kwargs.get('api_version', VERSION) # pylint: disable=protected-access
+
+ @classmethod
+ def from_connection_string(
+ cls, conn_str, # type: str
+ table_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> TableClient
+ """Create TableClient from a Connection String.
+
+ :param conn_str:
+ A connection string to an Azure Storage or Cosmos account.
+ :type conn_str: str
+ :param table_name: The table name.
+ :type table_name: str
+ :returns: A table client.
+ :rtype: ~azure.data.tables.TableClient
+ """
+ account_url, secondary, credential = parse_connection_str(
+ conn_str=conn_str, credential=None, service='table')
+ if 'secondary_hostname' not in kwargs:
+ kwargs['secondary_hostname'] = secondary
+ return cls(account_url, table_name=table_name, credential=credential, **kwargs) # type: ignore
+
+ @classmethod
+ def from_table_url(cls, table_url, credential=None, **kwargs):
+ # type: (str, Optional[Any], Any) -> TableClient
+ """A client to interact with a specific Table.
+
+ :param table_url: The full URI to the table, including SAS token if used.
+ :type table_url: str
+ :param credential:
+ The credentials with which to authenticate. This is optional if the
+ account URL already has a SAS token. The value can be a SAS token string, an account
+ shared access key.
+ :type credential: str
+ :returns: A table client.
+ :rtype: ~azure.data.tables.TableClient
+ """
+ try:
+ if not table_url.lower().startswith('http'):
+ table_url = "https://" + table_url
+ except AttributeError:
+ raise ValueError("Table URL must be a string.")
+ parsed_url = urlparse(table_url.rstrip('/'))
+
+ if not parsed_url.netloc:
+ raise ValueError("Invalid URL: {}".format(table_url))
+
+ table_path = parsed_url.path.lstrip('/').split('/')
+ account_path = ""
+ if len(table_path) > 1:
+ account_path = "/" + "/".join(table_path[:-1])
+ account_url = "{}://{}{}?{}".format(
+ parsed_url.scheme,
+ parsed_url.netloc.rstrip('/'),
+ account_path,
+ parsed_url.query)
+ table_name = unquote(table_path[-1])
+ if not table_name:
+ raise ValueError("Invalid URL. Please provide a URL with a valid table name")
+ return cls(account_url, table_name=table_name, credential=credential, **kwargs)
+
+ @distributed_trace
+ def get_table_access_policy(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> dict[str,AccessPolicy]
+ """Retrieves details about any stored access policies specified on the table that may be
+ used with Shared Access Signatures.
+
+ :return: Dictionary of SignedIdentifiers
+ :rtype: dict[str,AccessPolicy]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ timeout = kwargs.pop('timeout', None)
+ try:
+ _, identifiers = self._client.table.get_access_policy(
+ table=self.table_name,
+ timeout=timeout,
+ cls=return_headers_and_deserialized,
+ **kwargs)
+ except HttpResponseError as error:
+ process_table_error(error)
+ return {s.id: s.access_policy or AccessPolicy() for s in identifiers} # pylint: disable=E1125
+
+ @distributed_trace
+ def set_table_access_policy(
+ self,
+ signed_identifiers, # type: dict[str,AccessPolicy]
+ **kwargs):
+ # type: (...) -> None
+ """Sets stored access policies for the table that may be used with Shared Access Signatures.
+
+ :param signed_identifiers:
+ :type signed_identifiers: dict[str,AccessPolicy]
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ self._validate_signed_identifiers(signed_identifiers)
+ identifiers = []
+ for key, value in signed_identifiers.items():
+ if value:
+ value.start = serialize_iso(value.start)
+ value.expiry = serialize_iso(value.expiry)
+ identifiers.append(SignedIdentifier(id=key, access_policy=value))
+ signed_identifiers = identifiers # type: ignore
+ try:
+ self._client.table.set_access_policy(
+ table=self.table_name,
+ table_acl=signed_identifiers or None,
+ **kwargs)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def create_table(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Table
+ """Creates a new table under the current account.
+
+ :return: Table created
+ :rtype: Table
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ table_properties = TableProperties(table_name=self.table_name, **kwargs)
+ try:
+ table = self._client.table.create(table_properties)
+ return Table(table=table)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def delete_table(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Deletes the table under the current account.
+
+ :return: None
+ :rtype: None
+ """
+ try:
+ self._client.table.delete(table=self.table_name, **kwargs)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def delete_entity(
+ self,
+ partition_key, # type: str
+ row_key, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Deletes the specified entity in a table.
+
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :keyword str etag: Etag of the entity
+ :keyword ~azure.core.MatchConditions match_condition: MatchCondition
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+
+ if_match, if_not_match = _get_match_headers(kwargs=dict(kwargs, etag=kwargs.pop('etag', None),
+ match_condition=kwargs.pop('match_condition', None)),
+ etag_param='etag', match_param='match_condition')
+ try:
+ self._client.table.delete_entity(
+ table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ if_match=if_match or if_not_match or '*',
+ **kwargs)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def create_entity(
+ self,
+ entity, # type: Union[TableEntity, dict[str,str]]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> TableEntity
+ """Insert entity in a table.
+
+ :param entity: The properties for the table entity.
+ :type entity: Union[TableEntity, dict[str,str]]
+ :return: TableEntity mapping str to azure.data.tables.EntityProperty
+ :rtype: ~azure.data.tables.TableEntity
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+
+ if "PartitionKey" in entity and "RowKey" in entity:
+ entity = _add_entity_properties(entity)
+ # TODO: Remove - and run test to see what happens with the service
+ else:
+ raise ValueError('PartitionKey and RowKey were not provided in entity')
+ try:
+ inserted_entity = self._client.table.insert_entity(
+ table=self.table_name,
+ table_entity_properties=entity,
+ **kwargs
+ )
+ properties = _convert_to_entity(inserted_entity)
+ return properties
+ except ResourceNotFoundError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def update_entity( # pylint:disable=R1710
+ self,
+ entity, # type: Union[TableEntity, dict[str,str]]
+ mode=UpdateMode.MERGE, # type: UpdateMode
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Update entity in a table.
+
+ :param entity: The properties for the table entity.
+ :type entity: Union[TableEntity, dict[str,str]]
+ :param mode: Merge or Replace entity
+ :type mode: ~azure.data.tables.UpdateMode
+ :keyword str partition_key: The partition key of the entity.
+ :keyword str row_key: The row key of the entity.
+ :keyword str etag: Etag of the entity
+ :keyword ~azure.core.MatchConditions match_condition: MatchCondition
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+
+ if_match, if_not_match = _get_match_headers(kwargs=dict(kwargs, etag=kwargs.pop('etag', None),
+ match_condition=kwargs.pop('match_condition', None)),
+ etag_param='etag', match_param='match_condition')
+
+ partition_key = entity['PartitionKey']
+ row_key = entity['RowKey']
+ entity = _add_entity_properties(entity)
+ try:
+ if mode is UpdateMode.REPLACE:
+ self._client.table.update_entity(
+ table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ table_entity_properties=entity,
+ if_match=if_match or if_not_match or "*",
+ **kwargs)
+ elif mode is UpdateMode.MERGE:
+ self._client.table.merge_entity(table=self.table_name, partition_key=partition_key,
+ row_key=row_key, if_match=if_match or if_not_match or "*",
+ table_entity_properties=entity, **kwargs)
+ else:
+ raise ValueError('Mode type is not supported')
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def list_entities(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> ItemPaged[TableEntity]
+ """Lists entities in a table.
+
+ :keyword int results_per_page: Number of entities per page in return ItemPaged
+ :keyword Union[str, list(str)] select: Specify desired properties of an entity to return certain entities
+ :return: Query of table entities
+ :rtype: ItemPaged[TableEntity]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ user_select = kwargs.pop('select', None)
+ if user_select and not isinstance(user_select, str):
+ user_select = ", ".join(user_select)
+
+ query_options = QueryOptions(top=kwargs.pop('results_per_page', None), select=user_select)
+
+ command = functools.partial(
+ self._client.table.query_entities,
+ **kwargs)
+ return ItemPaged(
+ command, results_per_page=query_options, table=self.table_name,
+ page_iterator_class=TableEntityPropertiesPaged
+ )
+
+ @distributed_trace
+ def query_entities(
+ self,
+ filter, # type: str # pylint: disable = W0622
+ **kwargs
+ ):
+ # type: (...) -> ItemPaged[TableEntity]
+ """Lists entities in a table.
+
+ :param str filter: Specify a filter to return certain entities
+ :keyword int results_per_page: Number of entities per page in return ItemPaged
+ :keyword Union[str, list[str]] select: Specify desired properties of an entity to return certain entities
+ :keyword dict parameters: Dictionary for formatting query with additional, user defined parameters
+ :return: Query of table entities
+ :rtype: ItemPaged[TableEntity]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ parameters = kwargs.pop('parameters', None)
+ filter = self._parameter_filter_substitution(parameters, filter) # pylint: disable = W0622
+
+ user_select = kwargs.pop('select', None)
+ if user_select and not isinstance(user_select, str):
+ user_select = ", ".join(user_select)
+
+ query_options = QueryOptions(top=kwargs.pop('results_per_page', None), select=user_select,
+ filter=filter)
+
+ command = functools.partial(
+ self._client.table.query_entities,
+ query_options=query_options,
+ **kwargs)
+ return ItemPaged(
+ command, table=self.table_name,
+ page_iterator_class=TableEntityPropertiesPaged
+ )
+
+ @distributed_trace
+ def get_entity(
+ self,
+ partition_key, # type: str
+ row_key, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> TableEntity
+ """Queries entities in a table.
+
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :return: Entity mapping str to azure.data.tables.EntityProperty
+ :rtype: ~azure.data.tables.TableEntity
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ try:
+ entity = self._client.table.query_entities_with_partition_and_row_key(table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ **kwargs)
+ properties = _convert_to_entity(entity.additional_properties)
+ return properties
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def upsert_entity( # pylint:disable=R1710
+ self,
+ entity, # type: Union[TableEntity, dict[str,str]]
+ mode=UpdateMode.MERGE, # type: UpdateMode
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Update/Merge or Insert entity into table.
+
+ :param entity: The properties for the table entity.
+ :type entity: Union[TableEntity, dict[str,str]]
+ :param mode: Merge or Replace and Insert on fail
+ :type mode: ~azure.data.tables.UpdateMode
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+
+ partition_key = entity['PartitionKey']
+ row_key = entity['RowKey']
+ entity = _add_entity_properties(entity)
+
+ try:
+ if mode is UpdateMode.MERGE:
+ self._client.table.merge_entity(
+ table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ table_entity_properties=entity,
+ **kwargs
+ )
+ elif mode is UpdateMode.REPLACE:
+ self._client.table.update_entity(
+ table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ table_entity_properties=entity,
+ **kwargs)
+ else:
+ raise ValueError('Mode type is not supported')
+ except ResourceNotFoundError:
+ self.create_entity(
+ partition_key=partition_key,
+ row_key=row_key,
+ table_entity_properties=entity,
+ **kwargs
+ )
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py
new file mode 100644
index 000000000000..ce9e97c88a88
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py
@@ -0,0 +1,264 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import functools
+from typing import Any, Union
+from azure.core.exceptions import HttpResponseError
+from azure.core.paging import ItemPaged
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.pipeline import Pipeline
+from ._models import Table
+
+from ._generated import AzureTable
+from ._generated.models import TableProperties, TableServiceProperties, QueryOptions
+from ._models import TablePropertiesPaged, service_stats_deserialize, service_properties_deserialize
+from ._shared.base_client import parse_connection_str, TransportWrapper
+from ._shared.models import LocationMode
+from ._shared.response_handlers import process_table_error
+from ._version import VERSION
+
+from ._table_client import TableClient
+from ._shared._table_service_client_base import TableServiceClientBase
+
+
+class TableServiceClient(TableServiceClientBase):
+ """ :ivar str account_name: Name of the storage account (Cosmos or Azure)"""
+ def __init__(
+ self, account_url, # type: str
+ credential=None, # type: Union[str,TokenCredential]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Create TableServiceClient from a Credential.
+
+ :param account_url:
+ A url to an Azure Storage account.
+ :type account_url: str
+ :param credential:
+ The credentials with which to authenticate. This is optional if the
+ account URL already has a SAS token, or the connection string already has shared
+ access key values. The value can be a SAS token string, an account shared access
+ key.
+ :type credential: str
+ :returns: None
+ """
+
+ super(TableServiceClient, self).__init__(account_url, service='table', credential=credential, **kwargs)
+ self._client = AzureTable(self.url, pipeline=self._pipeline)
+ self._client._config.version = kwargs.get('api_version', VERSION) # pylint: disable=protected-access
+
+ @classmethod
+ def from_connection_string(
+ cls, conn_str, # type: str
+ **kwargs # type: Any
+ ): # type: (...) -> TableServiceClient
+ """Create TableServiceClient from a Connection String.
+
+ :param conn_str:
+ A connection string to an Azure Storage or Cosmos account.
+ :type conn_str: str
+ :returns: A Table service client.
+ :rtype: ~azure.data.tables.TableServiceClient
+ """
+ account_url, secondary, credential = parse_connection_str(
+ conn_str=conn_str, credential=None, service='table')
+ if 'secondary_hostname' not in kwargs:
+ kwargs['secondary_hostname'] = secondary
+ return cls(account_url, credential=credential, **kwargs)
+
+ @distributed_trace
+ def get_service_stats(self, **kwargs):
+ # type: (...) -> dict[str,object]
+ """Retrieves statistics related to replication for the Table service. It is only available on the secondary
+ location endpoint when read-access geo-redundant replication is enabled for the account.
+
+ :return: Dictionary of Service Stats
+ :rtype:dict[str, object]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ try:
+ timeout = kwargs.pop('timeout', None)
+ stats = self._client.service.get_statistics( # type: ignore
+ timeout=timeout, use_location=LocationMode.SECONDARY, **kwargs)
+ return service_stats_deserialize(stats)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def get_service_properties(self, **kwargs):
+ # type: (...) -> dict[str,Any]
+ """Gets the properties of an account's Table service,
+ including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.
+
+ :return: Dictionary of service properties
+ :rtype:dict[str, Any]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ timeout = kwargs.pop('timeout', None)
+ try:
+ service_props = self._client.service.get_properties(timeout=timeout, **kwargs) # type: ignore
+ return service_properties_deserialize(service_props)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def set_service_properties(
+ self,
+ analytics_logging=None, # type: Optional[TableAnalyticsLogging]
+ hour_metrics=None, # type: Optional[Metrics]
+ minute_metrics=None, # type: Optional[Metrics]
+ cors=None, # type: Optional[CorsRule]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Sets properties for an account's Table service endpoint,
+ including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.
+
+ :param analytics_logging: Properties for analytics
+ :type analytics_logging: ~azure.data.tables.TableAnalyticsLogging
+ :param hour_metrics: Hour level metrics
+ :type hour_metrics: ~azure.data.tables.Metrics
+ :param minute_metrics: Minute level metrics
+ :type minute_metrics: ~azure.data.tables.Metrics
+ :param cors: Cross-origin resource sharing rules
+ :type cors: ~azure.data.tables.CorsRule
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ props = TableServiceProperties(
+ logging=analytics_logging,
+ hour_metrics=hour_metrics,
+ minute_metrics=minute_metrics,
+ cors=cors
+ )
+ try:
+ return self._client.service.set_properties(props, **kwargs) # type: ignore
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def create_table(
+ self,
+ table_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> TableClient
+ """Creates a new table under the current account.
+
+ :param table_name: The Table name.
+ :type table_name: str
+ :return: TableClient
+ :rtype: ~azure.data.tables.TableClient
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ table = self.get_table_client(table_name=table_name)
+ table.create_table(**kwargs)
+ return table
+
+ @distributed_trace
+ def delete_table(
+ self,
+ table_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Deletes the table under the current account
+
+ :param table_name: The Table name.
+ :type table_name: str
+ :return: None
+ :rtype: None
+ """
+ table = self.get_table_client(table_name=table_name)
+ table.delete_table(**kwargs)
+
+ @distributed_trace
+ def query_tables(
+ self,
+ filter, # pylint: disable=W0622
+ **kwargs # type: Any
+ ):
+ # type: (...) -> ItemPaged[Table]
+ """Queries tables under the given account.
+ :param filter: Specify a filter to return certain tables
+ :type filter: str
+ :keyword int results_per_page: Number of tables per page in return ItemPaged
+ :keyword Union[str, list(str)] select: Specify desired properties of a table to return certain tables
+ :keyword dict parameters: Dictionary for formatting query with additional, user defined parameters
+ :return: A query of tables
+ :rtype: ItemPaged[Table]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ parameters = kwargs.pop('parameters', None)
+ filter = self._parameter_filter_substitution(parameters, filter) # pylint: disable=W0622
+
+ user_select = kwargs.pop('select', None)
+ if user_select and not isinstance(user_select, str):
+ user_select = ", ".join(user_select)
+
+ query_options = QueryOptions(top=kwargs.pop('results_per_page', None), select=user_select,
+ filter=filter)
+ command = functools.partial(self._client.table.query, query_options=query_options,
+ **kwargs)
+ return ItemPaged(
+ command,
+ page_iterator_class=TablePropertiesPaged
+ )
+
+ @distributed_trace
+ def list_tables(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> ItemPaged[Table]
+ """Queries tables under the given account.
+
+ :keyword int results_per_page: Number of tables per page in return ItemPaged
+ :keyword Union[str, list(str)] select: Specify desired properties of a table to return certain tables
+ :return: A query of tables
+ :rtype: ItemPaged[Table]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ user_select = kwargs.pop('select', None)
+ if user_select and not isinstance(user_select, str):
+ user_select = ", ".join(user_select)
+
+ query_options = QueryOptions(top=kwargs.pop('results_per_page', None), select=user_select)
+
+ command = functools.partial(
+ self._client.table.query,
+ query_options=query_options,
+ **kwargs)
+ return ItemPaged(
+ command,
+ page_iterator_class=TablePropertiesPaged
+ )
+
+ def get_table_client(self, table_name, **kwargs):
+ # type: (Union[TableProperties, str], Optional[Any]) -> TableClient
+ """Get a client to interact with the specified table.
+
+ The table need not already exist.
+
+ :param table_name:
+ The table name
+ :type table_name: str
+ :returns: A :class:`~azure.data.tables.TableClient` object.
+ :rtype: ~azure.data.tables.TableClient
+
+ """
+
+ _pipeline = Pipeline(
+ transport=TransportWrapper(self._pipeline._transport), # pylint: disable = protected-access
+ policies=self._pipeline._impl_policies # pylint: disable = protected-access
+ )
+
+ return TableClient(
+ self.url, table_name=table_name, credential=self.credential,
+ key_resolver_function=self.key_resolver_function, require_encryption=self.require_encryption,
+ key_encryption_key=self.key_encryption_key, api_version=self.api_version, _pipeline=_pipeline,
+ _configuration=self._config, _location_mode=self._location_mode, _hosts=self._hosts, **kwargs)
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_version.py b/sdk/tables/azure-data-tables/azure/data/tables/_version.py
new file mode 100644
index 000000000000..71af5012673a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/_version.py
@@ -0,0 +1,7 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+VERSION = '12.0.0b1'
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/__init__.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/__init__.py
new file mode 100644
index 000000000000..5ff784b46591
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/__init__.py
@@ -0,0 +1,13 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+from azure.data.tables.aio._table_client_async import TableClient
+from azure.data.tables.aio._table_service_client_async import TableServiceClient
+
+__all__ = [
+ 'TableClient',
+ 'TableServiceClient',
+]
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_models.py
new file mode 100644
index 000000000000..d41bfa187b06
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_models.py
@@ -0,0 +1,104 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from azure.data.tables._models import Table
+from azure.data.tables._deserialize import _convert_to_entity
+from azure.data.tables._shared.response_handlers import return_context_and_deserialized, process_table_error
+from azure.core.exceptions import HttpResponseError
+from azure.core.async_paging import AsyncPageIterator
+
+
+class TablePropertiesPaged(AsyncPageIterator):
+ """An iterable of Table properties.
+
+ :ivar: str location_mode: The location mode being used to list results. The available
+ options include "primary" and "secondary".
+ :ivar: callable command: Function to retrieve the next page of items.
+ call.
+ :vartype: str continuation_token: An opaque continuation token.
+ """
+
+ def __init__(self, command, continuation_token=None, **kwargs):
+ super(TablePropertiesPaged, self).__init__(
+ self._get_next_cb,
+ self._extract_data_cb,
+ continuation_token=continuation_token or "",
+ **kwargs
+ )
+ self._command = command
+ self.next_table_name = None
+ self._headers = None
+ self.location_mode = None
+
+ async def _get_next_cb(self, continuation_token, **kwargs):
+ try:
+ return await self._command(
+ next_table_name=continuation_token or None,
+ cls=kwargs.pop('cls', return_context_and_deserialized),
+ use_location=self.location_mode
+ )
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ async def _extract_data_cb(self, get_next_return):
+ self.location_mode, self._response, self._headers = get_next_return
+ props_list = [Table(t) for t in self._response.value]
+ return self._headers['x-ms-continuation-NextTableName'] or None, props_list
+
+
+class TableEntityPropertiesPaged(AsyncPageIterator):
+ """An iterable of TableEntity properties.
+
+ :ivar: callable command: Function to retrieve the next page of items.
+ call.
+ :ivar: int results_per_page: The maximum number of results retrieved per API call.
+ :ivar: Table table: The table that contains the entities
+ :ivar: callable command: Function to retrieve the next page of items.
+ :param int results_per_page: The maximum number of queue names to retrieve per
+ call.
+ :param str continuation_token: An opaque continuation token.
+ """
+
+ def __init__(self, command, results_per_page=None, table=None,
+ continuation_token=None):
+ super(TableEntityPropertiesPaged, self).__init__(
+ self._get_next_cb,
+ self._extract_data_cb,
+ continuation_token=continuation_token or {}
+ )
+ self._command = command
+ self._headers = None
+ self.results_per_page = results_per_page
+ self.table = table
+ self.location_mode = None
+
+ async def _get_next_cb(self, continuation_token):
+ row_key = ""
+ partition_key = ""
+ for key, value in continuation_token.items():
+ if key == "RowKey":
+ row_key = value
+ if key == "PartitionKey":
+ partition_key = value
+ try:
+ return await self._command(
+ query_options=self.results_per_page or None,
+ next_row_key=row_key or None,
+ next_partition_key=partition_key or None,
+ table=self.table,
+ cls=return_context_and_deserialized,
+ use_location=self.location_mode
+ )
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ async def _extract_data_cb(self, get_next_return):
+ self.location_mode, self._response, self._headers = get_next_return
+ props_list = [_convert_to_entity(t) for t in self._response.value]
+ next_entity = {}
+ if self._headers['x-ms-continuation-NextPartitionKey'] or self._headers['x-ms-continuation-NextRowKey']:
+ next_entity = {'PartitionKey': self._headers['x-ms-continuation-NextPartitionKey'],
+ 'RowKey': self._headers['x-ms-continuation-NextRowKey']}
+ return next_entity or None, props_list
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py
new file mode 100644
index 000000000000..00c3acd2c5ec
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py
@@ -0,0 +1,407 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import functools
+from typing import (
+ Union,
+ Any,
+)
+
+from azure.core.async_paging import AsyncItemPaged
+from azure.core.exceptions import ResourceNotFoundError, HttpResponseError
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.data.tables import VERSION
+from azure.data.tables._entity import TableEntity
+from azure.data.tables._generated.aio._azure_table_async import AzureTable
+from azure.data.tables._generated.models import SignedIdentifier, TableProperties, QueryOptions
+from azure.data.tables._models import AccessPolicy, Table
+from azure.data.tables._shared.base_client_async import AsyncStorageAccountHostsMixin
+from azure.data.tables._shared.policies_async import ExponentialRetry
+from azure.data.tables._shared.request_handlers import serialize_iso
+from azure.data.tables._shared.response_handlers import return_headers_and_deserialized, process_table_error
+
+from .._models import UpdateMode
+from ._models import TableEntityPropertiesPaged
+from .._deserialize import _convert_to_entity
+from .._serialize import _add_entity_properties, _get_match_headers
+from .._shared._table_client_base import TableClientBase
+
+
+class TableClient(AsyncStorageAccountHostsMixin, TableClientBase):
+ """ :ivar str account_name: Name of the storage account (Cosmos or Azure)"""
+
+ def __init__(
+ self,
+ account_url, # type: str
+ table_name, # type: str
+ credential, # type : Optional[Any]=None
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Create TableClient from a Credential.
+
+ :param account_url:
+ A url to an Azure Storage account.
+ :type account_url: str
+ :param table_name: The table name.
+ :type table_name: str
+ :param credential:
+ The credentials with which to authenticate. This is optional if the
+ account URL already has a SAS token, or the connection string already has shared
+ access key values. The value can be a SAS token string, an account shared access
+ key.
+ :type credential: str
+
+ :returns: None
+ """
+ kwargs["retry_policy"] = kwargs.get("retry_policy") or ExponentialRetry(**kwargs)
+ loop = kwargs.pop('loop', None)
+ super(TableClient, self).__init__(
+ account_url, table_name=table_name, credential=credential, loop=loop, **kwargs
+ )
+ self._client = AzureTable(self.url, pipeline=self._pipeline, loop=loop)
+ self._client._config.version = kwargs.get('api_version', VERSION) # pylint: disable = W0212
+ self._loop = loop
+
+ @distributed_trace_async
+ async def get_table_access_policy(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> dict[str,AccessPolicy]
+ """
+ Retrieves details about any stored access policies specified on the table that may be
+ used with Shared Access Signatures.
+ :return: Dictionary of SignedIdentifiers
+ :rtype: dict[str,~azure.data.tables.AccessPolicy]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ timeout = kwargs.pop('timeout', None)
+ try:
+ _, identifiers = await self._client.table.get_access_policy(
+ table=self.table_name,
+ timeout=timeout,
+ cls=return_headers_and_deserialized,
+ **kwargs)
+ except HttpResponseError as error:
+ process_table_error(error)
+ return {s.id: s.access_policy or AccessPolicy() for s in identifiers}
+
+ @distributed_trace_async
+ async def set_table_access_policy(
+ self,
+ signed_identifiers, # type: dict[str,AccessPolicy]
+ **kwargs):
+ # type: (...) -> None
+ """Sets stored access policies for the table that may be used with Shared Access Signatures.
+
+ :param signed_identifiers:
+ :type signed_identifiers: dict[str,AccessPolicy]
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ self._validate_signed_identifiers(signed_identifiers)
+ identifiers = []
+ for key, value in signed_identifiers.items():
+ if value:
+ value.start = serialize_iso(value.start)
+ value.expiry = serialize_iso(value.expiry)
+ identifiers.append(SignedIdentifier(id=key, access_policy=value))
+ signed_identifiers = identifiers # type: ignore
+ try:
+ await self._client.table.set_access_policy(
+ table=self.table_name,
+ table_acl=signed_identifiers or None,
+ **kwargs)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def create_table(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Table
+ """Creates a new table under the given account.
+ :return: Table created
+ :rtype: Table
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ table_properties = TableProperties(table_name=self.table_name, **kwargs)
+ try:
+ table = await self._client.table.create(table_properties)
+ return Table(table)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def delete_table(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Creates a new table under the given account.
+ :return: None
+ :rtype: None
+ """
+ try:
+ await self._client.table.delete(table=self.table_name, **kwargs)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def delete_entity(
+ self,
+ partition_key, # type: str
+ row_key, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Deletes the specified entity in a table.
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :keyword str etag: Etag of the entity
+ :keyword ~azure.core.MatchConditions match_condition: MatchCondition
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ if_match, if_not_match = _get_match_headers(kwargs=dict(kwargs, etag=kwargs.pop('etag', None),
+ match_condition=kwargs.pop('match_condition', None)),
+ etag_param='etag', match_param='match_condition')
+ try:
+ await self._client.table.delete_entity(
+ table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ if_match=if_match or if_not_match or '*',
+ **kwargs)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def create_entity(
+ self,
+ entity, # type: Union[TableEntity, dict[str,str]]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> TableEntity
+ """Insert entity in a table.
+ :param entity: The properties for the table entity.
+ :type entity: dict[str, str]
+ :return: TableEntity mapping str to azure.data.tables.EntityProperty
+ :rtype: ~azure.data.tables.TableEntity
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+
+ if entity:
+ if "PartitionKey" in entity and "RowKey" in entity:
+ entity = _add_entity_properties(entity)
+ else:
+ raise ValueError('PartitionKey and RowKey were not provided in entity')
+ try:
+ inserted_entity = await self._client.table.insert_entity(
+ table=self.table_name,
+ table_entity_properties=entity,
+ **kwargs
+ )
+ properties = _convert_to_entity(inserted_entity)
+ return properties
+ except ResourceNotFoundError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def update_entity(
+ self,
+ entity, # type: Union[TableEntity, dict[str,str]]
+ mode=UpdateMode.MERGE, # type: UpdateMode
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Update entity in a table.
+ :param mode: Merge or Replace entity
+ :type mode: ~azure.data.tables.UpdateMode
+ :param entity: The properties for the table entity.
+ :type entity: dict[str, str]
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :param etag: Etag of the entity
+ :type etag: str
+ :param match_condition: MatchCondition
+ :type match_condition: ~azure.core.MatchConditions
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ if_match, if_not_match = _get_match_headers(kwargs=dict(kwargs, etag=kwargs.pop('etag', None),
+ match_condition=kwargs.pop('match_condition', None)),
+ etag_param='etag', match_param='match_condition')
+
+ partition_key = entity['PartitionKey']
+ row_key = entity['RowKey']
+ entity = _add_entity_properties(entity)
+ try:
+ if mode is UpdateMode.REPLACE:
+ await self._client.table.update_entity(
+ table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ table_entity_properties=entity,
+ if_match=if_match or if_not_match or "*",
+ **kwargs)
+ elif mode is UpdateMode.MERGE:
+ await self._client.table.merge_entity(table=self.table_name, partition_key=partition_key,
+ row_key=row_key, if_match=if_match or if_not_match or "*",
+ table_entity_properties=entity, **kwargs)
+ else:
+ raise ValueError('Mode type is not supported')
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace
+ def list_entities(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> AsyncItemPaged[TableEntity]
+ """Lists entities in a table.
+
+ :keyword int results_per_page: Number of entities per page in return ItemPaged
+ :keyword Union[str, list(str)] select: Specify desired properties of an entity to return certain entities
+ :return: Query of table entities
+ :rtype: AsyncItemPaged[TableEntity]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ user_select = kwargs.pop('select', None)
+ if user_select and not isinstance(user_select, str):
+ user_select = ", ".join(user_select)
+
+ query_options = QueryOptions(top=kwargs.pop('results_per_page', None), select=user_select)
+
+ command = functools.partial(
+ self._client.table.query_entities,
+ **kwargs)
+ return AsyncItemPaged(
+ command, results_per_page=query_options, table=self.table_name,
+ page_iterator_class=TableEntityPropertiesPaged
+ )
+
+ @distributed_trace
+ def query_entities(
+ self,
+ filter, # type: str # pylint: disable = W0622
+ **kwargs
+ ):
+ # type: (...) -> AsyncItemPaged[TableEntity]
+ """Lists entities in a table.
+
+ :param str filter: Specify a filter to return certain entities
+ :keyword int results_per_page: Number of entities per page in return ItemPaged
+ :keyword Union[str, list[str]] select: Specify desired properties of an entity to return certain entities
+ :keyword dict parameters: Dictionary for formatting query with additional, user defined parameters
+ :return: Query of table entities
+ :rtype: ItemPaged[TableEntity]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ parameters = kwargs.pop('parameters', None)
+ filter = self._parameter_filter_substitution(parameters, filter) # pylint: disable = W0622
+
+ user_select = kwargs.pop('select', None)
+ if user_select and not isinstance(user_select, str):
+ user_select = ", ".join(user_select)
+
+ query_options = QueryOptions(top=kwargs.pop('results_per_page', None), select=user_select,
+ filter=filter)
+
+ command = functools.partial(
+ self._client.table.query_entities,
+ query_options=query_options,
+ **kwargs)
+ return AsyncItemPaged(
+ command, table=self.table_name,
+ page_iterator_class=TableEntityPropertiesPaged
+ )
+
+ @distributed_trace_async
+ async def get_entity(
+ self,
+ partition_key, # type: str
+ row_key, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> TableEntity
+ """Queries entities in a table.
+ :param partition_key: The partition key of the entity.
+ :type partition_key: str
+ :param row_key: The row key of the entity.
+ :type row_key: str
+ :return: TableEntity mapping str to azure.data.tables.EntityProperty
+ :rtype: ~azure.data.tables.TableEntity
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ try:
+ entity = await self._client.table.query_entities_with_partition_and_row_key(table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ **kwargs)
+ properties = _convert_to_entity(entity.additional_properties)
+ return properties
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def upsert_entity(
+ self,
+ entity, # type: Union[TableEntity, dict[str,str]]
+ mode=UpdateMode.MERGE, # type: UpdateMode
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+
+ """Update/Merge or Insert entity into table.
+ :param mode: Merge or Replace and Insert on fail
+ :type mode: ~azure.data.tables.UpdateMode
+ :param entity: The properties for the table entity.
+ :type entity: dict[str, str]
+ :return: Entity mapping str to azure.data.tables.EntityProperty or None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+
+ partition_key = entity['PartitionKey']
+ row_key = entity['RowKey']
+ entity = _add_entity_properties(entity)
+
+ try:
+ if mode is UpdateMode.MERGE:
+ await self._client.table.merge_entity(
+ table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ table_entity_properties=entity,
+ **kwargs
+ )
+ elif mode is UpdateMode.REPLACE:
+ await self._client.table.update_entity(
+ table=self.table_name,
+ partition_key=partition_key,
+ row_key=row_key,
+ table_entity_properties=entity,
+ **kwargs)
+ else:
+ raise ValueError('Mode type is not supported')
+ except ResourceNotFoundError:
+ await self.create_entity(
+ partition_key=partition_key,
+ row_key=row_key,
+ table_entity_properties=entity,
+ **kwargs
+ )
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py
new file mode 100644
index 000000000000..7c58d21a8a94
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py
@@ -0,0 +1,293 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import functools
+from typing import (
+ Union,
+ Optional,
+ Any,
+)
+
+from azure.core.async_paging import AsyncItemPaged
+from azure.core.exceptions import HttpResponseError
+from azure.core.pipeline import AsyncPipeline
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.data.tables import VERSION, LocationMode
+from azure.data.tables._generated.aio._azure_table_async import AzureTable
+from azure.data.tables._generated.models import TableServiceProperties, TableProperties, QueryOptions
+from azure.data.tables._models import service_stats_deserialize, service_properties_deserialize
+from azure.data.tables._shared.base_client_async import AsyncStorageAccountHostsMixin, AsyncTransportWrapper
+from azure.data.tables._shared.policies_async import ExponentialRetry
+from azure.data.tables._shared.response_handlers import process_table_error
+from azure.data.tables.aio._table_client_async import TableClient
+from ._models import TablePropertiesPaged
+from .._shared._error import _validate_table_name
+from .._shared._table_service_client_base import TableServiceClientBase
+from .._models import Table
+
+
+class TableServiceClient(AsyncStorageAccountHostsMixin, TableServiceClientBase):
+ """A client to interact with the Table Service at the account level.
+
+ This client provides operations to retrieve and configure the account properties
+ as well as list, create and delete tables within the account.
+ For operations relating to a specific queue, a client for this entity
+ can be retrieved using the :func:`~get_table_client` function.
+
+ :param str account_url:
+ The URL to the table service endpoint. Any other entities included
+ in the URL path (e.g. queue) will be discarded. This URL can be optionally
+ authenticated with a SAS token.
+ :param str credential:
+ The credentials with which to authenticate. This is optional if the
+ account URL already has a SAS token. The value can be a SAS token string, an account
+ shared access key.
+ :keyword str api_version:
+ The Storage API version to use for requests. Default value is '2019-07-07'.
+ Setting to an older version may result in reduced feature compatibility.
+ :keyword str secondary_hostname:
+ The hostname of the secondary endpoint.
+
+ .. admonition:: Example:
+
+ .. literalinclude:: ../samples/table_samples_authentication_async.py
+ :start-after: [START async_create_table_service_client]
+ :end-before: [END async_create_table_service_client]
+ :language: python
+ :dedent: 8
+ :caption: Creating the tableServiceClient with an account url and credential.
+
+ .. literalinclude:: ../samples/table_samples_authentication_async.py
+ :start-after: [START async_create_table_service_client_token]
+ :end-before: [END async_create_table_service_client_token]
+ :language: python
+ :dedent: 8
+ :caption: Creating the tableServiceClient with Azure Identity credentials.
+ """
+
+ def __init__(
+ self, account_url, # type: str
+ credential=None, # type: Union[str,TokenCredential]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ kwargs['retry_policy'] = kwargs.get('retry_policy') or ExponentialRetry(**kwargs)
+ loop = kwargs.pop('loop', None)
+ super(TableServiceClient, self).__init__( # type: ignore
+ account_url,
+ service='table',
+ credential=credential,
+ loop=loop,
+ **kwargs)
+ self._client = AzureTable(url=self.url, pipeline=self._pipeline, loop=loop) # type: ignore
+ self._client._config.version = kwargs.get('api_version', VERSION) # pylint: disable=protected-access
+ self._loop = loop
+
+ @distributed_trace_async
+ async def get_service_stats(self, **kwargs):
+ # type: (...) -> dict[str,object]
+ """Retrieves statistics related to replication for the Table service. It is only available on the secondary
+ location endpoint when read-access geo-redundant replication is enabled for the account.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableServiceStats, or the result of cls(response)
+ :rtype: ~azure.data.tables.models.TableServiceStats
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ try:
+ timeout = kwargs.pop('timeout', None)
+ stats = await self._client.service.get_statistics( # type: ignore
+ timeout=timeout, use_location=LocationMode.SECONDARY, **kwargs)
+ return service_stats_deserialize(stats)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def get_service_properties(self, **kwargs):
+ # type: (...) -> dict[str,Any]
+ """Gets the properties of an account's Table service,
+ including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TableServiceProperties, or the result of cls(response)
+ :rtype: ~azure.data.tables.models.TableServiceProperties
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ timeout = kwargs.pop('timeout', None)
+ try:
+ service_props = await self._client.service.get_properties(timeout=timeout, **kwargs) # type: ignore
+ return service_properties_deserialize(service_props)
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def set_service_properties(
+ self,
+ analytics_logging=None, # type: Optional[TableAnalyticsLogging]
+ hour_metrics=None, # type: Optional[Metrics]
+ minute_metrics=None, # type: Optional[Metrics]
+ cors=None, # type: Optional[CorsRule]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Sets properties for an account's Table service endpoint,
+ including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.
+
+ :param analytics_logging: Properties for analytics
+ :type analytics_logging: ~azure.data.tables.TableAnalyticsLogging
+ :param hour_metrics: Hour level metrics
+ :type hour_metrics: ~azure.data.tables.Metrics
+ :param minute_metrics: Minute level metrics
+ :type minute_metrics: ~azure.data.tables.Metrics
+ :param cors: Cross-origin resource sharing rules
+ :type cors: ~azure.data.tables.CorsRule
+ :return: None
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ props = TableServiceProperties(
+ logging=analytics_logging,
+ hour_metrics=hour_metrics,
+ minute_metrics=minute_metrics,
+ cors=cors
+ )
+ try:
+ return await self._client.service.set_properties(props, **kwargs) # type: ignore
+ except HttpResponseError as error:
+ process_table_error(error)
+
+ @distributed_trace_async
+ async def create_table(
+ self,
+ table_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> TableClient
+ """Creates a new table under the given account.
+
+ :param headers:
+ :param table_name: The Table name.
+ :type table_name: ~azure.data.tables._models.Table
+ :return: TableClient, or the result of cls(response)
+ :rtype: ~azure.data.tables.TableClient or None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ _validate_table_name(table_name)
+
+ table_properties = TableProperties(table_name=table_name, **kwargs)
+ await self._client.table.create(table_properties=table_properties, **kwargs)
+ table = self.get_table_client(table=table_name)
+ return table
+
+ @distributed_trace_async
+ async def delete_table(
+ self,
+ table_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Creates a new table under the given account.
+
+ :param table_name: The Table name.
+ :type table_name: str
+ :return: None
+ :rtype: ~None
+ """
+ _validate_table_name(table_name)
+
+ await self._client.table.delete(table=table_name, **kwargs)
+
+ @distributed_trace
+ def list_tables(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> AsyncItemPaged[Table]
+ """Queries tables under the given account.
+
+ :keyword int results_per_page: Number of tables per page in return ItemPaged
+ :keyword Union[str, list(str)] select: Specify desired properties of a table to return certain tables
+ :return: AsyncItemPaged
+ :rtype: ~AsyncItemPaged[Table]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ user_select = kwargs.pop('select', None)
+ if user_select and not isinstance(user_select, str):
+ user_select = ", ".join(user_select)
+
+ query_options = QueryOptions(top=kwargs.pop('results_per_page', None), select=user_select)
+
+ command = functools.partial(
+ self._client.table.query,
+ query_options=query_options,
+ **kwargs)
+ return AsyncItemPaged(
+ command,
+ page_iterator_class=TablePropertiesPaged
+ )
+
+ @distributed_trace
+ def query_tables(
+ self,
+ filter, # pylint: disable=W0622
+ **kwargs # type: Any
+ ):
+ # type: (...) -> AsyncItemPaged[Table]
+ """Queries tables under the given account.
+ :param filter: Specify a filter to return certain tables
+ :type filter: str
+ :keyword int results_per_page: Number of tables per page in return ItemPaged
+ :keyword Union[str, list(str)] select: Specify desired properties of a table to return certain tables
+ :keyword dict parameters: Dictionary for formatting query with additional, user defined parameters
+ :return: A query of tables
+ :rtype: AsyncItemPaged[Table]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ parameters = kwargs.pop('parameters', None)
+ filter = self._parameter_filter_substitution(parameters, filter) # pylint: disable=W0622
+
+ user_select = kwargs.pop('select', None)
+ if user_select and not isinstance(user_select, str):
+ user_select = ", ".join(user_select)
+
+ query_options = QueryOptions(top=kwargs.pop('results_per_page', None), select=user_select,
+ filter=filter)
+ command = functools.partial(self._client.table.query, query_options=query_options,
+ **kwargs)
+ return AsyncItemPaged(
+ command,
+ page_iterator_class=TablePropertiesPaged
+ )
+
+ def get_table_client(self, table, **kwargs):
+ # type: (Union[TableProperties, str], Optional[Any]) -> TableClient
+ """Get a client to interact with the specified table.
+
+ The table need not already exist.
+
+ :param table:
+ The queue. This can either be the name of the queue,
+ or an instance of QueueProperties.
+ :type table: str or ~azure.storage.table.TableProperties
+ :returns: A :class:`~azure.data.tables.TableClient` object.
+ :rtype: ~azure.data.tables.TableClient
+
+ """
+ try:
+ table_name = table.name
+ except AttributeError:
+ table_name = table
+
+ _pipeline = AsyncPipeline(
+ transport=AsyncTransportWrapper(self._pipeline._transport), # pylint: disable = protected-access
+ policies=self._pipeline._impl_policies # pylint: disable = protected-access
+ )
+
+ return TableClient(
+ self.url, table_name=table_name, credential=self.credential,
+ key_resolver_function=self.key_resolver_function, require_encryption=self.require_encryption,
+ key_encryption_key=self.key_encryption_key, api_version=self.api_version, _pipeline=self._pipeline,
+ _configuration=self._config, _location_mode=self._location_mode, _hosts=self._hosts, **kwargs)
diff --git a/sdk/tables/azure-data-tables/azure/data/tables/py.typed b/sdk/tables/azure-data-tables/azure/data/tables/py.typed
new file mode 100644
index 000000000000..e5aff4f83af8
--- /dev/null
+++ b/sdk/tables/azure-data-tables/azure/data/tables/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/sdk/tables/azure-data-tables/dev_requirements.txt b/sdk/tables/azure-data-tables/dev_requirements.txt
new file mode 100644
index 000000000000..5547db3c87f7
--- /dev/null
+++ b/sdk/tables/azure-data-tables/dev_requirements.txt
@@ -0,0 +1,6 @@
+-e ../../../tools/azure-devtools
+-e ../../../tools/azure-sdk-tools
+../../core/azure-core
+cryptography>=2.1.4
+aiohttp>=3.0; python_version >= '3.5'
+
diff --git a/sdk/tables/azure-data-tables/mypy.ini b/sdk/tables/azure-data-tables/mypy.ini
new file mode 100644
index 000000000000..46246be1772d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/mypy.ini
@@ -0,0 +1,13 @@
+[mypy]
+python_version = 3.8
+warn_return_any = True
+warn_unused_configs = True
+ignore_missing_imports = True
+
+# Per-module options:
+
+[mypy-azure-table.azure.data.tables._generated.*]
+ignore_errors = True
+
+[mypy-azure.core.*]
+ignore_errors = True
diff --git a/sdk/tables/azure-data-tables/samples/create_query_entities.py b/sdk/tables/azure-data-tables/samples/create_query_entities.py
new file mode 100644
index 000000000000..7277f7c9e067
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/create_query_entities.py
@@ -0,0 +1,30 @@
+class CreateODataQuery(object):
+ connection_string = "DefaultEndpointsProtocol=https;AccountName=example;AccountKey" \
+ "=fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK==;EndpointSuffix=core.windows.net "
+ account_url = "https://example.table.core.windows.net/"
+ account_name = "example"
+ access_key = "fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK=="
+
+ partition_key = "color"
+ row_key = "brand"
+ # Creating query filter for that table
+ table_name = "Office Supplies"
+ entity_name = "marker"
+ name_filter = "EntityName eq '{}'".format(entity_name)
+
+ def sample_query_entities(self):
+
+ from azure.data.tables import TableClient
+ from azure.core.exceptions import HttpResponseError
+
+ table_client = TableClient(account_url=self.account_url, credential=self.access_key, table_name=self.table_name)
+ try:
+ queried_entities = table_client.query_entities(filter=self.name_filter, select="brand,color")
+
+ # queried_entities type is ItemPaged
+ for entity_chosen in queried_entities:
+ # create a list of the entities and iterate through them to print each one out
+ # calls to the service to get more entities are made without user knowledge
+ print(entity_chosen)
+ except HttpResponseError as e:
+ print(e.message)
diff --git a/sdk/tables/azure-data-tables/samples/creation_deletion_of_table.py b/sdk/tables/azure-data-tables/samples/creation_deletion_of_table.py
new file mode 100644
index 000000000000..e9a614968af4
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/creation_deletion_of_table.py
@@ -0,0 +1,61 @@
+class CreateDeleteTable(object):
+ connection_string = "DefaultEndpointsProtocol=https;AccountName=example;AccountKey=fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK==;EndpointSuffix=core.windows.net"
+ table_name = "OfficeSupplies"
+ account_url = "https://example.table.core.windows.net/"
+ account_name = "example"
+ access_key = "fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK=="
+
+ def shared_key_credential(self):
+ from azure.data.tables import TableServiceClient
+
+ table_service_client = TableServiceClient(account_url=self.account_url, credential=self.access_key)
+
+ def connection_string_auth(self):
+ from azure.data.tables import TableServiceClient
+
+ table_service_client = TableServiceClient.from_connection_string(conn_str=self.connection_string)
+
+ def sas_token_auth(self):
+ from azure.data.tables import TableServiceClient
+ from azure.data.tables._shared.table_shared_access_signature import generate_account_sas
+ from azure.data.tables import ResourceTypes
+ from azure.data.tables import AccountSasPermissions
+ import datetime
+ import timedelta
+
+ token = generate_account_sas(
+ account_name=self.account_name,
+ account_key=self.account_key,
+ resource_types=ResourceTypes(object=True),
+ permission=AccountSasPermissions(read=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+ table_service_client = TableServiceClient(account_url=self.account_url,credential=token)
+
+ def create_table(self):
+ from azure.data.tables import TableServiceClient
+ from azure.core.exceptions import ResourceExistsError
+
+ table_service_client = TableServiceClient(account_url=self.account_url, credential=self.access_key)
+ try:
+ table_created = table_service_client.create_table(table_name=self.table_name)
+ print(table_created.table_name)
+ except ResourceExistsError:
+ print("TableExists")
+
+ def delete_table(self):
+ from azure.data.tables import TableServiceClient
+ from azure.core.exceptions import ResourceNotFoundError
+
+ table_service_client = TableServiceClient(account_url=self.account_url, credential=self.access_key)
+ try:
+ table_service_client.delete_table(table_name=self.table_name)
+ except ResourceNotFoundError:
+ print("TableNotFound")
+
+
+if __name__ == '__main__':
+ sample = CreateDeleteTable()
+ sample.create_table()
+ sample.delete_table()
diff --git a/sdk/tables/azure-data-tables/samples/inserting_deleting_entities.py b/sdk/tables/azure-data-tables/samples/inserting_deleting_entities.py
new file mode 100644
index 000000000000..10c6a35f1453
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/inserting_deleting_entities.py
@@ -0,0 +1,58 @@
+class InsertDeleteEntity(object):
+ connection_string = "DefaultEndpointsProtocol=https;AccountName=example;AccountKey=fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK==;EndpointSuffix=core.windows.net"
+ table_name = "NAME"
+ account_url = "https://example.table.core.windows.net/"
+ account_name = "example"
+ access_key = "fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK=="
+
+ # Assuming there is a created table
+ entity = {
+ 'PartitionKey': 'color',
+ 'RowKey': 'brand',
+ 'text': 'Marker',
+ 'color': 'Purple',
+ 'price': '5'
+ }
+
+ def create_entity(self):
+
+ from azure.data.tables import TableClient
+ from azure.core.exceptions import ResourceExistsError
+
+ table_client = TableClient(account_url=self.account_url, credential=self.access_key, table_name=self.table_name)
+ try:
+ inserted_entity = table_client.create_entity(entity=self.entity)
+ # inserted_entity type is dict[str,object]
+ print(inserted_entity.items()) # print out key-value pair of entity
+ except ResourceExistsError:
+ print("EntityExists")
+
+ def delete_entity(self):
+
+ from azure.data.tables import TableClient
+ from azure.core.exceptions import ResourceNotFoundError
+ from azure.core import MatchConditions
+
+ table_client = TableClient(account_url=self.account_url, credential=self.access_key, table_name=self.table_name)
+
+ # Create entity to delete (to showcase etag)
+ entity_created = table_client.create_entity(entity=self.entity)
+
+ # show without calling metadata, cannot access etag
+ try:
+ entity_created.etag
+ except AttributeError:
+ print("Need to get metadata of entity")
+
+ # In order to access etag as a part of the entity, need to call metadata on the entity
+ metadata = entity_created.metadata()
+
+ # Can now get etag
+ etag = metadata['etag']
+
+ try:
+ # will delete if match_condition and etag are satisfied
+ table_client.delete_entity(entity=self.entity, etag=etag, match_condition=MatchConditions.IfNotModified)
+
+ except ResourceNotFoundError:
+ print("EntityDoesNotExists")
diff --git a/sdk/tables/azure-data-tables/samples/querying_table.py b/sdk/tables/azure-data-tables/samples/querying_table.py
new file mode 100644
index 000000000000..2dd69452b6ec
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/querying_table.py
@@ -0,0 +1,25 @@
+class QueryTable(object):
+ connection_string = "DefaultEndpointsProtocol=https;AccountName=example;AccountKey=fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK==;EndpointSuffix=core.windows.net"
+ table_name = "NAME"
+ account_url = "https://example.table.core.windows.net/"
+ account_name = "example"
+ access_key = "fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK=="
+
+ # Creating query filter for that table
+ table_name = "Office Supplies"
+ name_filter = "TableName eq '{}'".format(table_name)
+
+ def query_tables(self):
+ from azure.data.tables import TableServiceClient
+
+ table_service_client = TableServiceClient(account_url=self.account_url, credential=self.access_key)
+ # Create Tables to query
+ my_table = table_service_client.create_table(table_name=self.table_name)
+ print(my_table)
+ # Query tables
+ queried_tables = table_service_client.query_tables(filter=self.name_filter, results_per_page=10)
+ # table_client.query_tables() returns an itemPaged
+ # queried_tables is a list of filtered tables
+
+ for table in queried_tables:
+ print(table)
diff --git a/sdk/tables/azure-data-tables/samples/table_exists_error_handling.py b/sdk/tables/azure-data-tables/samples/table_exists_error_handling.py
new file mode 100644
index 000000000000..bad368724447
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/table_exists_error_handling.py
@@ -0,0 +1,24 @@
+class TableErrorHandling:
+ connection_string = "DefaultEndpointsProtocol=https;AccountName=example;AccountKey=fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK==;EndpointSuffix=core.windows.net"
+ table_name = "OfficeSupplies"
+ account_url = "https://example.table.core.windows.net/"
+ account_name = "example"
+ access_key = "fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK=="
+
+ def create_table_if_exists(self):
+ from azure.data.tables import TableServiceClient
+ from azure.core.exceptions import ResourceExistsError
+
+ # create table
+ table_service_client = TableServiceClient(account_url=self.account_url, credential=self.access_key)
+ table_service_client.create_table(table_name=self.table_name)
+ try:
+ # try to create existing table, ResourceExistsError will be thrown
+ table_service_client.create_table(table_name=self.table_name)
+ except ResourceExistsError:
+ print("TableExists")
+
+
+if __name__ == '__main__':
+ sample = TableErrorHandling()
+ sample.create_table_if_exists()
\ No newline at end of file
diff --git a/sdk/tables/azure-data-tables/samples/table_samples_authentication.py b/sdk/tables/azure-data-tables/samples/table_samples_authentication.py
new file mode 100644
index 000000000000..8896918b1f59
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/table_samples_authentication.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+"""
+FILE: table_samples_authentication.py
+
+DESCRIPTION:
+ These samples demonstrate authenticating a client via:
+ * connection string
+ * shared access key
+ * generating a sas token with which the returned signature can be used with
+ the credential parameter of any TableServiceClient or TableClient
+
+USAGE:
+ python table_samples_authentication.py
+
+ Set the environment variables with your own values before running the sample:
+ 1) AZURE_STORAGE_CONNECTION_STRING - the connection string to your storage account
+ 2) AZURE_STORAGE_ACCOUNT_URL - the Table service account URL
+ 3) AZURE_STORAGE_ACCOUNT_NAME - the name of the storage account
+ 4) AZURE_STORAGE_ACCESS_KEY - the storage account access key
+"""
+
+
+from datetime import datetime, timedelta
+import os
+
+
+class TableAuthSamples(object):
+
+ connection_string = os.getenv("AZURE_STORAGE_CONNECTION_STRING")
+
+ account_url = os.getenv("AZURE_STORAGE_ACCOUNT_URL")
+ account_name = os.getenv("AZURE_STORAGE_ACCOUNT_NAME")
+ access_key = os.getenv("AZURE_STORAGE_ACCESS_KEY")
+
+ def authentication_by_connection_string(self):
+ # Instantiate a TableServiceClient using a connection string
+ # [START auth_from_connection_string]
+ from azure.data.tables import TableServiceClient
+ table_service = TableServiceClient.from_connection_string(conn_str=self.connection_string)
+ # [END auth_from_connection_string]
+
+ # Get information for the Table Service
+ properties = table_service.get_service_properties()
+
+ def authentication_by_shared_key(self):
+ # Instantiate a TableServiceClient using a shared access key
+ # [START create_Table_service_client]
+ from azure.data.tables import TableServiceClient
+ table_service = TableServiceClient(account_url=self.account_url, credential=self.access_key)
+ # [END create_table_service_client]
+
+ # Get information for the Table Service
+ properties = table_service.get_service_properties()
+
+ def authentication_by_shared_access_signature(self):
+ # Instantiate a TableServiceClient using a connection string
+ from azure.data.tables import TableServiceClient
+ table_service = TableServiceClient.from_connection_string(conn_str=self.connection_string)
+
+ # Create a SAS token to use for authentication of a client
+ from azure.data.tables import generate_account_sas, ResourceTypes, AccountSasPermissions
+
+ sas_token = generate_account_sas(
+ self.account_name,
+ self.access_key,
+ resource_types=ResourceTypes(service=True),
+ permission=AccountSasPermissions(read=True),
+ expiry=datetime.utcnow() + timedelta(hours=1)
+ )
+
+ token_auth_table_service = TableServiceClient(account_url=self.account_url, credential=sas_token)
+
+ # Get information for the Table Service
+ properties = token_auth_table_service.get_service_properties()
+
+
+if __name__ == '__main__':
+ sample = TableAuthSamples()
+ sample.authentication_by_connection_string()
+ sample.authentication_by_shared_key()
+ sample.authentication_by_shared_access_signature()
diff --git a/sdk/tables/azure-data-tables/samples/table_samples_client.py b/sdk/tables/azure-data-tables/samples/table_samples_client.py
new file mode 100644
index 000000000000..cb32c94196d0
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/table_samples_client.py
@@ -0,0 +1,212 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+"""
+FILE: table_samples_client.py
+
+DESCRIPTION:
+ These samples demonstrate the following: creating and setting an access policy to generate a
+ sas token, getting a table client from a table URL, setting and getting table
+ metadata, sending messages and receiving them individually, deleting and
+ clearing all messages, and peeking and updating messages.
+
+USAGE:
+ python table_samples_client.py
+
+ Set the environment variables with your own values before running the sample:
+ 1) AZURE_STORAGE_CONNECTION_STRING - the connection string to your storage account
+"""
+
+from datetime import datetime, timedelta
+import os
+
+
+class TableEntitySamples(object):
+ connection_string = os.getenv("AZURE_STORAGE_CONNECTION_STRING")
+
+ def set_access_policy(self):
+ # [START create_table_client_from_connection_string]
+ from azure.data.tables import TableClient
+ table = TableClient.from_connection_string(self.connection_string, table_name="mytable1")
+ # [END create_table_client_from_connection_string]
+
+ # Create the Table
+ table.create_table()
+
+ try:
+ # [START set_access_policy]
+ # Create an access policy
+ from azure.data.tables import AccessPolicy, TableSasPermissions
+ access_policy = AccessPolicy()
+ access_policy.start = datetime.utcnow() - timedelta(hours=1)
+ access_policy.expiry = datetime.utcnow() + timedelta(hours=1)
+ access_policy.permission = TableSasPermissions(add=True)
+ identifiers = {'my-access-policy-id': access_policy}
+
+ # Set the access policy
+ table.set_table_access_policy(identifiers)
+ # [END set_access_policy]
+
+ # Use the access policy to generate a SAS token
+ # [START table_client_sas_token]
+ from azure.data.tables import generate_table_sas
+ sas_token = generate_table_sas(
+ table.account_name,
+ table.table_name,
+ table.credential.account_key,
+ policy_id='my-access-policy-id'
+ )
+ # [END table_client_sas_token]
+
+ # Authenticate with the sas token
+ # [START create_table_client]
+ # token_auth_table = table.from_table_url(
+ # table_url=table.url,
+ # credential=sas_token
+ # )
+ # [END create_table_client]
+
+ finally:
+ # Delete the table
+ table.delete_table()
+
+ def create_and_get_entities(self):
+ # Instantiate a table service client
+ from azure.data.tables import TableClient
+ table = TableClient.from_connection_string(self.connection_string, table_name="mytable3")
+
+ # Create the Table
+ table.create_table()
+
+ my_entity = {
+ 'PartitionKey': 'color',
+ 'RowKey': 'crayola',
+ 'text': 'Marker',
+ 'color': 'Purple',
+ 'price': '5'
+ }
+ try:
+ # [START create_entity]
+ created_entity = table.create_entity(table_entity_properties=my_entity)
+ print(created_entity)
+ # [END create_entity]
+
+ # [START get_entity]
+ # Get Entity by partition and row key
+ got_entity = table.get_entity(partition_key=my_entity['PartitionKey'],
+ row_key=my_entity['RowKey'])
+ print(got_entity)
+ # [END get_entity]
+
+ finally:
+ # Delete the table
+ table.delete_table()
+
+ def query_entities(self):
+ # Instantiate a table service client
+ from azure.data.tables import TableClient
+ table = TableClient.from_connection_string(self.connection_string, table_name="mytable4")
+
+ # Create the table
+ table.create_table()
+
+ entity = {'PartitionKey': 'color2', 'RowKey': 'sharpie', 'text': 'Marker', 'color': 'Purple', 'price': '5'}
+ entity1 = {'PartitionKey': 'color2', 'RowKey': 'crayola', 'text': 'Marker', 'color': 'Red', 'price': '3'}
+
+ try:
+ # Create entities
+ table.create_entity(table_entity_properties=entity)
+ table.create_entity(table_entity_properties=entity1)
+ # [START query_entities]
+ # Query the entities in the table
+ entities = list(table.query_entities())
+
+ for e in entities:
+ print(e)
+ # [END query_entities]
+
+ finally:
+ # Delete the table
+ table.delete_table()
+
+ def upsert_entities(self):
+ # Instantiate a table service client
+ from azure.data.tables import TableClient, UpdateMode
+ table = TableClient.from_connection_string(self.connection_string, table_name="mytable5")
+
+ # Create the table
+ table.create_table()
+
+ entity = {'PartitionKey': 'color', 'RowKey': 'sharpie', 'text': 'Marker', 'color': 'Purple', 'price': '5'}
+ entity1 = {'PartitionKey': 'color', 'RowKey': 'crayola', 'text': 'Marker', 'color': 'Red', 'price': '3'}
+
+ try:
+ # Create entities
+ created = table.create_entity(table_entity_properties=entity)
+
+ # [START upsert_entity]
+ # Try Replace and then Insert on Fail
+ insert_entity = table.upsert_entity(mode=UpdateMode.replace, table_entity_properties=entity1)
+ print(insert_entity)
+
+ # Try merge, and merge since already in table
+ created.text = "NewMarker"
+ merged_entity = table.upsert_entity(mode=UpdateMode.MERGE, table_entity_properties=entity)
+ print(merged_entity)
+ # [END upsert_entity]
+
+ finally:
+ # Delete the table
+ table.delete_table()
+
+ def update_entities(self):
+ # Instantiate a table service client
+ from azure.data.tables import TableClient, UpdateMode
+ table = TableClient.from_connection_string(self.connection_string, table_name="mytable6")
+
+ # Create the table and Table Client
+ table.create_table()
+
+ entity = {'PartitionKey': 'color', 'RowKey': 'sharpie', 'text': 'Marker', 'color': 'Purple', 'price': '5'}
+
+ try:
+ # Create entity
+ created = table.create_entity(table_entity_properties=entity)
+
+ # [START update_entity]
+ # Update the entity
+ created.text = "NewMarker"
+ table.update_entity(mode=UpdateMode.replace, table_entity_properties=created)
+
+ # Get the replaced entity
+ replaced = table.get_entity(
+ partition_key=created.PartitionKey, row_key=created.RowKey)
+ print(replaced)
+
+ # Merge the entity
+ replaced.color = "Blue"
+ table.update_entity(mode=UpdateMode.MERGE, table_entity_properties=replaced)
+
+ # Get the merged entity
+ merged = table.get_entity(
+ partition_key=replaced.PartitionKey, row_key=replaced.RowKey)
+ print(merged)
+ # [END update_entity]
+
+ finally:
+ # Delete the table
+ table.delete_table()
+
+
+if __name__ == '__main__':
+ sample = TableEntitySamples()
+ sample.set_access_policy()
+ sample.create_and_get_entities()
+ sample.query_entities()
+ sample.upsert_entities()
+ sample.update_entities()
diff --git a/sdk/tables/azure-data-tables/samples/table_samples_service.py b/sdk/tables/azure-data-tables/samples/table_samples_service.py
new file mode 100644
index 000000000000..eaf2bae86d9d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/table_samples_service.py
@@ -0,0 +1,114 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+"""
+FILE: table_samples_service.py
+
+DESCRIPTION:
+ These samples demonstrate the following: setting and getting table service properties,
+ listing the tables in the service, and getting a TableClient from a TableServiceClient.
+
+USAGE:
+ python table_samples_service.py
+
+ Set the environment variables with your own values before running the sample:
+ 1) AZURE_STORAGE_CONNECTION_STRING - the connection string to your storage account
+"""
+
+import os
+
+
+class TableServiceSamples(object):
+ connection_string = os.getenv("AZURE_STORAGE_CONNECTION_STRING")
+
+ def table_service_properties(self):
+ # Instantiate the TableServiceClient from a connection string
+ from azure.data.tables import TableServiceClient
+ table_service = TableServiceClient.from_connection_string(conn_str=self.connection_string)
+
+ # [START set_table_service_properties]
+ # Create service properties
+ from azure.data.tables import TableAnalyticsLogging, Metrics, CorsRule, RetentionPolicy
+
+ # Create logging settings
+ logging = TableAnalyticsLogging(read=True, write=True, delete=True,
+ retention_policy=RetentionPolicy(enabled=True, days=5))
+
+ # Create metrics for requests statistics
+ hour_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True, days=5))
+ minute_metrics = Metrics(enabled=True, include_apis=True,
+ retention_policy=RetentionPolicy(enabled=True, days=5))
+
+ # Create CORS rules
+ cors_rule1 = CorsRule(['www.xyz.com'], ['GET'])
+ allowed_origins = ['www.xyz.com', "www.ab.com", "www.bc.com"]
+ allowed_methods = ['GET', 'PUT']
+ max_age_in_seconds = 500
+ exposed_headers = ["x-ms-meta-data*", "x-ms-meta-source*", "x-ms-meta-abc", "x-ms-meta-bcd"]
+ allowed_headers = ["x-ms-meta-data*", "x-ms-meta-target*", "x-ms-meta-xyz", "x-ms-meta-foo"]
+ cors_rule2 = CorsRule(
+ allowed_origins,
+ allowed_methods,
+ max_age_in_seconds=max_age_in_seconds,
+ exposed_headers=exposed_headers,
+ allowed_headers=allowed_headers
+ )
+
+ cors = [cors_rule1, cors_rule2]
+
+ # Set the service properties
+ table_service.set_service_properties(logging, hour_metrics, minute_metrics, cors)
+ # [END set_table_service_properties]
+
+ # [START get_table_service_properties]
+ properties = table_service.get_service_properties()
+ # [END get_table_service_properties]
+
+ def tables_in_account(self):
+ # Instantiate the TableServiceClient from a connection string
+ from azure.data.tables import TableServiceClient
+ table_service = TableServiceClient.from_connection_string(conn_str=self.connection_string)
+
+ # [START tsc_create_table]
+ table_service.create_table("mytable1")
+ # [END tsc_create_table]
+
+ try:
+ # [START tsc_list_tables]
+ # List all the tables in the service
+ list_tables = table_service.query_tables()
+ for table in list_tables:
+ print(table)
+
+ # List the tables in the service that start with the name "my"
+ list_my_tables = table_service.query_tables(select="my")
+ for table in list_my_tables:
+ print(table)
+ # [END tsc_list_tables]
+
+ finally:
+ # [START tsc_delete_table]
+ table_service.delete_table(table_name="mytable1")
+ # [END tsc_delete_table]
+
+ def get_table_client(self):
+ # Instantiate the TableServiceClient from a connection string
+ from azure.data.tables import TableServiceClient, TableClient
+ table_service = TableServiceClient.from_connection_string(conn_str=self.connection_string)
+
+ # [START get_table_client]
+ # Get the table client to interact with a specific table
+ table = table_service.get_table_client(table="mytable2")
+ # [END get_table_client]
+
+
+if __name__ == '__main__':
+ sample = TableServiceSamples()
+ sample.table_service_properties()
+ sample.tables_in_account()
+ sample.get_table_client()
diff --git a/sdk/tables/azure-data-tables/samples/update_entity.py b/sdk/tables/azure-data-tables/samples/update_entity.py
new file mode 100644
index 000000000000..75af124aab9b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/samples/update_entity.py
@@ -0,0 +1,36 @@
+class UpdateEntity(object):
+ connection_string = "DefaultEndpointsProtocol=https;AccountName=example;AccountKey" \
+ "=fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK==;EndpointSuffix=core.windows.net "
+ table_name = "OfficeSupplies"
+ account_url = "https://example.table.core.windows.net/"
+ account_name = "example"
+ access_key = "fasgfbhBDFAShjDQ4jkvbnaBFHJOWS6gkjngdakeKFNLK=="
+
+ # making keys not able to change - SEPARATE
+ entity = {
+ 'PartitionKey': 'color',
+ 'RowKey': 'brand',
+ 'text': 'Marker',
+ 'color': 'Purple',
+ 'price': '5'
+ }
+
+ def update_entity(self):
+ from azure.data.tables import TableClient
+ from azure.core.exceptions import ResourceNotFoundError
+
+ table_client = TableClient(account_url=self.account_url, credential=self.access_key, table_name=self.table_name)
+ try:
+ # defaults to UpdateMode.MERGE
+ table_client.update_entity(entity=self.entity)
+ except ResourceNotFoundError:
+ print("Entity does not exist")
+
+ def upsert_entity(self):
+ from azure.data.tables import TableClient
+ from azure.data.tables._models import UpdateMode
+
+ table_client = TableClient(account_url=self.account_url, credential=self.access_key, table_name=self.table_name)
+
+ table_client.upsert_entity(entity=self.entity, mode=UpdateMode.REPLACE)
+ # no error will be thrown - it will insert
diff --git a/sdk/tables/azure-data-tables/setup.cfg b/sdk/tables/azure-data-tables/setup.cfg
new file mode 100644
index 000000000000..3c6e79cf31da
--- /dev/null
+++ b/sdk/tables/azure-data-tables/setup.cfg
@@ -0,0 +1,2 @@
+[bdist_wheel]
+universal=1
diff --git a/sdk/tables/azure-data-tables/setup.py b/sdk/tables/azure-data-tables/setup.py
new file mode 100644
index 000000000000..9cf68df37c3d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/setup.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+
+#-------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#--------------------------------------------------------------------------
+
+import re
+import os.path
+from io import open
+from setuptools import find_packages, setup # type: ignore
+
+# Change the PACKAGE_NAME only to change folder and different name
+PACKAGE_NAME = "azure-data-tables"
+PACKAGE_PPRINT_NAME = "Azure Data Tables"
+
+# a-b-c => a/b/c
+package_folder_path = PACKAGE_NAME.replace('-', '/')
+# a-b-c => a.b.c
+namespace_name = PACKAGE_NAME.replace('-', '.')
+
+# azure v0.x is not compatible with this package
+# azure v0.x used to have a __version__ attribute (newer versions don't)
+try:
+ import azure
+ try:
+ ver = azure.__version__ # type: ignore
+ raise Exception(
+ 'This package is incompatible with azure=={}. '.format(ver) +
+ 'Uninstall it with "pip uninstall azure".'
+ )
+ except AttributeError:
+ pass
+except ImportError:
+ pass
+
+# Version extraction inspired from 'requests'
+with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd:
+ version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', # type: ignore
+ fd.read(), re.MULTILINE).group(1)
+
+if not version:
+ raise RuntimeError('Cannot find version information')
+
+setup(
+ name=PACKAGE_NAME,
+ version=version,
+ description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME),
+ long_description='\n\n',
+ long_description_content_type='text/markdown',
+ license='MIT License',
+ author='Microsoft Corporation',
+ author_email='ascl@microsoft.com',
+ url='https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/table/azure-table',
+ classifiers=[
+ "Development Status :: 4 - Beta",
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'License :: OSI Approved :: MIT License',
+ ],
+ zip_safe=False,
+ packages=find_packages(exclude=[
+ # Exclude packages that will be covered by PEP420 or nspkg
+ 'azure',
+ 'tests',
+ ]),
+ install_requires=[
+ "azure-core<2.0.0,>=1.2.2",
+ "msrest>=0.6.10"
+ # azure-data-tables
+ ],
+ extras_require={
+ ":python_version<'3.0'": ['futures'],
+ ":python_version<'3.4'": ['enum34>=1.0.4'],
+ ":python_version<'3.5'": ["typing"]
+ },
+)
diff --git a/sdk/tables/azure-data-tables/tests/_shared/__init__.py b/sdk/tables/azure-data-tables/tests/_shared/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/sdk/tables/azure-data-tables/tests/_shared/asynctestcase.py b/sdk/tables/azure-data-tables/tests/_shared/asynctestcase.py
new file mode 100644
index 000000000000..b23fb1974198
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/_shared/asynctestcase.py
@@ -0,0 +1,56 @@
+
+# coding: utf-8
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import asyncio
+import functools
+
+from azure_devtools.scenario_tests.utilities import trim_kwargs_from_test_function
+
+from azure.core.credentials import AccessToken
+
+from .testcase import TableTestCase
+
+LOGGING_FORMAT = '%(asctime)s %(name)-20s %(levelname)-5s %(message)s'
+
+class AsyncFakeTokenCredential(object):
+ """Protocol for classes able to provide OAuth tokens.
+ :param str scopes: Lets you specify the type of access needed.
+ """
+ def __init__(self):
+ self.token = AccessToken("YOU SHALL NOT PASS", 0)
+
+ async def get_token(self, *args):
+ return self.token
+
+
+class AsyncTableTestCase(TableTestCase):
+ @staticmethod
+ def await_prepared_test(test_fn):
+ """Synchronous wrapper for async test methods. Used to avoid making changes
+ upstream to AbstractPreparer (which doesn't await the functions it wraps)
+ """
+
+ @functools.wraps(test_fn)
+ def run(test_class_instance, *args, **kwargs):
+ trim_kwargs_from_test_function(test_fn, kwargs)
+ loop = asyncio.get_event_loop()
+ return loop.run_until_complete(test_fn(test_class_instance, **kwargs))
+
+ return run
+
+ def generate_oauth_token(self):
+ if self.is_live:
+ from azure.identity.aio import ClientSecretCredential
+ return ClientSecretCredential(
+ self.get_settings_value("TENANT_ID"),
+ self.get_settings_value("CLIENT_ID"),
+ self.get_settings_value("CLIENT_SECRET"),
+ )
+ return self.generate_fake_token()
+
+ def generate_fake_token(self):
+ return AsyncFakeTokenCredential()
diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py
new file mode 100644
index 000000000000..69d43165658d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py
@@ -0,0 +1,442 @@
+# coding: utf-8
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+from __future__ import division
+from contextlib import contextmanager
+import copy
+import inspect
+import os
+import os.path
+import time
+from datetime import datetime, timedelta
+
+from azure.data.tables import ResourceTypes, AccountSasPermissions
+from azure.data.tables._shared.table_shared_access_signature import generate_account_sas
+
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
+
+import zlib
+import math
+import sys
+import string
+import random
+import re
+import logging
+from devtools_testutils import (
+ AzureMgmtTestCase,
+ AzureMgmtPreparer,
+ ResourceGroupPreparer,
+ StorageAccountPreparer,
+ FakeResource,
+)
+from azure_devtools.scenario_tests import RecordingProcessor, AzureTestError, create_random_name
+try:
+ from cStringIO import StringIO # Python 2
+except ImportError:
+ from io import StringIO
+
+from azure.core.credentials import AccessToken
+#from azure.data.tabless import generate_account_sas, AccountSasPermissions, ResourceTypes
+from azure.mgmt.storage.models import StorageAccount, Endpoints
+
+try:
+ from devtools_testutils import mgmt_settings_real as settings
+except ImportError:
+ from devtools_testutils import mgmt_settings_fake as settings
+
+import pytest
+
+
+LOGGING_FORMAT = '%(asctime)s %(name)-20s %(levelname)-5s %(message)s'
+
+class FakeTokenCredential(object):
+ """Protocol for classes able to provide OAuth tokens.
+ :param str scopes: Lets you specify the type of access needed.
+ """
+ def __init__(self):
+ self.token = AccessToken("YOU SHALL NOT PASS", 0)
+
+ def get_token(self, *args):
+ return self.token
+
+
+class XMSRequestIDBody(RecordingProcessor):
+ """This process is used for Storage batch call only, to avoid the echo policy.
+ """
+ def process_response(self, response):
+ content_type = None
+ for key, value in response.get('headers', {}).items():
+ if key.lower() == 'content-type':
+ content_type = (value[0] if isinstance(value, list) else value).lower()
+ break
+
+ if content_type and 'multipart/mixed' in content_type:
+ response['body']['string'] = re.sub(b"x-ms-client-request-id: [a-f0-9-]+\r\n", b"", response['body']['string'])
+
+ return response
+
+
+class GlobalStorageAccountPreparer(AzureMgmtPreparer):
+ def __init__(self):
+ super(GlobalStorageAccountPreparer, self).__init__(
+ name_prefix='',
+ random_name_length=42
+ )
+
+ def create_resource(self, name, **kwargs):
+ storage_account = TableTestCase._STORAGE_ACCOUNT
+ if self.is_live:
+ self.test_class_instance.scrubber.register_name_pair(
+ storage_account.name,
+ "storagename"
+ )
+ else:
+ name = "storagename"
+ storage_account.name = name
+ storage_account.primary_endpoints.table = 'https://{}.{}.core.windows.net'.format(name, 'table')
+
+ return {
+ 'location': 'westus',
+ 'resource_group': TableTestCase._RESOURCE_GROUP,
+ 'storage_account': storage_account,
+ 'storage_account_key': TableTestCase._STORAGE_KEY,
+ 'storage_account_cs': TableTestCase._STORAGE_CONNECTION_STRING,
+ }
+
+class GlobalResourceGroupPreparer(AzureMgmtPreparer):
+ def __init__(self):
+ super(GlobalResourceGroupPreparer, self).__init__(
+ name_prefix='',
+ random_name_length=42
+ )
+
+ def create_resource(self, name, **kwargs):
+ rg = TableTestCase._RESOURCE_GROUP
+ if self.is_live:
+ self.test_class_instance.scrubber.register_name_pair(
+ rg.name,
+ "rgname"
+ )
+ else:
+ rg = FakeResource(
+ name="rgname",
+ id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname"
+ )
+
+ return {
+ 'location': 'westus',
+ 'resource_group': rg,
+ }
+
+
+class TableTestCase(AzureMgmtTestCase):
+
+ def __init__(self, *args, **kwargs):
+ super(TableTestCase, self).__init__(*args, **kwargs)
+ self.replay_processors.append(XMSRequestIDBody())
+
+ def connection_string(self, account, key):
+ return "DefaultEndpointsProtocol=https;AccountName=" + account.name + ";AccountKey=" + str(key) + ";EndpointSuffix=core.windows.net"
+
+ def account_url(self, account, endpoint_type):
+ """Return an url of storage account.
+
+ :param str storage_account: Storage account name
+ :param str storage_type: The Storage type part of the URL. Should be "blob", or "queue", etc.
+ """
+ try:
+ if endpoint_type == "table":
+ return account.primary_endpoints.table.rstrip("/")
+ if endpoint_type == "cosmos":
+ return "https://{}.table.cosmos.azure.com".format(account.name)
+ else:
+ raise ValueError("Unknown storage type {}".format(storage_type))
+ except AttributeError: # Didn't find "primary_endpoints"
+ return 'https://{}.{}.core.windows.net'.format(account, endpoint_type)
+
+ def configure_logging(self):
+ try:
+ enable_logging = self.get_settings_value("ENABLE_LOGGING")
+ except AzureTestError:
+ enable_logging = True # That's the default value in fake settings
+
+ self.enable_logging() if enable_logging else self.disable_logging()
+
+ def enable_logging(self):
+ handler = logging.StreamHandler()
+ handler.setFormatter(logging.Formatter(LOGGING_FORMAT))
+ self.logger.handlers = [handler]
+ self.logger.setLevel(logging.INFO)
+ self.logger.propagate = True
+ self.logger.disabled = False
+
+ def disable_logging(self):
+ self.logger.propagate = False
+ self.logger.disabled = True
+ self.logger.handlers = []
+
+ def sleep(self, seconds):
+ if self.is_live:
+ time.sleep(seconds)
+
+ def get_random_bytes(self, size):
+ # recordings don't like random stuff. making this more
+ # deterministic.
+ return b'a'*size
+
+ def get_random_text_data(self, size):
+ '''Returns random unicode text data exceeding the size threshold for
+ chunking blob upload.'''
+ checksum = zlib.adler32(self.qualified_test_name.encode()) & 0xffffffff
+ rand = random.Random(checksum)
+ text = u''
+ words = [u'hello', u'world', u'python', u'啊齄丂狛狜']
+ while (len(text) < size):
+ index = int(rand.random()*(len(words) - 1))
+ text = text + u' ' + words[index]
+
+ return text
+
+ @staticmethod
+ def _set_test_proxy(service, settings):
+ if settings.USE_PROXY:
+ service.set_proxy(
+ settings.PROXY_HOST,
+ settings.PROXY_PORT,
+ settings.PROXY_USER,
+ settings.PROXY_PASSWORD,
+ )
+
+ def assertNamedItemInContainer(self, container, item_name, msg=None):
+ def _is_string(obj):
+ if sys.version_info >= (3,):
+ return isinstance(obj, str)
+ else:
+ return isinstance(obj, basestring)
+ for item in container:
+ if _is_string(item):
+ if item == item_name:
+ return
+ elif item.name == item_name:
+ return
+ elif hasattr(item, 'snapshot') and item.snapshot == item_name:
+ return
+
+
+ standardMsg = '{0} not found in {1}'.format(
+ repr(item_name), [str(c) for c in container])
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def assertNamedItemNotInContainer(self, container, item_name, msg=None):
+ for item in container:
+ if item.name == item_name:
+ standardMsg = '{0} unexpectedly found in {1}'.format(
+ repr(item_name), repr(container))
+ self.fail(self._formatMessage(msg, standardMsg))
+
+ def generate_oauth_token(self):
+ if self.is_live:
+ from azure.identity import ClientSecretCredential
+ return ClientSecretCredential(
+ self.get_settings_value("TENANT_ID"),
+ self.get_settings_value("CLIENT_ID"),
+ self.get_settings_value("CLIENT_SECRET"),
+ )
+ return self.generate_fake_token()
+
+ def generate_sas_token(self):
+ fake_key = 'a'*30 + 'b'*30
+
+ return '?' + generate_account_sas(
+ account_name = 'test', # name of the storage account
+ account_key = fake_key, # key for the storage account
+ resource_types = ResourceTypes(object=True),
+ permission = AccountSasPermissions(read=True,list=True),
+ start = datetime.now() - timedelta(hours = 24),
+ expiry = datetime.now() + timedelta(days = 8)
+ )
+
+ def generate_fake_token(self):
+ return FakeTokenCredential()
+
+
+def not_for_emulator(test):
+ def skip_test_if_targeting_emulator(self):
+ test(self)
+ return skip_test_if_targeting_emulator
+
+
+class RetryCounter(object):
+ def __init__(self):
+ self.count = 0
+
+ def simple_count(self, retry_context):
+ self.count += 1
+
+
+class ResponseCallback(object):
+ def __init__(self, status=None, new_status=None):
+ self.status = status
+ self.new_status = new_status
+ self.first = True
+ self.count = 0
+
+ def override_first_status(self, response):
+ if self.first and response.http_response.status_code == self.status:
+ response.http_response.status_code = self.new_status
+ self.first = False
+ self.count += 1
+
+ def override_status(self, response):
+ if response.http_response.status_code == self.status:
+ response.http_response.status_code = self.new_status
+ self.count += 1
+
+
+class LogCaptured(object):
+ def __init__(self, test_case=None):
+ # accept the test case so that we may reset logging after capturing logs
+ self.test_case = test_case
+
+ def __enter__(self):
+ # enable logging
+ # it is possible that the global logging flag is turned off
+ self.test_case.enable_logging()
+
+ # create a string stream to send the logs to
+ self.log_stream = StringIO()
+
+ # the handler needs to be stored so that we can remove it later
+ self.handler = logging.StreamHandler(self.log_stream)
+ self.handler.setFormatter(logging.Formatter(LOGGING_FORMAT))
+
+ # get and enable the logger to send the outputs to the string stream
+ self.logger = logging.getLogger('azure.storage')
+ self.logger.level = logging.DEBUG
+ self.logger.addHandler(self.handler)
+
+ # the stream is returned to the user so that the capture logs can be retrieved
+ return self.log_stream
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ # stop the handler, and close the stream to exit
+ self.logger.removeHandler(self.handler)
+ self.log_stream.close()
+
+ # reset logging since we messed with the setting
+ self.test_case.configure_logging()
+
+
+@pytest.fixture(scope="session")
+def storage_account():
+ test_case = AzureMgmtTestCase("__init__")
+ rg_preparer = ResourceGroupPreparer(random_name_enabled=True, name_prefix='pystorage')
+ storage_preparer = StorageAccountPreparer(random_name_enabled=True, name_prefix='pyacrstorage')
+
+ # Create
+ subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", None)
+ location = os.environ.get("AZURE_LOCATION", "westus")
+
+ existing_rg_name = os.environ.get("AZURE_RESOURCEGROUP_NAME")
+ existing_storage_name = os.environ.get("AZURE_STORAGE_ACCOUNT_NAME")
+ existing_storage_key = os.environ.get("AZURE_STORAGE_ACCOUNT_KEY")
+ storage_connection_string = os.environ.get("AZURE_STORAGE_CONNECTION_STRING")
+
+ i_need_to_create_rg = not (existing_rg_name or existing_storage_name or storage_connection_string)
+ got_storage_info_from_env = existing_storage_name or storage_connection_string
+
+ try:
+ if i_need_to_create_rg:
+ rg_name, rg_kwargs = rg_preparer._prepare_create_resource(test_case)
+ rg = rg_kwargs['resource_group']
+ else:
+ rg_name = existing_rg_name or "no_rg_needed"
+ rg = FakeResource(
+ name=rg_name,
+ id="/subscriptions/{}/resourceGroups/{}".format(subscription_id, rg_name)
+ )
+ TableTestCase._RESOURCE_GROUP = rg
+
+ try:
+ if got_storage_info_from_env:
+
+ if storage_connection_string:
+ storage_connection_string_parts = dict([
+ part.split('=', 1)
+ for part in storage_connection_string.split(";")
+ ])
+
+ storage_account = None
+ if existing_storage_name:
+ storage_name = existing_storage_name
+ storage_account = StorageAccount(
+ location=location,
+ )
+ storage_account.name = storage_name
+ storage_account.id = storage_name
+ storage_account.primary_endpoints=Endpoints()
+ storage_account.primary_endpoints.table = 'https://{}.{}.core.windows.net'.format(storage_name, 'table')
+ storage_key = existing_storage_key
+
+ if not storage_connection_string:
+ # It means I have received a storage name from env
+ storage_connection_string=";".join([
+ "DefaultEndpointsProtocol=https",
+ "AccountName={}".format(storage_name),
+ "AccountKey={}".format(storage_key),
+ "TableEndpoint={}".format(storage_account.primary_endpoints.table),
+ ])
+
+ if not storage_account:
+ # It means I have received a connection string
+ storage_name = storage_connection_string_parts["AccountName"]
+ storage_account = StorageAccount(
+ location=location,
+ )
+
+ def build_service_endpoint(service):
+ try:
+ suffix = storage_connection_string_parts["EndpointSuffix"]
+ except KeyError:
+ suffix = "cosmos.azure.com"
+ return "{}://{}.{}.{}".format(
+ storage_connection_string_parts.get("DefaultEndpointsProtocol", "https"),
+ storage_connection_string_parts["AccountName"],
+ service,
+ suffix
+ )
+
+ storage_account.name = storage_name
+ storage_account.id = storage_name
+ storage_account.primary_endpoints=Endpoints()
+ storage_account.primary_endpoints.table = storage_connection_string_parts.get("TableEndpoint", build_service_endpoint("table"))
+ storage_account.secondary_endpoints=Endpoints()
+ storage_account.secondary_endpoints.table = storage_connection_string_parts.get("TableSecondaryEndpoint", build_service_endpoint("table"))
+ storage_key = storage_connection_string_parts["AccountKey"]
+
+ else:
+ storage_name, storage_kwargs = storage_preparer._prepare_create_resource(test_case, **rg_kwargs)
+ storage_account = storage_kwargs['storage_account']
+ storage_key = storage_kwargs['storage_account_key']
+ storage_connection_string = storage_kwargs['storage_account_cs']
+
+ TableTestCase._STORAGE_ACCOUNT = storage_account
+ TableTestCase._STORAGE_KEY = storage_key
+ TableTestCase._STORAGE_CONNECTION_STRING = storage_connection_string
+ yield
+ finally:
+ if not got_storage_info_from_env:
+ storage_preparer.remove_resource(
+ storage_name,
+ resource_group=rg
+ )
+ finally:
+ if i_need_to_create_rg:
+ rg_preparer.remove_resource(rg_name)
+ TableTestCase._RESOURCE_GROUP = None
diff --git a/sdk/tables/azure-data-tables/tests/conftest.py b/sdk/tables/azure-data-tables/tests/conftest.py
new file mode 100644
index 000000000000..b73f2c91f9b2
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/conftest.py
@@ -0,0 +1,40 @@
+# --------------------------------------------------------------------------
+#
+# Copyright (c) Microsoft Corporation. All rights reserved.
+#
+# The MIT License (MIT)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the ""Software""), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+# --------------------------------------------------------------------------
+import sys
+
+# fixture needs to be visible from conftest
+from _shared.testcase import storage_account
+
+# Ignore async tests for Python < 3.5
+collect_ignore_glob = []
+if sys.version_info < (3, 5):
+ collect_ignore_glob.append("*_async.py")
+
+def pytest_configure(config):
+ # register an additional marker
+ config.addinivalue_line(
+ "usefixtures", "storage_account"
+ )
diff --git a/sdk/tables/azure-data-tables/tests/encryption_test_helper.py b/sdk/tables/azure-data-tables/tests/encryption_test_helper.py
new file mode 100644
index 000000000000..e1e9f5439ec3
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/encryption_test_helper.py
@@ -0,0 +1,90 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+# from cryptography.hazmat.backends import default_backend
+# from cryptography.hazmat.primitives.asymmetric.padding import (
+# OAEP,
+# MGF1,
+# )
+# from cryptography.hazmat.primitives.asymmetric.rsa import generate_private_key
+# from cryptography.hazmat.primitives.hashes import SHA1
+# from cryptography.hazmat.primitives.keywrap import (
+# aes_key_wrap,
+# aes_key_unwrap,
+# )
+
+
+# class KeyWrapper:
+# def __init__(self, kid='local:key1'):
+# # Must have constant key value for recorded tests, otherwise we could use a random generator.
+# self.kek = b'\xbe\xa4\x11K\x9eJ\x07\xdafF\x83\xad+\xadvA C\xe8\xbc\x90\xa4\x11}G\xc3\x0f\xd4\xb4\x19m\x11'
+# self.backend = default_backend()
+# self.kid = kid
+#
+# def wrap_key(self, key, algorithm='A256KW'):
+# if algorithm == 'A256KW':
+# return aes_key_wrap(self.kek, key, self.backend)
+#
+# raise ValueError(_ERROR_UNKNOWN_KEY_WRAP_ALGORITHM)
+#
+# def unwrap_key(self, key, algorithm):
+# if algorithm == 'A256KW':
+# return aes_key_unwrap(self.kek, key, self.backend)
+#
+# raise ValueError(_ERROR_UNKNOWN_KEY_WRAP_ALGORITHM)
+#
+# def get_key_wrap_algorithm(self):
+# return 'A256KW'
+#
+# def get_kid(self):
+# return self.kid
+#
+#
+# class KeyResolver:
+# def __init__(self):
+# self.keys = {}
+#
+# def put_key(self, key):
+# self.keys[key.get_kid()] = key
+#
+# def resolve_key(self, kid):
+# return self.keys[kid]
+#
+#
+# class RSAKeyWrapper:
+# def __init__(self, kid='local:key2'):
+# self.private_key = generate_private_key(public_exponent=65537,
+# key_size=2048,
+# backend=default_backend())
+# self.public_key = self.private_key.public_key()
+# self.kid = kid
+#
+# def wrap_key(self, key, algorithm='RSA'):
+# if algorithm == 'RSA':
+# return self.public_key.encrypt(key,
+# OAEP(
+# mgf=MGF1(algorithm=SHA1()),
+# algorithm=SHA1(),
+# label=None)
+# )
+#
+# raise ValueError(_ERROR_UNKNOWN_KEY_WRAP_ALGORITHM)
+#
+# def unwrap_key(self, key, algorithm):
+# if algorithm == 'RSA':
+# return self.private_key.decrypt(key,
+# OAEP(
+# mgf=MGF1(algorithm=SHA1()),
+# algorithm=SHA1(),
+# label=None)
+# )
+#
+# raise ValueError(_ERROR_UNKNOWN_KEY_WRAP_ALGORITHM)
+#
+# def get_key_wrap_algorithm(self):
+# return 'RSA'
+#
+# def get_kid(self):
+# return self.kid
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_account_sas.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_account_sas.yaml
new file mode 100644
index 000000000000..741501bf67f0
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_account_sas.yaml
@@ -0,0 +1,224 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesync99dc0b08"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesync99dc0b08"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:14 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesync99dc0b08')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "test", "RowKey": "test1", "text": "hello"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '60'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/pytablesync99dc0b08(PartitionKey='test',RowKey='test1')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:14 GMT
+ etag:
+ - W/"datetime'2020-07-30T13%3A30%3A15.8178135Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: '{"PartitionKey": "test", "RowKey": "test2", "text": "hello"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '60'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/pytablesync99dc0b08(PartitionKey='test',RowKey='test2')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:15 GMT
+ etag:
+ - W/"datetime'2020-07-30T13%3A30%3A15.9048723Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/pytablesync99dc0b08()?st=2020-07-30T13%3A29%3A16Z&se=2020-07-30T14%3A30%3A16Z&sp=r&sv=2019-07-07&ss=t&srt=o&sig=0OQL2hilfGTuH%2FU49GkWLVFZf6k3qzZxHLBJae7gShE%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#pytablesync99dc0b08","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A30%3A15.8178135Z''\"","PartitionKey":"test","RowKey":"test1","Timestamp":"2020-07-30T13:30:15.8178135Z","text":"hello"},{"odata.etag":"W/\"datetime''2020-07-30T13%3A30%3A15.9048723Z''\"","PartitionKey":"test","RowKey":"test2","Timestamp":"2020-07-30T13:30:15.9048723Z","text":"hello"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:15 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesync99dc0b08')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:15 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table.yaml
new file mode 100644
index 000000000000..bf152c84c08b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table.yaml
@@ -0,0 +1,90 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesynca4ed0b50"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesynca4ed0b50"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesynca4ed0b50')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesynca4ed0b50')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:16 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table_fail_on_exist.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table_fail_on_exist.yaml
new file mode 100644
index 000000000000..54e63317d03e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_create_table_fail_on_exist.yaml
@@ -0,0 +1,137 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesync6d7c1113"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesync6d7c1113"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesync6d7c1113')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "pytablesync6d7c1113"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.error":{"code":"TableAlreadyExists","message":{"lang":"en-US","value":"The
+ table specified already exists.\nRequestId:aaf65c7a-b002-0055-7875-66bf84000000\nTime:2020-07-30T13:30:17.3141296Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 409
+ message: Conflict
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesync6d7c1113')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_existing_table.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_existing_table.yaml
new file mode 100644
index 000000000000..ce2bcfded581
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_existing_table.yaml
@@ -0,0 +1,90 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesyncded1139b"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesyncded1139b"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesyncded1139b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesyncded1139b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_non_existing_table_fail_not_exist.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_non_existing_table_fail_not_exist.yaml
new file mode 100644
index 000000000000..9459690dfb9c
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_delete_table_with_non_existing_table_fail_not_exist.yaml
@@ -0,0 +1,49 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesynca12c1b7c')
+ response:
+ body:
+ string: 'ResourceNotFound
The specified resource does not exist.
+
+ RequestId:380aef87-1002-0071-4675-6626ca000000
+
+ Time:2020-07-30T13:30:18.2321770Z'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/xml;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:17 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_get_table_acl.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_get_table_acl.yaml
new file mode 100644
index 000000000000..9d61c26b68bf
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_get_table_acl.yaml
@@ -0,0 +1,127 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesyncb07a0bab"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesyncb07a0bab"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesyncb07a0bab')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/pytablesyncb07a0bab?comp=acl
+ response:
+ body:
+ string: "\uFEFF"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesyncb07a0bab')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables.yaml
new file mode 100644
index 000000000000..1eeeb4ad4a2d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables.yaml
@@ -0,0 +1,132 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesync9a730b0b"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesync9a730b0b"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:05 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesync9a730b0b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytablesync9a730b0b"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:05 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesync9a730b0b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Mon, 06 Jul 2020 18:27:05 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_filter.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_filter.yaml
new file mode 100644
index 000000000000..672042849d88
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_filter.yaml
@@ -0,0 +1,132 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesync3f57100b"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesync3f57100b"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:04 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesync3f57100b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$filter=TableName%20eq%20%27pytablesync3f57100b%27
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytablesync3f57100b"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:04 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesync3f57100b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Mon, 06 Jul 2020 18:27:04 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_marker.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_marker.yaml
new file mode 100644
index 000000000000..93bc752e952c
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_marker.yaml
@@ -0,0 +1,282 @@
+interactions:
+- request:
+ body: '{"TableName": "listtable03f561007"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable03f561007"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:05 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable03f561007')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable13f561007"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable13f561007"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable13f561007')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable23f561007"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable23f561007"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable23f561007')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable33f561007"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable33f561007"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable33f561007')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$top=2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable03f561007"},{"TableName":"listtable13f561007"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nexttablename:
+ - 1!48!bGlzdHRhYmxlMjNmNTYxMDA3ATAxZDY1M2MzMGQ5N2M3YTY-
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$top=2&NextTableName=1%2148%21bGlzdHRhYmxlMjNmNTYxMDA3ATAxZDY1M2MzMGQ5N2M3YTY-
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable23f561007"},{"TableName":"listtable33f561007"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nexttablename:
+ - 1!48!cHl0YWJsZXN5bmMzZjU3MTAwYgEwMWQ2NTNjMzBkMTdkMWY2
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_num_results.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_num_results.yaml
new file mode 100644
index 000000000000..06733f6d4453
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_list_tables_with_num_results.yaml
@@ -0,0 +1,280 @@
+interactions:
+- request:
+ body: '{"TableName": "listtable0967e1246"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable0967e1246"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable0967e1246')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable1967e1246"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable1967e1246"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable1967e1246')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable2967e1246"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable2967e1246"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable2967e1246')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable3967e1246"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable3967e1246"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable3967e1246')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable03f561007"},{"TableName":"listtable0967e1246"},{"TableName":"listtable13f561007"},{"TableName":"listtable1967e1246"},{"TableName":"listtable23f561007"},{"TableName":"listtable2967e1246"},{"TableName":"listtable33f561007"},{"TableName":"listtable3967e1246"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 06 Jul 2020 18:27:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$top=3
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable03f561007"},{"TableName":"listtable0967e1246"},{"TableName":"listtable13f561007"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 06 Jul 2020 18:27:06 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nexttablename:
+ - 1!48!bGlzdHRhYmxlMTk2N2UxMjQ2ATAxZDY1M2MzMGUwNWI4YWU-
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables.yaml
new file mode 100644
index 000000000000..f7d5d473f268
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables.yaml
@@ -0,0 +1,132 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesynca68e0b85"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesynca68e0b85"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesynca68e0b85')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytablesynca68e0b85"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:18 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesynca68e0b85')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_filter.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_filter.yaml
new file mode 100644
index 000000000000..d178fe108c18
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_filter.yaml
@@ -0,0 +1,132 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesync512a1085"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesync512a1085"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesync512a1085')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$filter=TableName%20eq%20%27pytablesync512a1085%27
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytablesync512a1085"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesync512a1085')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_marker.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_marker.yaml
new file mode 100644
index 000000000000..357c4ee12762
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_marker.yaml
@@ -0,0 +1,282 @@
+interactions:
+- request:
+ body: '{"TableName": "listtable051291081"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable051291081"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable051291081')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable151291081"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable151291081"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:19 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable151291081')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable251291081"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable251291081"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable251291081')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable351291081"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable351291081"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable351291081')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$top=2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable051291081"},{"TableName":"listtable151291081"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nexttablename:
+ - 1!48!bGlzdHRhYmxlMjUxMjkxMDgxATAxZDY2Njc1OTI0MDk0Yjk-
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$top=2&NextTableName=1%2148%21bGlzdHRhYmxlMjUxMjkxMDgxATAxZDY2Njc1OTI0MDk0Yjk-
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable251291081"},{"TableName":"listtable351291081"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nexttablename:
+ - 1!48!cHl0YWJsZXN5bmM1MTJhMTA4NQEwMWQ2NjY3NTkxY2M2MTAx
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_num_results.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_num_results.yaml
new file mode 100644
index 000000000000..a0f64072a7d6
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_query_tables_with_num_results.yaml
@@ -0,0 +1,280 @@
+interactions:
+- request:
+ body: '{"TableName": "listtable0aab312c0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable0aab312c0"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable0aab312c0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable1aab312c0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable1aab312c0"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable1aab312c0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable2aab312c0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable2aab312c0"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable2aab312c0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "listtable3aab312c0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable3aab312c0"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('listtable3aab312c0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$top=3
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable051291081"},{"TableName":"listtable0aab312c0"},{"TableName":"listtable151291081"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:20 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nexttablename:
+ - 1!48!bGlzdHRhYmxlMWFhYjMxMmMwATAxZDY2Njc1OTJiM2I2Y2M-
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable051291081"},{"TableName":"listtable0aab312c0"},{"TableName":"listtable151291081"},{"TableName":"listtable1aab312c0"},{"TableName":"listtable251291081"},{"TableName":"listtable2aab312c0"},{"TableName":"listtable351291081"},{"TableName":"listtable3aab312c0"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_too_many_ids.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_too_many_ids.yaml
new file mode 100644
index 000000000000..3940f45778b6
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_too_many_ids.yaml
@@ -0,0 +1,90 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesync6f17111b"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesync6f17111b"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesync6f17111b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesync6f17111b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:21 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifier.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifier.yaml
new file mode 100644
index 000000000000..633676e5b817
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifier.yaml
@@ -0,0 +1,166 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesyncb9bd17bb"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 22 Jun 2020 17:01:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 22 Jun 2020 17:01:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesyncb9bd17bb"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 22 Jun 2020 17:01:27 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesyncb9bd17bb')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '
+
+ empty'
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '129'
+ Content-Type:
+ - application/xml
+ Date:
+ - Mon, 22 Jun 2020 17:01:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 22 Jun 2020 17:01:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/pytablesyncb9bd17bb?comp=acl
+ response:
+ body:
+ string: ''
+ headers:
+ content-length:
+ - '0'
+ date:
+ - Mon, 22 Jun 2020 17:01:27 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Mon, 22 Jun 2020 17:01:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 22 Jun 2020 17:01:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/pytablesyncb9bd17bb?comp=acl
+ response:
+ body:
+ string: "\uFEFFempty"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Mon, 22 Jun 2020 17:01:28 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Mon, 22 Jun 2020 17:01:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 22 Jun 2020 17:01:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesyncb9bd17bb')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Mon, 22 Jun 2020 17:01:28 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifiers.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifiers.yaml
new file mode 100644
index 000000000000..f121bda2200b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifiers.yaml
@@ -0,0 +1,165 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesyncd1eb182e"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesyncd1eb182e"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesyncd1eb182e')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Content-Type:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/pytablesyncd1eb182e?comp=acl
+ response:
+ body:
+ string: ''
+ headers:
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/pytablesyncd1eb182e?comp=acl
+ response:
+ body:
+ string: "\uFEFF"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesyncd1eb182e')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:22 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_signed_identifiers.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_signed_identifiers.yaml
new file mode 100644
index 000000000000..7f509ff962ae
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_signed_identifiers.yaml
@@ -0,0 +1,166 @@
+interactions:
+- request:
+ body: '{"TableName": "pytablesync45dd15a0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytablesync45dd15a0"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('pytablesync45dd15a0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '
+
+ testid2020-07-30T13:25:24Z2020-07-30T14:30:24Zr'
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '257'
+ Content-Type:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 13:30:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/pytablesync45dd15a0?comp=acl
+ response:
+ body:
+ string: ''
+ headers:
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Thu, 30 Jul 2020 13:30:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/pytablesync45dd15a0?comp=acl
+ response:
+ body:
+ string: "\uFEFFtestid2020-07-30T13:25:24.0000000Z2020-07-30T14:30:24.0000000Zr"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 13:30:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:30:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytablesync45dd15a0')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 13:30:23 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_account_sas.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_account_sas.yaml
new file mode 100644
index 000000000000..bd44b04c6092
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_account_sas.yaml
@@ -0,0 +1,165 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasynce5ae0d85"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 01 Jul 2020 19:38:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 01 Jul 2020 19:38:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasynce5ae0d85"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Wed, 01 Jul 2020 19:38:14 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasynce5ae0d85')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragewmjulbgag54k.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "test", "RowKey": "test1", "text": "hello"}'
+ headers:
+ Content-Length:
+ - '60'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 01 Jul 2020 19:38:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 01 Jul 2020 19:38:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/pytableasynce5ae0d85(PartitionKey='test',RowKey='test1')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Wed, 01 Jul 2020 19:38:14 GMT
+ etag: W/"datetime'2020-07-01T19%3A38%3A15.4375691Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstoragewmjulbgag54k.table.core.windows.net/pytableasynce5ae0d85(PartitionKey='test',RowKey='test1')
+- request:
+ body: '{"PartitionKey": "test", "RowKey": "test2", "text": "hello"}'
+ headers:
+ Content-Length:
+ - '60'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 01 Jul 2020 19:38:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 01 Jul 2020 19:38:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/pytableasynce5ae0d85(PartitionKey='test',RowKey='test2')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Wed, 01 Jul 2020 19:38:14 GMT
+ etag: W/"datetime'2020-07-01T19%3A38%3A15.5206274Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstoragewmjulbgag54k.table.core.windows.net/pytableasynce5ae0d85(PartitionKey='test',RowKey='test2')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 01 Jul 2020 19:40:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 01 Jul 2020 19:40:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?st=2020-07-01T19:37:16Z&se=2020-07-01T20:38:16Z&sp=l&sv=2019-07-07&ss=t&srt=c&sig=vFStimHCbV6koJEHsdqo3MqWUYRHvwTl4F2pkJ1qdxk%3D
+ response:
+ body:
+ string: '{"odata.error":{"code":"InvalidUri","message":{"lang":"en-US","value":"The
+ requested URI does not represent any resource on the server.\nRequestId:006703ee-6002-0050-4cdf-4f8a05000000\nTime:2020-07-01T19:40:43.4759218Z"}}}'
+ headers:
+ content-length: '222'
+ content-type: application/json
+ date: Wed, 01 Jul 2020 19:40:43 GMT
+ server: Microsoft-HTTPAPI/2.0
+ x-ms-error-code: InvalidUri
+ status:
+ code: 400
+ message: The requested URI does not represent any resource on the server.
+ url: https://pyacrstoragewmjulbgag54k.table.core.windows.net//Tables?st=2020-07-01T19:37:16Z&se=2020-07-01T20:38:16Z&sp=l&sv=2019-07-07&ss=t&srt=c&sig=vFStimHCbV6koJEHsdqo3MqWUYRHvwTl4F2pkJ1qdxk%3D
+- request:
+ body: null
+ headers:
+ Date:
+ - Wed, 01 Jul 2020 19:40:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 01 Jul 2020 19:40:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasynce5ae0d85')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Wed, 01 Jul 2020 19:40:43 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstoragewmjulbgag54k.table.core.windows.net/Tables('pytableasynce5ae0d85')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table.yaml
new file mode 100644
index 000000000000..dbd0daa84a87
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table.yaml
@@ -0,0 +1,66 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasyncf33c0dcd"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasyncf33c0dcd"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:08 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasyncf33c0dcd')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasyncf33c0dcd')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:08 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasyncf33c0dcd')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table_fail_on_exist.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table_fail_on_exist.yaml
new file mode 100644
index 000000000000..05fe78006883
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_create_table_fail_on_exist.yaml
@@ -0,0 +1,103 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasyncdea11390"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasyncdea11390"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:08 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasyncdea11390')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "pytableasyncdea11390"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.error":{"code":"TableAlreadyExists","message":{"lang":"en-US","value":"The
+ table specified already exists.\nRequestId:4783f26d-b002-001c-1975-66e974000000\nTime:2020-07-30T13:31:09.2843685Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:08 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 409
+ message: Conflict
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasyncdea11390')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:08 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasyncdea11390')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_delete_table_with_existing_table.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_delete_table_with_existing_table.yaml
new file mode 100644
index 000000000000..b3298a2f8cfa
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_delete_table_with_existing_table.yaml
@@ -0,0 +1,66 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasync5ef31618"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasync5ef31618"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:08 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasync5ef31618')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasync5ef31618')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:09 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasync5ef31618')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_delete_table_with_non_existing_table_fail_not_exist.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_delete_table_with_non_existing_table_fail_not_exist.yaml
new file mode 100644
index 000000000000..0a55171a744b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_delete_table_with_non_existing_table_fail_not_exist.yaml
@@ -0,0 +1,35 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasync50951df9')
+ response:
+ body:
+ string: 'ResourceNotFound
The specified resource does not exist.
+
+ RequestId:685895a9-9002-0066-1b75-668339000000
+
+ Time:2020-07-30T13:31:10.1773914Z'
+ headers:
+ cache-control: no-cache
+ content-type: application/xml;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:09 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasync50951df9')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_get_table_acl.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_get_table_acl.yaml
new file mode 100644
index 000000000000..e2dcef36a394
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_get_table_acl.yaml
@@ -0,0 +1,95 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasync1550e28"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasync1550e28"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:10 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasync1550e28')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 13:31:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/pytableasync1550e28?comp=acl
+ response:
+ body:
+ string: "\uFEFF"
+ headers:
+ content-type: application/xml
+ date: Thu, 30 Jul 2020 13:31:10 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/pytableasync1550e28?comp=acl
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasync1550e28')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:10 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasync1550e28')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables.yaml
new file mode 100644
index 000000000000..5ac4de53c713
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables.yaml
@@ -0,0 +1,71 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasynce6450d88"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasynce6450d88"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:10 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasynce6450d88')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytableasynce6450d88"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:10 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_filter.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_filter.yaml
new file mode 100644
index 000000000000..f5ba218782d5
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_filter.yaml
@@ -0,0 +1,39 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasynca9051288"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 23 Jul 2020 14:21:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 23 Jul 2020 14:21:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasynca9051288"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 23 Jul 2020 14:21:28 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasynca9051288')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragej3sl6jfnvp34.table.core.windows.net/Tables
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_marker.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_marker.yaml
new file mode 100644
index 000000000000..f9338c2477f8
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_marker.yaml
@@ -0,0 +1,214 @@
+interactions:
+- request:
+ body: '{"TableName": "listtable0a9041284"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 22 Jul 2020 19:11:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 22 Jul 2020 19:11:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable0a9041284"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Wed, 22 Jul 2020 19:11:34 GMT
+ location: https://storagename.table.core.windows.net/Tables('listtable0a9041284')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragejssq3z2qvrzy.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "listtable1a9041284"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 22 Jul 2020 19:11:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 22 Jul 2020 19:11:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable1a9041284"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Wed, 22 Jul 2020 19:11:34 GMT
+ location: https://storagename.table.core.windows.net/Tables('listtable1a9041284')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragejssq3z2qvrzy.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "listtable2a9041284"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 22 Jul 2020 19:11:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 22 Jul 2020 19:11:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable2a9041284"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Wed, 22 Jul 2020 19:11:35 GMT
+ location: https://storagename.table.core.windows.net/Tables('listtable2a9041284')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragejssq3z2qvrzy.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "listtable3a9041284"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 22 Jul 2020 19:11:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 22 Jul 2020 19:11:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable3a9041284"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Wed, 22 Jul 2020 19:11:35 GMT
+ location: https://storagename.table.core.windows.net/Tables('listtable3a9041284')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragejssq3z2qvrzy.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 22 Jul 2020 19:11:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 22 Jul 2020 19:11:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable0a9041284"},{"TableName":"listtable1a9041284"},{"TableName":"listtable2a9041284"},{"TableName":"listtable3a9041284"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Wed, 22 Jul 2020 19:11:35 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstoragejssq3z2qvrzy.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Wed, 22 Jul 2020 19:11:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 22 Jul 2020 19:11:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable0a9041284"},{"TableName":"listtable1a9041284"},{"TableName":"listtable2a9041284"},{"TableName":"listtable3a9041284"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Wed, 22 Jul 2020 19:11:35 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstoragejssq3z2qvrzy.table.core.windows.net/Tables
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_num_results.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_num_results.yaml
new file mode 100644
index 000000000000..aaaef8669965
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_list_tables_with_num_results.yaml
@@ -0,0 +1,247 @@
+interactions:
+- request:
+ body: '{"TableName": "listtable0cac14c3"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '34'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable0cac14c3"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:11 GMT
+ location: https://storagename.table.core.windows.net/Tables('listtable0cac14c3')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "listtable1cac14c3"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '34'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable1cac14c3"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:11 GMT
+ location: https://storagename.table.core.windows.net/Tables('listtable1cac14c3')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "listtable2cac14c3"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '34'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable2cac14c3"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:11 GMT
+ location: https://storagename.table.core.windows.net/Tables('listtable2cac14c3')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "listtable3cac14c3"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '34'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"listtable3cac14c3"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ location: https://storagename.table.core.windows.net/Tables('listtable3cac14c3')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable0cac14c3"},{"TableName":"listtable1cac14c3"},{"TableName":"listtable2cac14c3"},{"TableName":"listtable3cac14c3"},{"TableName":"pytableasynce6450d88"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$top=3
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable0cac14c3"},{"TableName":"listtable1cac14c3"},{"TableName":"listtable2cac14c3"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-continuation-nexttablename: 1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjY2NzViMGY4YjFkYw--
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables?$top=3
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$top=3&NextTableName=1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjY2NzViMGY4YjFkYw--
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"listtable3cac14c3"},{"TableName":"pytableasynce6450d88"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables?$top=3&NextTableName=1!48!bGlzdHRhYmxlM2NhYzE0YzMBMDFkNjY2NzViMGY4YjFkYw--
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_query_tables_with_filter.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_query_tables_with_filter.yaml
new file mode 100644
index 000000000000..71721dd0002f
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_query_tables_with_filter.yaml
@@ -0,0 +1,98 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasyncbd551302"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasyncbd551302"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasyncbd551302')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables?$filter=TableName%20eq%20'pytableasyncbd551302'
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[{"TableName":"pytableasyncbd551302"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables?$filter=TableName%20eq%20'pytableasyncbd551302'
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasyncbd551302')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasyncbd551302')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_too_many_ids.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_too_many_ids.yaml
new file mode 100644
index 000000000000..345ba7b9888a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_too_many_ids.yaml
@@ -0,0 +1,66 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasynce03c1398"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasynce03c1398"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasynce03c1398')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasynce03c1398')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasynce03c1398')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifiers.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifiers.yaml
new file mode 100644
index 000000000000..15a202289223
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifiers.yaml
@@ -0,0 +1,124 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasync6d6c1aab"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasync6d6c1aab"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasync6d6c1aab')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Content-Type:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/pytableasync6d6c1aab?comp=acl
+ response:
+ body:
+ string: ''
+ headers:
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:12 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/pytableasync6d6c1aab?comp=acl
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/pytableasync6d6c1aab?comp=acl
+ response:
+ body:
+ string: "\uFEFF"
+ headers:
+ content-type: application/xml
+ date: Thu, 30 Jul 2020 13:31:13 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/pytableasync6d6c1aab?comp=acl
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasync6d6c1aab')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:13 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasync6d6c1aab')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_signed_identifiers.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_signed_identifiers.yaml
new file mode 100644
index 000000000000..ddf1845c6423
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_signed_identifiers.yaml
@@ -0,0 +1,127 @@
+interactions:
+- request:
+ body: '{"TableName": "pytableasyncd261181d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '37'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"pytableasyncd261181d"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:31:13 GMT
+ location: https://storagename.table.core.windows.net/Tables('pytableasyncd261181d')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables
+- request:
+ body: '
+
+ testid2020-07-30T13:26:15Z2020-07-30T14:31:15Zr'
+ headers:
+ Accept:
+ - application/xml
+ Content-Length:
+ - '257'
+ Content-Type:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/pytableasyncd261181d?comp=acl
+ response:
+ body:
+ string: ''
+ headers:
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:14 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/pytableasyncd261181d?comp=acl
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/pytableasyncd261181d?comp=acl
+ response:
+ body:
+ string: "\uFEFFtestid2020-07-30T13:26:15.0000000Z2020-07-30T14:31:15.0000000Zr"
+ headers:
+ content-type: application/xml
+ date: Thu, 30 Jul 2020 13:31:14 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/pytableasyncd261181d?comp=acl
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:31:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('pytableasyncd261181d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:31:14 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageq3qeesbeuztp.table.core.windows.net/Tables('pytableasyncd261181d')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_request_callback_signed_header.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_request_callback_signed_header.yaml
new file mode 100644
index 000000000000..0c69b85c1fa5
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_request_callback_signed_header.yaml
@@ -0,0 +1,114 @@
+interactions:
+- request:
+ body: '{"TableName": "cont48761589"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '29'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+<<<<<<< HEAD
+ - Wed, 15 Jul 2020 12:56:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 15 Jul 2020 12:56:10 GMT
+=======
+ - Wed, 01 Jul 2020 18:18:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 01 Jul 2020 18:18:37 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"cont48761589"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+<<<<<<< HEAD
+ - Wed, 15 Jul 2020 12:56:10 GMT
+=======
+ - Wed, 01 Jul 2020 18:18:35 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ location:
+ - https://storagename.table.core.windows.net/Tables('cont48761589')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+<<<<<<< HEAD
+ - Wed, 15 Jul 2020 12:56:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 15 Jul 2020 12:56:11 GMT
+=======
+ - Wed, 01 Jul 2020 18:18:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 01 Jul 2020 18:18:37 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('cont48761589')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+<<<<<<< HEAD
+ - Wed, 15 Jul 2020 12:56:10 GMT
+=======
+ - Wed, 01 Jul 2020 18:18:35 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_response_callback.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_response_callback.yaml
new file mode 100644
index 000000000000..fd9bd5a4d21e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_response_callback.yaml
@@ -0,0 +1,39 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Wed, 01 Jul 2020 18:18:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Wed, 01 Jul 2020 18:18:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: "\uFEFF1.0falsefalsefalsefalse1.0truetruetrue71.0falsefalse"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Wed, 01 Jul 2020 18:18:35 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_append.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_append.yaml
new file mode 100644
index 000000000000..5e43e4345d35
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_append.yaml
@@ -0,0 +1,56 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+<<<<<<< HEAD
+ - Wed, 01 Jul 2020 18:25:06 GMT
+ User-Agent:
+ - customer_user_agent
+ x-ms-date:
+ - Wed, 01 Jul 2020 18:25:06 GMT
+=======
+ - Wed, 01 Jul 2020 18:18:37 GMT
+ User-Agent:
+ - customer_user_agent
+ x-ms-date:
+ - Wed, 01 Jul 2020 18:18:37 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+<<<<<<< HEAD
+ - Wed, 01 Jul 2020 18:25:05 GMT
+=======
+ - Wed, 01 Jul 2020 18:18:36 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_custom.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_custom.yaml
new file mode 100644
index 000000000000..abd3dd677701
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_custom.yaml
@@ -0,0 +1,87 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 27 Jul 2020 14:16:21 GMT
+ User-Agent:
+ - TestApp/v1.0 azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:16:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 27 Jul 2020 14:16:21 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Mon, 27 Jul 2020 14:16:21 GMT
+ User-Agent:
+ - TestApp/v2.0 TestApp/v1.0 azsdk-python-storage-table/2019-07-07 Python/3.8.3
+ (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:16:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Mon, 27 Jul 2020 14:16:21 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_default.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_default.yaml
new file mode 100644
index 000000000000..d3da2ae7a6c4
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_client.test_user_agent_default.yaml
@@ -0,0 +1,44 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Tue, 30 Jun 2020 19:45:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Tue, 30 Jun 2020 19:45:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables","value":[]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Tue, 30 Jun 2020 19:45:38 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_binary_property_value.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_binary_property_value.yaml
new file mode 100644
index 000000000000..8ed696eaf9da
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_binary_property_value.yaml
@@ -0,0 +1,185 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable99fe1256"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable99fe1256"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable99fe1256')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk99fe1256", "RowKey": "rk99fe1256", "binary": "AQIDBAUGBwgJCg==",
+ "binary@odata.type": "Edm.Binary"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '119'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable99fe1256
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable99fe1256/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A34.6927611Z''\"","PartitionKey":"pk99fe1256","RowKey":"rk99fe1256","Timestamp":"2020-07-30T14:24:34.6927611Z","binary@odata.type":"Edm.Binary","binary":"AQIDBAUGBwgJCg=="}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A34.6927611Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable99fe1256(PartitionKey='pk99fe1256',RowKey='rk99fe1256')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable99fe1256(PartitionKey='pk99fe1256',RowKey='rk99fe1256')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable99fe1256/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A34.6927611Z''\"","PartitionKey":"pk99fe1256","RowKey":"rk99fe1256","Timestamp":"2020-07-30T14:24:34.6927611Z","binary@odata.type":"Edm.Binary","binary":"AQIDBAUGBwgJCg=="}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A34.6927611Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable99fe1256')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity.yaml
new file mode 100644
index 000000000000..60a0ec925dbc
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity.yaml
@@ -0,0 +1,233 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable12440ee0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable12440ee0"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable12440ee0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk12440ee0", "RowKey": "rk12440ee0", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable12440ee0
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable12440ee0/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A35.3901372Z''\"","PartitionKey":"pk12440ee0","RowKey":"rk12440ee0","Timestamp":"2020-07-30T14:24:35.3901372Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A35.3901372Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable12440ee0(PartitionKey='pk12440ee0',RowKey='rk12440ee0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttable12440ee0(PartitionKey='pk12440ee0',RowKey='rk12440ee0')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable12440ee0(PartitionKey='pk12440ee0',RowKey='rk12440ee0')
+ response:
+ body:
+ string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
+ specified resource does not exist.\nRequestId:1e52ed17-0002-002f-077d-6628c3000000\nTime:2020-07-30T14:24:35.5952834Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable12440ee0')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:34 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_not_existing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_not_existing.yaml
new file mode 100644
index 000000000000..180b3fb1edf6
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_not_existing.yaml
@@ -0,0 +1,141 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablef9b6145a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablef9b6145a"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablef9b6145a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttablef9b6145a(PartitionKey='pkf9b6145a',RowKey='rkf9b6145a')
+ response:
+ body:
+ string: 'ResourceNotFound
The specified resource does not exist.
+
+ RequestId:dc92eeba-e002-0007-227d-665f7c000000
+
+ Time:2020-07-30T14:24:36.2619723Z'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/xml;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablef9b6145a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_with_if_doesnt_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_with_if_doesnt_match.yaml
new file mode 100644
index 000000000000..9c427c9e7c77
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_with_if_doesnt_match.yaml
@@ -0,0 +1,197 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablea99a1781"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablea99a1781"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablea99a1781')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pka99a1781", "RowKey": "rka99a1781", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablea99a1781
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablea99a1781/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A36.8026672Z''\"","PartitionKey":"pka99a1781","RowKey":"rka99a1781","Timestamp":"2020-07-30T14:24:36.8026672Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A36.8026672Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablea99a1781(PartitionKey='pka99a1781',RowKey='rka99a1781')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ If-Match:
+ - W/"datetime'2012-06-15T22%3A51%3A44.9662825Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttablea99a1781(PartitionKey='pka99a1781',RowKey='rka99a1781')
+ response:
+ body:
+ string: 'UpdateConditionNotSatisfied
The update condition specified in the request was not satisfied.
+
+ RequestId:9818b359-f002-0057-697d-664074000000
+
+ Time:2020-07-30T14:24:36.8927298Z'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/xml;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:35 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 412
+ message: Precondition Failed
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablea99a1781')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_with_if_matches.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_with_if_matches.yaml
new file mode 100644
index 000000000000..fc7891635888
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_with_if_matches.yaml
@@ -0,0 +1,233 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3801156d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3801156d"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable3801156d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk3801156d", "RowKey": "rk3801156d", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable3801156d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable3801156d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A37.4661421Z''\"","PartitionKey":"pk3801156d","RowKey":"rk3801156d","Timestamp":"2020-07-30T14:24:37.4661421Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A37.4661421Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable3801156d(PartitionKey='pk3801156d',RowKey='rk3801156d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ If-Match:
+ - W/"datetime'2020-07-30T14%3A24%3A37.4661421Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttable3801156d(PartitionKey='pk3801156d',RowKey='rk3801156d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable3801156d(PartitionKey='pk3801156d',RowKey='rk3801156d')
+ response:
+ body:
+ string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
+ specified resource does not exist.\nRequestId:1d3cb1c3-a002-0044-617d-667595000000\nTime:2020-07-30T14:24:37.6402651Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3801156d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:36 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_empty_and_spaces_property_value.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_empty_and_spaces_property_value.yaml
new file mode 100644
index 000000000000..d49027ddb9fb
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_empty_and_spaces_property_value.yaml
@@ -0,0 +1,188 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable66111670"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable66111670"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable66111670')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk66111670", "RowKey": "rk66111670", "EmptyByte": "",
+ "EmptyUnicode": "", "SpacesOnlyByte": " ", "SpacesOnlyUnicode": " ", "SpacesBeforeByte":
+ " Text", "SpacesBeforeUnicode": " Text", "SpacesAfterByte": "Text ", "SpacesAfterUnicode":
+ "Text ", "SpacesBeforeAndAfterByte": " Text ", "SpacesBeforeAndAfterUnicode":
+ " Text "}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '359'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable66111670
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable66111670/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A38.1730826Z''\"","PartitionKey":"pk66111670","RowKey":"rk66111670","Timestamp":"2020-07-30T14:24:38.1730826Z","EmptyByte":"","EmptyUnicode":"","SpacesOnlyByte":" ","SpacesOnlyUnicode":" ","SpacesBeforeByte":" Text","SpacesBeforeUnicode":" Text","SpacesAfterByte":"Text ","SpacesAfterUnicode":"Text ","SpacesBeforeAndAfterByte":" Text ","SpacesBeforeAndAfterUnicode":" Text "}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A38.1730826Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable66111670(PartitionKey='pk66111670',RowKey='rk66111670')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable66111670(PartitionKey='pk66111670',RowKey='rk66111670')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable66111670/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A38.1730826Z''\"","PartitionKey":"pk66111670","RowKey":"rk66111670","Timestamp":"2020-07-30T14:24:38.1730826Z","EmptyByte":"","EmptyUnicode":"","SpacesOnlyByte":" ","SpacesOnlyUnicode":" ","SpacesBeforeByte":" Text","SpacesBeforeUnicode":" Text","SpacesAfterByte":"Text ","SpacesAfterUnicode":"Text ","SpacesBeforeAndAfterByte":" Text ","SpacesBeforeAndAfterUnicode":" Text "}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A38.1730826Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable66111670')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity.yaml
new file mode 100644
index 000000000000..e2a2f91ea816
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity.yaml
@@ -0,0 +1,190 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee7730dad"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee7730dad"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablee7730dad')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pke7730dad", "RowKey": "rke7730dad", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablee7730dad
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee7730dad/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A38.7779466Z''\"","PartitionKey":"pke7730dad","RowKey":"rke7730dad","Timestamp":"2020-07-30T14:24:38.7779466Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A38.7779466Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablee7730dad(PartitionKey='pke7730dad',RowKey='rke7730dad')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablee7730dad(PartitionKey='pke7730dad',RowKey='rke7730dad')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee7730dad/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A38.7779466Z''\"","PartitionKey":"pke7730dad","RowKey":"rke7730dad","Timestamp":"2020-07-30T14:24:38.7779466Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A38.7779466Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee7730dad')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_full_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_full_metadata.yaml
new file mode 100644
index 000000000000..9d07a60dd4d7
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_full_metadata.yaml
@@ -0,0 +1,190 @@
+interactions:
+- request:
+ body: '{"TableName": "uttabled1cb135f"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttabled1cb135f"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttabled1cb135f')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkd1cb135f", "RowKey": "rkd1cb135f", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttabled1cb135f
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttabled1cb135f/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A39.3967653Z''\"","PartitionKey":"pkd1cb135f","RowKey":"rkd1cb135f","Timestamp":"2020-07-30T14:24:39.3967653Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A39.3967653Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttabled1cb135f(PartitionKey='pkd1cb135f',RowKey='rkd1cb135f')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ accept:
+ - application/json;odata=fullmetadata
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttabled1cb135f(PartitionKey='pkd1cb135f',RowKey='rkd1cb135f')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttabled1cb135f/@Element","odata.type":"storagename.uttabled1cb135f","odata.id":"https://storagename.table.core.windows.net/uttabled1cb135f(PartitionKey=''pkd1cb135f'',RowKey=''rkd1cb135f'')","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A39.3967653Z''\"","odata.editLink":"uttabled1cb135f(PartitionKey=''pkd1cb135f'',RowKey=''rkd1cb135f'')","PartitionKey":"pkd1cb135f","RowKey":"rkd1cb135f","Timestamp@odata.type":"Edm.DateTime","Timestamp":"2020-07-30T14:24:39.3967653Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=fullmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:38 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A39.3967653Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttabled1cb135f')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match.yaml
new file mode 100644
index 000000000000..c665ee80f445
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match.yaml
@@ -0,0 +1,234 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable74691147"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable74691147"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable74691147')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk74691147", "RowKey": "rk74691147", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable74691147
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable74691147/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A40.0164803Z''\"","PartitionKey":"pk74691147","RowKey":"rk74691147","Timestamp":"2020-07-30T14:24:40.0164803Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A40.0164803Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable74691147(PartitionKey='pk74691147',RowKey='rk74691147')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable74691147(PartitionKey='pk74691147',RowKey='rk74691147')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable74691147/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A40.0164803Z''\"","PartitionKey":"pk74691147","RowKey":"rk74691147","Timestamp":"2020-07-30T14:24:40.0164803Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A40.0164803Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ If-Match:
+ - W/"datetime'2020-07-30T14%3A24%3A40.0164803Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttable74691147(PartitionKey='pk74691147',RowKey='rk74691147')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable74691147')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:39 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_no_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_no_metadata.yaml
new file mode 100644
index 000000000000..aeced10878b4
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_no_metadata.yaml
@@ -0,0 +1,190 @@
+interactions:
+- request:
+ body: '{"TableName": "uttableab3d1289"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableab3d1289"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttableab3d1289')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkab3d1289", "RowKey": "rkab3d1289", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableab3d1289
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableab3d1289/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A40.7237784Z''\"","PartitionKey":"pkab3d1289","RowKey":"rkab3d1289","Timestamp":"2020-07-30T14:24:40.7237784Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A40.7237784Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttableab3d1289(PartitionKey='pkab3d1289',RowKey='rkab3d1289')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ accept:
+ - application/json;odata=nometadata
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttableab3d1289(PartitionKey='pkab3d1289',RowKey='rkab3d1289')
+ response:
+ body:
+ string: '{"PartitionKey":"pkab3d1289","RowKey":"rkab3d1289","Timestamp":"2020-07-30T14:24:40.7237784Z","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":"933311100","Birthday":"1973-10-04T00:00:00Z","birthday":"1970-10-04T00:00:00Z","binary":"YmluYXJ5","other":20,"clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=nometadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A40.7237784Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttableab3d1289')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_not_existing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_not_existing.yaml
new file mode 100644
index 000000000000..3df4716dcefd
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_not_existing.yaml
@@ -0,0 +1,133 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablebf5d1327"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablebf5d1327"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablebf5d1327')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablebf5d1327(PartitionKey='pkbf5d1327',RowKey='rkbf5d1327')
+ response:
+ body:
+ string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
+ specified resource does not exist.\nRequestId:702f6a3a-6002-0059-267d-66ac7f000000\nTime:2020-07-30T14:24:41.3611094Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablebf5d1327')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_hook.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_hook.yaml
new file mode 100644
index 000000000000..6350c814411e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_hook.yaml
@@ -0,0 +1,190 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable871e11d8"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable871e11d8"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable871e11d8')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk871e11d8", "RowKey": "rk871e11d8", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable871e11d8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable871e11d8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A41.9261543Z''\"","PartitionKey":"pk871e11d8","RowKey":"rk871e11d8","Timestamp":"2020-07-30T14:24:41.9261543Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:40 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A41.9261543Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable871e11d8(PartitionKey='pk871e11d8',RowKey='rk871e11d8')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable871e11d8(PartitionKey='pk871e11d8',RowKey='rk871e11d8')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable871e11d8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A41.9261543Z''\"","PartitionKey":"pk871e11d8","RowKey":"rk871e11d8","Timestamp":"2020-07-30T14:24:41.9261543Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A41.9261543Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable871e11d8')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:41 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
new file mode 100644
index 000000000000..31ede325cf04
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
@@ -0,0 +1,250 @@
+interactions:
+- request:
+ body: '{"TableName": "uttableabfa12a7"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:09 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:09 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableabfa12a7"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:09 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:04 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttableabfa12a7')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkabfa12a7", "RowKey": "rkabfa12a7", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:10 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:10 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableabfa12a7
+ response:
+ body:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableabfa12a7/@Element","odata.etag":"W/\"datetime''2020-07-23T14%3A40%3A10.5120215Z''\"","PartitionKey":"pkabfa12a7","RowKey":"rkabfa12a7","Timestamp":"2020-07-23T14:40:10.5120215Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+=======
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableabfa12a7/@Element","odata.etag":"W/\"datetime''2020-07-22T15%3A51%3A05.1113456Z''\"","PartitionKey":"pkabfa12a7","RowKey":"rkabfa12a7","Timestamp":"2020-07-22T15:51:05.1113456Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:09 GMT
+ etag:
+ - W/"datetime'2020-07-23T14%3A40%3A10.5120215Z'"
+=======
+ - Wed, 22 Jul 2020 15:51:04 GMT
+ etag:
+ - W/"datetime'2020-07-22T15%3A51%3A05.1113456Z'"
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ location:
+ - https://storagename.table.core.windows.net/uttableabfa12a7(PartitionKey='pkabfa12a7',RowKey='rkabfa12a7')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:10 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:10 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttableabfa12a7(PartitionKey='pkabfa12a7',RowKey='rkabfa12a7')?$select=agesexxyz
+ response:
+ body:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableabfa12a7/@Element&$select=age,sex,xyz","odata.etag":"W/\"datetime''2020-07-23T14%3A40%3A10.5120215Z''\"","age@odata.type":"Edm.Int64","age":"39","sex":"male","xyz":null}'
+=======
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableabfa12a7/@Element&$select=agesexxyz","odata.etag":"W/\"datetime''2020-07-22T15%3A51%3A05.1113456Z''\"","agesexxyz":null}'
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:10 GMT
+ etag:
+ - W/"datetime'2020-07-23T14%3A40%3A10.5120215Z'"
+=======
+ - Wed, 22 Jul 2020 15:51:04 GMT
+ etag:
+ - W/"datetime'2020-07-22T15%3A51%3A05.1113456Z'"
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:10 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:10 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttableabfa12a7')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+<<<<<<< HEAD:sdk/table/azure-table/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ - Thu, 23 Jul 2020 14:40:10 GMT
+=======
+ - Wed, 22 Jul 2020 15:51:05 GMT
+>>>>>>> 32dbb1125b174271baf26296ae51abef0bbcccfa:sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_select.yaml
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_special_doubles.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_special_doubles.yaml
new file mode 100644
index 000000000000..90df53cf6712
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_with_special_doubles.yaml
@@ -0,0 +1,186 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable65ff1655"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable65ff1655"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable65ff1655')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk65ff1655", "RowKey": "rk65ff1655", "inf": "Infinity",
+ "inf@odata.type": "Edm.Double", "negativeinf": "-Infinity", "negativeinf@odata.type":
+ "Edm.Double", "nan": "NaN", "nan@odata.type": "Edm.Double"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '219'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable65ff1655
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable65ff1655/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A42.5373861Z''\"","PartitionKey":"pk65ff1655","RowKey":"rk65ff1655","Timestamp":"2020-07-30T14:24:42.5373861Z","inf@odata.type":"Edm.Double","inf":"Infinity","negativeinf@odata.type":"Edm.Double","negativeinf":"-Infinity","nan@odata.type":"Edm.Double","nan":"NaN"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A42.5373861Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable65ff1655(PartitionKey='pk65ff1655',RowKey='rk65ff1655')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable65ff1655(PartitionKey='pk65ff1655',RowKey='rk65ff1655')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable65ff1655/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A42.5373861Z''\"","PartitionKey":"pk65ff1655","RowKey":"rk65ff1655","Timestamp":"2020-07-30T14:24:42.5373861Z","inf@odata.type":"Edm.Double","inf":"Infinity","negativeinf@odata.type":"Edm.Double","negativeinf":"-Infinity","nan@odata.type":"Edm.Double","nan":"NaN"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A42.5373861Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable65ff1655')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_conflict.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_conflict.yaml
new file mode 100644
index 000000000000..9de878286c0a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_conflict.yaml
@@ -0,0 +1,199 @@
+interactions:
+- request:
+ body: '{"TableName": "uttableace512b3"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableace512b3"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttableace512b3')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkace512b3", "RowKey": "rkace512b3", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableace512b3
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableace512b3/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A43.1800879Z''\"","PartitionKey":"pkace512b3","RowKey":"rkace512b3","Timestamp":"2020-07-30T14:24:43.1800879Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A43.1800879Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttableace512b3(PartitionKey='pkace512b3',RowKey='rkace512b3')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkace512b3", "RowKey": "rkace512b3", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableace512b3
+ response:
+ body:
+ string: '{"odata.error":{"code":"EntityAlreadyExists","message":{"lang":"en-US","value":"The
+ specified entity already exists.\nRequestId:4e924949-5002-005a-0d7d-66af78000000\nTime:2020-07-30T14:24:43.2741543Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 409
+ message: Conflict
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttableace512b3')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_dictionary.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_dictionary.yaml
new file mode 100644
index 000000000000..14bbf10cad43
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_dictionary.yaml
@@ -0,0 +1,146 @@
+interactions:
+- request:
+ body: '{"TableName": "uttabled3851397"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttabled3851397"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttabled3851397')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkd3851397", "RowKey": "rkd3851397", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttabled3851397
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttabled3851397/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A43.813941Z''\"","PartitionKey":"pkd3851397","RowKey":"rkd3851397","Timestamp":"2020-07-30T14:24:43.813941Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:42 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A43.813941Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttabled3851397(PartitionKey='pkd3851397',RowKey='rkd3851397')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttabled3851397')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_empty_string_pk.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_empty_string_pk.yaml
new file mode 100644
index 000000000000..9bed2a6f5268
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_empty_string_pk.yaml
@@ -0,0 +1,140 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3d1615c0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3d1615c0"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable3d1615c0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"RowKey": "rk", "PartitionKey": ""}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable3d1615c0
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable3d1615c0/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A44.3589789Z''\"","PartitionKey":"","RowKey":"rk","Timestamp":"2020-07-30T14:24:44.3589789Z"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A44.3589789Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable3d1615c0(PartitionKey='',RowKey='rk')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3d1615c0')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_empty_string_rk.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_empty_string_rk.yaml
new file mode 100644
index 000000000000..4fd0064c8210
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_empty_string_rk.yaml
@@ -0,0 +1,140 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3d1a15c2"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3d1a15c2"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:43 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable3d1a15c2')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk", "RowKey": ""}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable3d1a15c2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable3d1a15c2/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A44.9268631Z''\"","PartitionKey":"pk","RowKey":"","Timestamp":"2020-07-30T14:24:44.9268631Z"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A44.9268631Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable3d1a15c2(PartitionKey='pk',RowKey='')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3d1a15c2')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_missing_pk.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_missing_pk.yaml
new file mode 100644
index 000000000000..39f025927c1b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_missing_pk.yaml
@@ -0,0 +1,90 @@
+interactions:
+- request:
+ body: '{"TableName": "uttabled41f1395"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttabled41f1395"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttabled41f1395')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttabled41f1395')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:44 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_missing_rk.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_missing_rk.yaml
new file mode 100644
index 000000000000..fa8888987f13
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_missing_rk.yaml
@@ -0,0 +1,90 @@
+interactions:
+- request:
+ body: '{"TableName": "uttabled4231397"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttabled4231397"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttabled4231397')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttabled4231397')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:45 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_property_name_too_long.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_property_name_too_long.yaml
new file mode 100644
index 000000000000..e6a5e3a08f43
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_property_name_too_long.yaml
@@ -0,0 +1,138 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee10d18a6"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee10d18a6"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablee10d18a6')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pke10d18a6", "RowKey": "rke10d18a6", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":
+ "badval"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '324'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablee10d18a6
+ response:
+ body:
+ string: '{"odata.error":{"code":"PropertyNameTooLong","message":{"lang":"en-US","value":"The
+ property name exceeds the maximum allowed length (255).\nRequestId:4c2f74b7-b002-005b-357d-66ae85000000\nTime:2020-07-30T14:24:46.3911183Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 400
+ message: Bad Request
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee10d18a6')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_too_many_properties.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_too_many_properties.yaml
new file mode 100644
index 000000000000..bcf767aac948
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_too_many_properties.yaml
@@ -0,0 +1,207 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable97d21773"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable97d21773"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable97d21773')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk97d21773", "RowKey": "rk97d21773", "key0": "value0",
+ "key1": "value1", "key2": "value2", "key3": "value3", "key4": "value4", "key5":
+ "value5", "key6": "value6", "key7": "value7", "key8": "value8", "key9": "value9",
+ "key10": "value10", "key11": "value11", "key12": "value12", "key13": "value13",
+ "key14": "value14", "key15": "value15", "key16": "value16", "key17": "value17",
+ "key18": "value18", "key19": "value19", "key20": "value20", "key21": "value21",
+ "key22": "value22", "key23": "value23", "key24": "value24", "key25": "value25",
+ "key26": "value26", "key27": "value27", "key28": "value28", "key29": "value29",
+ "key30": "value30", "key31": "value31", "key32": "value32", "key33": "value33",
+ "key34": "value34", "key35": "value35", "key36": "value36", "key37": "value37",
+ "key38": "value38", "key39": "value39", "key40": "value40", "key41": "value41",
+ "key42": "value42", "key43": "value43", "key44": "value44", "key45": "value45",
+ "key46": "value46", "key47": "value47", "key48": "value48", "key49": "value49",
+ "key50": "value50", "key51": "value51", "key52": "value52", "key53": "value53",
+ "key54": "value54", "key55": "value55", "key56": "value56", "key57": "value57",
+ "key58": "value58", "key59": "value59", "key60": "value60", "key61": "value61",
+ "key62": "value62", "key63": "value63", "key64": "value64", "key65": "value65",
+ "key66": "value66", "key67": "value67", "key68": "value68", "key69": "value69",
+ "key70": "value70", "key71": "value71", "key72": "value72", "key73": "value73",
+ "key74": "value74", "key75": "value75", "key76": "value76", "key77": "value77",
+ "key78": "value78", "key79": "value79", "key80": "value80", "key81": "value81",
+ "key82": "value82", "key83": "value83", "key84": "value84", "key85": "value85",
+ "key86": "value86", "key87": "value87", "key88": "value88", "key89": "value89",
+ "key90": "value90", "key91": "value91", "key92": "value92", "key93": "value93",
+ "key94": "value94", "key95": "value95", "key96": "value96", "key97": "value97",
+ "key98": "value98", "key99": "value99", "key100": "value100", "key101": "value101",
+ "key102": "value102", "key103": "value103", "key104": "value104", "key105":
+ "value105", "key106": "value106", "key107": "value107", "key108": "value108",
+ "key109": "value109", "key110": "value110", "key111": "value111", "key112":
+ "value112", "key113": "value113", "key114": "value114", "key115": "value115",
+ "key116": "value116", "key117": "value117", "key118": "value118", "key119":
+ "value119", "key120": "value120", "key121": "value121", "key122": "value122",
+ "key123": "value123", "key124": "value124", "key125": "value125", "key126":
+ "value126", "key127": "value127", "key128": "value128", "key129": "value129",
+ "key130": "value130", "key131": "value131", "key132": "value132", "key133":
+ "value133", "key134": "value134", "key135": "value135", "key136": "value136",
+ "key137": "value137", "key138": "value138", "key139": "value139", "key140":
+ "value140", "key141": "value141", "key142": "value142", "key143": "value143",
+ "key144": "value144", "key145": "value145", "key146": "value146", "key147":
+ "value147", "key148": "value148", "key149": "value149", "key150": "value150",
+ "key151": "value151", "key152": "value152", "key153": "value153", "key154":
+ "value154", "key155": "value155", "key156": "value156", "key157": "value157",
+ "key158": "value158", "key159": "value159", "key160": "value160", "key161":
+ "value161", "key162": "value162", "key163": "value163", "key164": "value164",
+ "key165": "value165", "key166": "value166", "key167": "value167", "key168":
+ "value168", "key169": "value169", "key170": "value170", "key171": "value171",
+ "key172": "value172", "key173": "value173", "key174": "value174", "key175":
+ "value175", "key176": "value176", "key177": "value177", "key178": "value178",
+ "key179": "value179", "key180": "value180", "key181": "value181", "key182":
+ "value182", "key183": "value183", "key184": "value184", "key185": "value185",
+ "key186": "value186", "key187": "value187", "key188": "value188", "key189":
+ "value189", "key190": "value190", "key191": "value191", "key192": "value192",
+ "key193": "value193", "key194": "value194", "key195": "value195", "key196":
+ "value196", "key197": "value197", "key198": "value198", "key199": "value199",
+ "key200": "value200", "key201": "value201", "key202": "value202", "key203":
+ "value203", "key204": "value204", "key205": "value205", "key206": "value206",
+ "key207": "value207", "key208": "value208", "key209": "value209", "key210":
+ "value210", "key211": "value211", "key212": "value212", "key213": "value213",
+ "key214": "value214", "key215": "value215", "key216": "value216", "key217":
+ "value217", "key218": "value218", "key219": "value219", "key220": "value220",
+ "key221": "value221", "key222": "value222", "key223": "value223", "key224":
+ "value224", "key225": "value225", "key226": "value226", "key227": "value227",
+ "key228": "value228", "key229": "value229", "key230": "value230", "key231":
+ "value231", "key232": "value232", "key233": "value233", "key234": "value234",
+ "key235": "value235", "key236": "value236", "key237": "value237", "key238":
+ "value238", "key239": "value239", "key240": "value240", "key241": "value241",
+ "key242": "value242", "key243": "value243", "key244": "value244", "key245":
+ "value245", "key246": "value246", "key247": "value247", "key248": "value248",
+ "key249": "value249", "key250": "value250", "key251": "value251", "key252":
+ "value252", "key253": "value253", "key254": "value254"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '5444'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable97d21773
+ response:
+ body:
+ string: '{"odata.error":{"code":"TooManyProperties","message":{"lang":"en-US","value":"The
+ entity contains more properties than allowed. Each entity can include up to
+ 252 properties to store data. Each entity also has 3 system properties.\nRequestId:74988813-9002-0047-207d-667692000000\nTime:2020-07-30T14:24:46.9374438Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 400
+ message: Bad Request
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable97d21773')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_full_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_full_metadata.yaml
new file mode 100644
index 000000000000..ce7a8eacf9cf
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_full_metadata.yaml
@@ -0,0 +1,146 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable7f6816cf"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable7f6816cf"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable7f6816cf')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk7f6816cf", "RowKey": "rk7f6816cf", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=fullmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable7f6816cf
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable7f6816cf/@Element","odata.type":"storagename.uttable7f6816cf","odata.id":"https://storagename.table.core.windows.net/uttable7f6816cf(PartitionKey=''pk7f6816cf'',RowKey=''rk7f6816cf'')","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A47.4909784Z''\"","odata.editLink":"uttable7f6816cf(PartitionKey=''pk7f6816cf'',RowKey=''rk7f6816cf'')","PartitionKey":"pk7f6816cf","RowKey":"rk7f6816cf","Timestamp@odata.type":"Edm.DateTime","Timestamp":"2020-07-30T14:24:47.4909784Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=fullmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:46 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A47.4909784Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable7f6816cf(PartitionKey='pk7f6816cf',RowKey='rk7f6816cf')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable7f6816cf')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_hook.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_hook.yaml
new file mode 100644
index 000000000000..75bec5ea8988
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_hook.yaml
@@ -0,0 +1,146 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablec092132d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablec092132d"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablec092132d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkc092132d", "RowKey": "rkc092132d", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablec092132d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablec092132d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A48.0754342Z''\"","PartitionKey":"pkc092132d","RowKey":"rkc092132d","Timestamp":"2020-07-30T14:24:48.0754342Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A48.0754342Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablec092132d(PartitionKey='pkc092132d',RowKey='rkc092132d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablec092132d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:47 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int32_value_throws.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int32_value_throws.yaml
new file mode 100644
index 000000000000..bcff74c22a4c
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int32_value_throws.yaml
@@ -0,0 +1,90 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable8fac1b18"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable8fac1b18"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable8fac1b18')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable8fac1b18')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int64_value_throws.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int64_value_throws.yaml
new file mode 100644
index 000000000000..bd233ff2d3e6
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int64_value_throws.yaml
@@ -0,0 +1,90 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable8ff51b1d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable8ff51b1d"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable8ff51b1d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable8ff51b1d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:48 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_no_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_no_metadata.yaml
new file mode 100644
index 000000000000..edb7b7fd2e84
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_no_metadata.yaml
@@ -0,0 +1,146 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable51fa15f9"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable51fa15f9"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable51fa15f9')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk51fa15f9", "RowKey": "rk51fa15f9", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=nometadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable51fa15f9
+ response:
+ body:
+ string: '{"PartitionKey":"pk51fa15f9","RowKey":"rk51fa15f9","Timestamp":"2020-07-30T14:24:49.5291129Z","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":"933311100","Birthday":"1973-10-04T00:00:00Z","birthday":"1970-10-04T00:00:00Z","binary":"YmluYXJ5","other":20,"clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=nometadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A49.5291129Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable51fa15f9(PartitionKey='pk51fa15f9',RowKey='rk51fa15f9')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable51fa15f9')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_etag.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_etag.yaml
new file mode 100644
index 000000000000..a9327ff69d6d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_etag.yaml
@@ -0,0 +1,150 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablef5f40e06"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablef5f40e06"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablef5f40e06')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkf5f40e06", "RowKey": "rkf5f40e06", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablef5f40e06
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablef5f40e06/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A50.0795467Z''\"","PartitionKey":"pkf5f40e06","RowKey":"rkf5f40e06","Timestamp":"2020-07-30T14:24:50.0795467Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:49 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A50.0795467Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablef5f40e06(PartitionKey='pkf5f40e06',RowKey='rkf5f40e06')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablef5f40e06(PartitionKey='pkf5f40e06',RowKey='rkf5f40e06')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablef5f40e06/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A50.0795467Z''\"","PartitionKey":"pkf5f40e06","RowKey":"rkf5f40e06","Timestamp":"2020-07-30T14:24:50.0795467Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A50.0795467Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_merge_entity_with_existing_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_merge_entity_with_existing_entity.yaml
new file mode 100644
index 000000000000..5ee3dba06871
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_merge_entity_with_existing_entity.yaml
@@ -0,0 +1,238 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable95761b92"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable95761b92"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable95761b92')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk95761b92", "RowKey": "rk95761b92", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable95761b92
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable95761b92/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A50.6145306Z''\"","PartitionKey":"pk95761b92","RowKey":"rk95761b92","Timestamp":"2020-07-30T14:24:50.6145306Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A50.6145306Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable95761b92(PartitionKey='pk95761b92',RowKey='rk95761b92')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk95761b92", "RowKey": "rk95761b92", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable95761b92(PartitionKey='pk95761b92',RowKey='rk95761b92')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A50.7009442Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable95761b92(PartitionKey='pk95761b92',RowKey='rk95761b92')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable95761b92/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A50.7009442Z''\"","PartitionKey":"pk95761b92","RowKey":"rk95761b92","Timestamp":"2020-07-30T14:24:50.7009442Z","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","age":"abc","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","deceased":false,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","married":true,"other":20,"ratio":3.1,"sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A50.7009442Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable95761b92')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_merge_entity_with_non_existing_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_merge_entity_with_non_existing_entity.yaml
new file mode 100644
index 000000000000..52b1d8b3b0a3
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_merge_entity_with_non_existing_entity.yaml
@@ -0,0 +1,182 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable7671d3c"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '31'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable7671d3c"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable7671d3c')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk7671d3c", "RowKey": "rk7671d3c", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '178'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable7671d3c(PartitionKey='pk7671d3c',RowKey='rk7671d3c')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A51.3754209Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable7671d3c(PartitionKey='pk7671d3c',RowKey='rk7671d3c')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable7671d3c/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A51.3754209Z''\"","PartitionKey":"pk7671d3c","RowKey":"rk7671d3c","Timestamp":"2020-07-30T14:24:51.3754209Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A51.3754209Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable7671d3c')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:50 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_replace_entity_with_existing_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_replace_entity_with_existing_entity.yaml
new file mode 100644
index 000000000000..6f34af815e19
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_replace_entity_with_existing_entity.yaml
@@ -0,0 +1,238 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablecc7c1c5e"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablecc7c1c5e"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablecc7c1c5e')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkcc7c1c5e", "RowKey": "rkcc7c1c5e", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablecc7c1c5e
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablecc7c1c5e/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A51.9816094Z''\"","PartitionKey":"pkcc7c1c5e","RowKey":"rkcc7c1c5e","Timestamp":"2020-07-30T14:24:51.9816094Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A51.9816094Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablecc7c1c5e(PartitionKey='pkcc7c1c5e',RowKey='rkcc7c1c5e')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkcc7c1c5e", "RowKey": "rkcc7c1c5e", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttablecc7c1c5e(PartitionKey='pkcc7c1c5e',RowKey='rkcc7c1c5e')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A52.0689108Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablecc7c1c5e(PartitionKey='pkcc7c1c5e',RowKey='rkcc7c1c5e')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablecc7c1c5e/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A52.0689108Z''\"","PartitionKey":"pkcc7c1c5e","RowKey":"rkcc7c1c5e","Timestamp":"2020-07-30T14:24:52.0689108Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A52.0689108Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablecc7c1c5e')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:51 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_replace_entity_with_non_existing_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_replace_entity_with_non_existing_entity.yaml
new file mode 100644
index 000000000000..e10757f57cbb
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_or_replace_entity_with_non_existing_entity.yaml
@@ -0,0 +1,182 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable419d1e08"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable419d1e08"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable419d1e08')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk419d1e08", "RowKey": "rk419d1e08", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable419d1e08(PartitionKey='pk419d1e08',RowKey='rk419d1e08')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A52.7533942Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable419d1e08(PartitionKey='pk419d1e08',RowKey='rk419d1e08')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable419d1e08/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A52.7533942Z''\"","PartitionKey":"pk419d1e08","RowKey":"rk419d1e08","Timestamp":"2020-07-30T14:24:52.7533942Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A52.7533942Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable419d1e08')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:52 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity.yaml
new file mode 100644
index 000000000000..648d07dc0210
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity.yaml
@@ -0,0 +1,240 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3df0e7d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '31'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3df0e7d"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable3df0e7d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk3df0e7d", "RowKey": "rk3df0e7d", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '535'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable3df0e7d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable3df0e7d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A53.3764814Z''\"","PartitionKey":"pk3df0e7d","RowKey":"rk3df0e7d","Timestamp":"2020-07-30T14:24:53.3764814Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A53.3764814Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable3df0e7d(PartitionKey='pk3df0e7d',RowKey='rk3df0e7d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk3df0e7d", "RowKey": "rk3df0e7d", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '178'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable3df0e7d(PartitionKey='pk3df0e7d',RowKey='rk3df0e7d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A53.472903Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable3df0e7d(PartitionKey='pk3df0e7d',RowKey='rk3df0e7d')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable3df0e7d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A53.472903Z''\"","PartitionKey":"pk3df0e7d","RowKey":"rk3df0e7d","Timestamp":"2020-07-30T14:24:53.472903Z","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","age":"abc","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","deceased":false,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","married":true,"other":20,"ratio":3.1,"sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A53.472903Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3df0e7d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_not_existing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_not_existing.yaml
new file mode 100644
index 000000000000..c4c0d07e89a1
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_not_existing.yaml
@@ -0,0 +1,145 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee64a13f7"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee64a13f7"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablee64a13f7')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pke64a13f7", "RowKey": "rke64a13f7", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttablee64a13f7(PartitionKey='pke64a13f7',RowKey='rke64a13f7')
+ response:
+ body:
+ string: 'ResourceNotFound
The specified resource does not exist.
+
+ RequestId:f68387d3-2002-005e-187d-665afa000000
+
+ Time:2020-07-30T14:24:54.1053791Z'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/xml;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee64a13f7')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:53 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_with_if_doesnt_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_with_if_doesnt_match.yaml
new file mode 100644
index 000000000000..cb0cecb749e4
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_with_if_doesnt_match.yaml
@@ -0,0 +1,201 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable9316171e"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable9316171e"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable9316171e')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk9316171e", "RowKey": "rk9316171e", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable9316171e
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable9316171e/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A54.6804392Z''\"","PartitionKey":"pk9316171e","RowKey":"rk9316171e","Timestamp":"2020-07-30T14:24:54.6804392Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A54.6804392Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable9316171e(PartitionKey='pk9316171e',RowKey='rk9316171e')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk9316171e", "RowKey": "rk9316171e", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ If-Match:
+ - W/"datetime'2012-06-15T22%3A51%3A44.9662825Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable9316171e(PartitionKey='pk9316171e',RowKey='rk9316171e')
+ response:
+ body:
+ string: 'UpdateConditionNotSatisfied
The update condition specified in the request was not satisfied.
+
+ RequestId:9f1812d1-3002-004a-537d-66999e000000
+
+ Time:2020-07-30T14:24:54.7644978Z'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/xml;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 412
+ message: Precondition Failed
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable9316171e')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_with_if_matches.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_with_if_matches.yaml
new file mode 100644
index 000000000000..9521b0437825
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_merge_entity_with_if_matches.yaml
@@ -0,0 +1,240 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable236c150a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable236c150a"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable236c150a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk236c150a", "RowKey": "rk236c150a", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable236c150a
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable236c150a/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A55.315605Z''\"","PartitionKey":"pk236c150a","RowKey":"rk236c150a","Timestamp":"2020-07-30T14:24:55.315605Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A55.315605Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable236c150a(PartitionKey='pk236c150a',RowKey='rk236c150a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk236c150a", "RowKey": "rk236c150a", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ If-Match:
+ - W/"datetime'2020-07-30T14%3A24%3A55.315605Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable236c150a(PartitionKey='pk236c150a',RowKey='rk236c150a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A55.4002652Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable236c150a(PartitionKey='pk236c150a',RowKey='rk236c150a')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable236c150a/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A55.4002652Z''\"","PartitionKey":"pk236c150a","RowKey":"rk236c150a","Timestamp":"2020-07-30T14:24:55.4002652Z","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","age":"abc","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","deceased":false,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","married":true,"other":20,"ratio":3.1,"sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A55.4002652Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable236c150a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_none_property_value.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_none_property_value.yaml
new file mode 100644
index 000000000000..77cea668a83e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_none_property_value.yaml
@@ -0,0 +1,184 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable76561181"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable76561181"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:54 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable76561181')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk76561181", "RowKey": "rk76561181"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '54'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable76561181
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable76561181/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A56.0435707Z''\"","PartitionKey":"pk76561181","RowKey":"rk76561181","Timestamp":"2020-07-30T14:24:56.0435707Z"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A56.0435707Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable76561181(PartitionKey='pk76561181',RowKey='rk76561181')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable76561181(PartitionKey='pk76561181',RowKey='rk76561181')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable76561181/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A56.0435707Z''\"","PartitionKey":"pk76561181","RowKey":"rk76561181","Timestamp":"2020-07-30T14:24:56.0435707Z"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A56.0435707Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable76561181')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:55 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_operations_on_entity_with_partition_key_having_single_quote.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_operations_on_entity_with_partition_key_having_single_quote.yaml
new file mode 100644
index 000000000000..d19c247f7358
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_operations_on_entity_with_partition_key_having_single_quote.yaml
@@ -0,0 +1,376 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable88682233"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable88682233"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable88682233')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "a''''''''b", "RowKey": "a''''''''b", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '529'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable88682233
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable88682233/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A56.6959097Z''\"","PartitionKey":"a''''''''b","RowKey":"a''''''''b","Timestamp":"2020-07-30T14:24:56.6959097Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A56.6959097Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable88682233(PartitionKey='a''''''''b',RowKey='a''''''''b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "a''''''''b", "RowKey": "a''''''''b", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '172'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable88682233(PartitionKey='a%27%27%27%27b',RowKey='a%27%27%27%27b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A56.7922489Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable88682233(PartitionKey='a%27%27%27%27b',RowKey='a%27%27%27%27b')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable88682233/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A56.7922489Z''\"","PartitionKey":"a''''b","RowKey":"a''''b","Timestamp":"2020-07-30T14:24:56.7922489Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A56.7922489Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: '{"PartitionKey": "a''''''''b", "RowKey": "a''''''''b", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime", "newField": "newFieldValue"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '201'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable88682233(PartitionKey='a%27%27%27%27b',RowKey='a%27%27%27%27b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A56.9733775Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable88682233(PartitionKey='a%27%27%27%27b',RowKey='a%27%27%27%27b')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable88682233/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A56.9733775Z''\"","PartitionKey":"a''''b","RowKey":"a''''b","Timestamp":"2020-07-30T14:24:56.9733775Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","newField":"newFieldValue","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A56.9733775Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttable88682233(PartitionKey='a%27%27%27%27b',RowKey='a%27%27%27%27b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable88682233')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities.yaml
new file mode 100644
index 000000000000..4e5f6e3fd8b1
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities.yaml
@@ -0,0 +1,332 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable23930f6b"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable23930f6b"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable23930f6b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "querytable23930f6b"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable23930f6b"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('querytable23930f6b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk23930f6b", "RowKey": "rk23930f6b1", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable23930f6b
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable23930f6b/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A57.7802038Z''\"","PartitionKey":"pk23930f6b","RowKey":"rk23930f6b1","Timestamp":"2020-07-30T14:24:57.7802038Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A57.7802038Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable23930f6b(PartitionKey='pk23930f6b',RowKey='rk23930f6b1')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk23930f6b", "RowKey": "rk23930f6b12", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable23930f6b
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable23930f6b/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A57.8612602Z''\"","PartitionKey":"pk23930f6b","RowKey":"rk23930f6b12","Timestamp":"2020-07-30T14:24:57.8612602Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:56 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A57.8612602Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable23930f6b(PartitionKey='pk23930f6b',RowKey='rk23930f6b12')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable23930f6b()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable23930f6b","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A57.7802038Z''\"","PartitionKey":"pk23930f6b","RowKey":"rk23930f6b1","Timestamp":"2020-07-30T14:24:57.7802038Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A57.8612602Z''\"","PartitionKey":"pk23930f6b","RowKey":"rk23930f6b12","Timestamp":"2020-07-30T14:24:57.8612602Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable23930f6b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable23930f6b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:57 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_full_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_full_metadata.yaml
new file mode 100644
index 000000000000..e7e6c815aa16
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_full_metadata.yaml
@@ -0,0 +1,332 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable264f151d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable264f151d"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable264f151d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "querytable264f151d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable264f151d"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('querytable264f151d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk264f151d", "RowKey": "rk264f151d1", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable264f151d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable264f151d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A58.6636662Z''\"","PartitionKey":"pk264f151d","RowKey":"rk264f151d1","Timestamp":"2020-07-30T14:24:58.6636662Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A58.6636662Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable264f151d(PartitionKey='pk264f151d',RowKey='rk264f151d1')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk264f151d", "RowKey": "rk264f151d12", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable264f151d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable264f151d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A58.746726Z''\"","PartitionKey":"pk264f151d","RowKey":"rk264f151d12","Timestamp":"2020-07-30T14:24:58.746726Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A58.746726Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable264f151d(PartitionKey='pk264f151d',RowKey='rk264f151d12')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ accept:
+ - application/json;odata=fullmetadata
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable264f151d()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable264f151d","value":[{"odata.type":"storagename.querytable264f151d","odata.id":"https://storagename.table.core.windows.net/querytable264f151d(PartitionKey=''pk264f151d'',RowKey=''rk264f151d1'')","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A58.6636662Z''\"","odata.editLink":"querytable264f151d(PartitionKey=''pk264f151d'',RowKey=''rk264f151d1'')","PartitionKey":"pk264f151d","RowKey":"rk264f151d1","Timestamp@odata.type":"Edm.DateTime","Timestamp":"2020-07-30T14:24:58.6636662Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.type":"storagename.querytable264f151d","odata.id":"https://storagename.table.core.windows.net/querytable264f151d(PartitionKey=''pk264f151d'',RowKey=''rk264f151d12'')","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A58.746726Z''\"","odata.editLink":"querytable264f151d(PartitionKey=''pk264f151d'',RowKey=''rk264f151d12'')","PartitionKey":"pk264f151d","RowKey":"rk264f151d12","Timestamp@odata.type":"Edm.DateTime","Timestamp":"2020-07-30T14:24:58.746726Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=fullmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable264f151d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable264f151d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_no_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_no_metadata.yaml
new file mode 100644
index 000000000000..9f2fd09f46d3
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_no_metadata.yaml
@@ -0,0 +1,332 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablefc361447"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablefc361447"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablefc361447')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "querytablefc361447"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytablefc361447"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('querytablefc361447')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkfc361447", "RowKey": "rkfc3614471", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytablefc361447
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablefc361447/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A59.5774073Z''\"","PartitionKey":"pkfc361447","RowKey":"rkfc3614471","Timestamp":"2020-07-30T14:24:59.5774073Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A59.5774073Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytablefc361447(PartitionKey='pkfc361447',RowKey='rkfc3614471')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkfc361447", "RowKey": "rkfc36144712", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytablefc361447
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablefc361447/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A24%3A59.6594639Z''\"","PartitionKey":"pkfc361447","RowKey":"rkfc36144712","Timestamp":"2020-07-30T14:24:59.6594639Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A24%3A59.6594639Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytablefc361447(PartitionKey='pkfc361447',RowKey='rkfc36144712')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ accept:
+ - application/json;odata=nometadata
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytablefc361447()
+ response:
+ body:
+ string: '{"value":[{"PartitionKey":"pkfc361447","RowKey":"rkfc3614471","Timestamp":"2020-07-30T14:24:59.5774073Z","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":"933311100","Birthday":"1973-10-04T00:00:00Z","birthday":"1970-10-04T00:00:00Z","binary":"YmluYXJ5","other":20,"clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"PartitionKey":"pkfc361447","RowKey":"rkfc36144712","Timestamp":"2020-07-30T14:24:59.6594639Z","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":"933311100","Birthday":"1973-10-04T00:00:00Z","birthday":"1970-10-04T00:00:00Z","binary":"YmluYXJ5","other":20,"clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=nometadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablefc361447')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytablefc361447')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:24:58 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_filter.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_filter.yaml
new file mode 100644
index 000000000000..41550d407e7f
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_filter.yaml
@@ -0,0 +1,188 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablefce8146b"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablefce8146b"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablefce8146b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkfce8146b", "RowKey": "rkfce8146b", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablefce8146b
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablefce8146b/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A00.3672487Z''\"","PartitionKey":"pkfce8146b","RowKey":"rkfce8146b","Timestamp":"2020-07-30T14:25:00.3672487Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A00.3672487Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablefce8146b(PartitionKey='pkfce8146b',RowKey='rkfce8146b')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablefce8146b()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablefce8146b","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A00.3672487Z''\"","PartitionKey":"pkfce8146b","RowKey":"rkfce8146b","Timestamp":"2020-07-30T14:25:00.3672487Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:24:59 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablefce8146b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_select.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_select.yaml
new file mode 100644
index 000000000000..dd49e745767a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_select.yaml
@@ -0,0 +1,332 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablefcf31465"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablefcf31465"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablefcf31465')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "querytablefcf31465"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytablefcf31465"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('querytablefcf31465')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkfcf31465", "RowKey": "rkfcf314651", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytablefcf31465
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablefcf31465/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A01.0987797Z''\"","PartitionKey":"pkfcf31465","RowKey":"rkfcf314651","Timestamp":"2020-07-30T14:25:01.0987797Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A01.0987797Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytablefcf31465(PartitionKey='pkfcf31465',RowKey='rkfcf314651')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkfcf31465", "RowKey": "rkfcf3146512", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytablefcf31465
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablefcf31465/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A01.1808356Z''\"","PartitionKey":"pkfcf31465","RowKey":"rkfcf3146512","Timestamp":"2020-07-30T14:25:01.1808356Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A01.1808356Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytablefcf31465(PartitionKey='pkfcf31465',RowKey='rkfcf3146512')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytablefcf31465()?$select=age%2C%20sex
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablefcf31465&$select=age,%20sex","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A01.0987797Z''\"","age@odata.type":"Edm.Int64","age":"39","sex":"male"},{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A01.1808356Z''\"","age@odata.type":"Edm.Int64","age":"39","sex":"male"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablefcf31465')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytablefcf31465')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_top.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_top.yaml
new file mode 100644
index 000000000000..40d595f1f4e9
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_top.yaml
@@ -0,0 +1,392 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablec12a1338"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablec12a1338"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablec12a1338')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "querytablec12a1338"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytablec12a1338"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:00 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('querytablec12a1338')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkc12a1338", "RowKey": "rkc12a13381", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytablec12a1338
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablec12a1338/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A01.9958858Z''\"","PartitionKey":"pkc12a1338","RowKey":"rkc12a13381","Timestamp":"2020-07-30T14:25:01.9958858Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A01.9958858Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytablec12a1338(PartitionKey='pkc12a1338',RowKey='rkc12a13381')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkc12a1338", "RowKey": "rkc12a133812", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytablec12a1338
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablec12a1338/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A02.078943Z''\"","PartitionKey":"pkc12a1338","RowKey":"rkc12a133812","Timestamp":"2020-07-30T14:25:02.078943Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A02.078943Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytablec12a1338(PartitionKey='pkc12a1338',RowKey='rkc12a133812')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkc12a1338", "RowKey": "rkc12a1338123", "age": "39",
+ "age@odata.type": "Edm.Int64", "sex": "male", "married": true, "deceased": false,
+ "ratio": 3.1, "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64",
+ "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday":
+ "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5",
+ "binary@odata.type": "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '540'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytablec12a1338
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablec12a1338/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A02.1620006Z''\"","PartitionKey":"pkc12a1338","RowKey":"rkc12a1338123","Timestamp":"2020-07-30T14:25:02.1620006Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A02.1620006Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytablec12a1338(PartitionKey='pkc12a1338',RowKey='rkc12a1338123')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytablec12a1338()?$top=2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablec12a1338","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A01.9958858Z''\"","PartitionKey":"pkc12a1338","RowKey":"rkc12a13381","Timestamp":"2020-07-30T14:25:01.9958858Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A02.078943Z''\"","PartitionKey":"pkc12a1338","RowKey":"rkc12a133812","Timestamp":"2020-07-30T14:25:02.078943Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nextpartitionkey:
+ - 1!16!cGtjMTJhMTMzOA--
+ x-ms-continuation-nextrowkey:
+ - 1!20!cmtjMTJhMTMzODEyMw--
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablec12a1338')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytablec12a1338')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:01 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_top_and_next.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_top_and_next.yaml
new file mode 100644
index 000000000000..80a534233671
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_entities_with_top_and_next.yaml
@@ -0,0 +1,592 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable801016e8"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable801016e8"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable801016e8')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "querytable801016e8"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable801016e8"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('querytable801016e8')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk801016e8", "RowKey": "rk801016e81", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable801016e8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable801016e8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.0268879Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e81","Timestamp":"2020-07-30T14:25:03.0268879Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A03.0268879Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable801016e8(PartitionKey='pk801016e8',RowKey='rk801016e81')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk801016e8", "RowKey": "rk801016e812", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable801016e8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable801016e8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.1149487Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e812","Timestamp":"2020-07-30T14:25:03.1149487Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A03.1149487Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable801016e8(PartitionKey='pk801016e8',RowKey='rk801016e812')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk801016e8", "RowKey": "rk801016e8123", "age": "39",
+ "age@odata.type": "Edm.Int64", "sex": "male", "married": true, "deceased": false,
+ "ratio": 3.1, "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64",
+ "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday":
+ "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5",
+ "binary@odata.type": "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '540'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable801016e8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable801016e8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.2050103Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e8123","Timestamp":"2020-07-30T14:25:03.2050103Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:02 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A03.2050103Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable801016e8(PartitionKey='pk801016e8',RowKey='rk801016e8123')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk801016e8", "RowKey": "rk801016e81234", "age": "39",
+ "age@odata.type": "Edm.Int64", "sex": "male", "married": true, "deceased": false,
+ "ratio": 3.1, "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64",
+ "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday":
+ "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5",
+ "binary@odata.type": "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '541'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable801016e8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable801016e8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.2880679Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e81234","Timestamp":"2020-07-30T14:25:03.2880679Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A03.2880679Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable801016e8(PartitionKey='pk801016e8',RowKey='rk801016e81234')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk801016e8", "RowKey": "rk801016e812345", "age": "39",
+ "age@odata.type": "Edm.Int64", "sex": "male", "married": true, "deceased": false,
+ "ratio": 3.1, "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64",
+ "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday":
+ "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5",
+ "binary@odata.type": "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '542'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable801016e8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable801016e8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.37713Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e812345","Timestamp":"2020-07-30T14:25:03.37713Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A03.37713Z'"
+ location:
+ - https://storagename.table.core.windows.net/querytable801016e8(PartitionKey='pk801016e8',RowKey='rk801016e812345')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable801016e8()?$top=2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable801016e8","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.0268879Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e81","Timestamp":"2020-07-30T14:25:03.0268879Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.1149487Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e812","Timestamp":"2020-07-30T14:25:03.1149487Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nextpartitionkey:
+ - 1!16!cGs4MDEwMTZlOA--
+ x-ms-continuation-nextrowkey:
+ - 1!20!cms4MDEwMTZlODEyMw--
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable801016e8()?$top=2&NextPartitionKey=1%2116%21cGs4MDEwMTZlOA--&NextRowKey=1%2120%21cms4MDEwMTZlODEyMw--
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable801016e8","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.2050103Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e8123","Timestamp":"2020-07-30T14:25:03.2050103Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.2880679Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e81234","Timestamp":"2020-07-30T14:25:03.2880679Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-continuation-nextpartitionkey:
+ - 1!16!cGs4MDEwMTZlOA--
+ x-ms-continuation-nextrowkey:
+ - 1!20!cms4MDEwMTZlODEyMzQ1
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable801016e8()?$top=2&NextPartitionKey=1%2116%21cGs4MDEwMTZlOA--&NextRowKey=1%2120%21cms4MDEwMTZlODEyMzQ1
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable801016e8","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A03.37713Z''\"","PartitionKey":"pk801016e8","RowKey":"rk801016e812345","Timestamp":"2020-07-30T14:25:03.37713Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable801016e8')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable801016e8')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_user_filter.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_user_filter.yaml
new file mode 100644
index 000000000000..fbdc0cb13d7f
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_user_filter.yaml
@@ -0,0 +1,146 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable546210aa"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable546210aa"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable546210aa')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk546210aa", "RowKey": "rk546210aa", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable546210aa
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable546210aa/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A04.3123943Z''\"","PartitionKey":"pk546210aa","RowKey":"rk546210aa","Timestamp":"2020-07-30T14:25:04.3123943Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A04.3123943Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable546210aa(PartitionKey='pk546210aa',RowKey='rk546210aa')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable546210aa')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:03 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_zero_entities.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_zero_entities.yaml
new file mode 100644
index 000000000000..df02d5f78c5e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_zero_entities.yaml
@@ -0,0 +1,220 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable7732118a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable7732118a"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable7732118a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"TableName": "querytable7732118a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable7732118a"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('querytable7732118a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable7732118a()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable7732118a","value":[]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable7732118a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable7732118a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add.yaml
new file mode 100644
index 000000000000..27f94ab56ad1
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add.yaml
@@ -0,0 +1,190 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablebfd90c40"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablebfd90c40"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:04 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablebfd90c40')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkbfd90c40", "RowKey": "rkbfd90c40", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablebfd90c40?st=2020-07-30T14%3A24%3A06Z&se=2020-07-30T15%3A25%3A06Z&sp=a&sv=2019-07-07&tn=uttablebfd90c40&sig=fXD4tI6Ue%2BNF%2F90e81hMVWjUVL7IJ4zZi0oKy4DRJkg%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablebfd90c40/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A05.9288095Z''\"","PartitionKey":"pkbfd90c40","RowKey":"rkbfd90c40","Timestamp":"2020-07-30T14:25:05.9288095Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A05.9288095Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablebfd90c40(PartitionKey='pkbfd90c40',RowKey='rkbfd90c40')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablebfd90c40(PartitionKey='pkbfd90c40',RowKey='rkbfd90c40')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablebfd90c40/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A05.9288095Z''\"","PartitionKey":"pkbfd90c40","RowKey":"rkbfd90c40","Timestamp":"2020-07-30T14:25:05.9288095Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A05.9288095Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablebfd90c40')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add_inside_range.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add_inside_range.yaml
new file mode 100644
index 000000000000..7a83eed91406
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add_inside_range.yaml
@@ -0,0 +1,190 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable84281187"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable84281187"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:05 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable84281187')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "test", "RowKey": "test1", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '526'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable84281187?se=2020-07-30T15%3A25%3A07Z&sp=a&sv=2019-07-07&tn=uttable84281187&spk=test&srk=test1&epk=test&erk=test1&sig=S2LAuFVQfomgXS986%2B%2FHTujEcgJd9vd1gsNXXHKC4yc%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable84281187/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A06.8043504Z''\"","PartitionKey":"test","RowKey":"test1","Timestamp":"2020-07-30T14:25:06.8043504Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A06.8043504Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable84281187(PartitionKey='test',RowKey='test1')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable84281187(PartitionKey='test',RowKey='test1')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable84281187/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A06.8043504Z''\"","PartitionKey":"test","RowKey":"test1","Timestamp":"2020-07-30T14:25:06.8043504Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A06.8043504Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable84281187')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add_outside_range.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add_outside_range.yaml
new file mode 100644
index 000000000000..2156c8f4bdc9
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_add_outside_range.yaml
@@ -0,0 +1,143 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable973c1208"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable973c1208"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable973c1208')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk973c1208", "RowKey": "rk973c1208", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable973c1208?se=2020-07-30T15%3A25%3A08Z&sp=a&sv=2019-07-07&tn=uttable973c1208&spk=test&srk=test1&epk=test&erk=test1&sig=F%2FW5DJ9FV2uXi1DUTqRdhnMLoPz%2FYCWId2%2Fsh6icCrY%3D
+ response:
+ body:
+ string: '{"odata.error":{"code":"AuthorizationFailure","message":{"lang":"en-US","value":"This
+ request is not authorized to perform this operation.\nRequestId:56758a81-e002-0025-787d-66314a000000\nTime:2020-07-30T14:25:07.6660493Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 403
+ message: Forbidden
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable973c1208')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:06 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_delete.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_delete.yaml
new file mode 100644
index 000000000000..17a4f55d50e1
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_delete.yaml
@@ -0,0 +1,233 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee74c0d8a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee74c0d8a"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablee74c0d8a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pke74c0d8a", "RowKey": "rke74c0d8a", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablee74c0d8a
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee74c0d8a/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A08.1834177Z''\"","PartitionKey":"pke74c0d8a","RowKey":"rke74c0d8a","Timestamp":"2020-07-30T14:25:08.1834177Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:07 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A08.1834177Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablee74c0d8a(PartitionKey='pke74c0d8a',RowKey='rke74c0d8a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttablee74c0d8a(PartitionKey='pke74c0d8a',RowKey='rke74c0d8a')?se=2020-07-30T15%3A25%3A09Z&sp=d&sv=2019-07-07&tn=uttablee74c0d8a&sig=yWEPg2BaMpgc%2FTwPzDc4OZ7X5Fz3RXfBqmRoDk9Ua6w%3D
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablee74c0d8a(PartitionKey='pke74c0d8a',RowKey='rke74c0d8a')
+ response:
+ body:
+ string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
+ specified resource does not exist.\nRequestId:cdb8df15-4002-004e-4a7d-666c1c000000\nTime:2020-07-30T14:25:08.6067193Z"}}}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee74c0d8a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_query.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_query.yaml
new file mode 100644
index 000000000000..b30f1b3d21da
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_query.yaml
@@ -0,0 +1,188 @@
+interactions:
+- request:
+ body: '{"TableName": "uttableda4d0d4d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableda4d0d4d"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttableda4d0d4d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkda4d0d4d", "RowKey": "rkda4d0d4d", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableda4d0d4d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableda4d0d4d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A09.1350748Z''\"","PartitionKey":"pkda4d0d4d","RowKey":"rkda4d0d4d","Timestamp":"2020-07-30T14:25:09.1350748Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A09.1350748Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttableda4d0d4d(PartitionKey='pkda4d0d4d',RowKey='rkda4d0d4d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttableda4d0d4d()?st=2020-07-30T14%3A24%3A10Z&se=2020-07-30T15%3A25%3A10Z&sp=r&sv=2019-07-07&tn=uttableda4d0d4d&sig=bQ%2B%2B8KMyjEm7PxTOx86odItfh9AXPrCfS%2FmgY6r617o%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableda4d0d4d","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A09.1350748Z''\"","PartitionKey":"pkda4d0d4d","RowKey":"rkda4d0d4d","Timestamp":"2020-07-30T14:25:09.1350748Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttableda4d0d4d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:08 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_signed_identifier.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_signed_identifier.yaml
new file mode 100644
index 000000000000..f8ed3b5f4489
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_signed_identifier.yaml
@@ -0,0 +1,228 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable979d1213"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable979d1213"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable979d1213')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk979d1213", "RowKey": "rk979d1213", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable979d1213
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable979d1213/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A10.0244191Z''\"","PartitionKey":"pk979d1213","RowKey":"rk979d1213","Timestamp":"2020-07-30T14:25:10.0244191Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A10.0244191Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable979d1213(PartitionKey='pk979d1213',RowKey='rk979d1213')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '
+
+ testid2011-10-11T00:00:00Z2020-10-12T00:00:00Zr'
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '257'
+ Content-Type:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable979d1213?comp=acl
+ response:
+ body:
+ string: ''
+ headers:
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable979d1213()?sv=2019-07-07&si=testid&tn=uttable979d1213&sig=s6voo8dUkMGlXXy3%2FS%2BbgXhkjKFiLpJ%2B%2Fq2QspO6%2BHM%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable979d1213","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A10.0244191Z''\"","PartitionKey":"pk979d1213","RowKey":"rk979d1213","Timestamp":"2020-07-30T14:25:10.0244191Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable979d1213')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_update.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_update.yaml
new file mode 100644
index 000000000000..e8914f67f1cf
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_update.yaml
@@ -0,0 +1,240 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee7bd0d9a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee7bd0d9a"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:09 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablee7bd0d9a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pke7bd0d9a", "RowKey": "rke7bd0d9a", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablee7bd0d9a
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee7bd0d9a/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A11.0242053Z''\"","PartitionKey":"pke7bd0d9a","RowKey":"rke7bd0d9a","Timestamp":"2020-07-30T14:25:11.0242053Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A11.0242053Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablee7bd0d9a(PartitionKey='pke7bd0d9a',RowKey='rke7bd0d9a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pke7bd0d9a", "RowKey": "rke7bd0d9a", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttablee7bd0d9a(PartitionKey='pke7bd0d9a',RowKey='rke7bd0d9a')?se=2020-07-30T15%3A25%3A12Z&sp=u&sv=2019-07-07&tn=uttablee7bd0d9a&sig=Pu2Z4pva64F7RmLbcF3imXIGa16lfySNc%2Fgg7h2Kfxk%3D
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A11.3945698Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablee7bd0d9a(PartitionKey='pke7bd0d9a',RowKey='rke7bd0d9a')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee7bd0d9a/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A11.3945698Z''\"","PartitionKey":"pke7bd0d9a","RowKey":"rke7bd0d9a","Timestamp":"2020-07-30T14:25:11.3945698Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A11.3945698Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee7bd0d9a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:10 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_upper_case_table_name.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_upper_case_table_name.yaml
new file mode 100644
index 000000000000..0b3676aac171
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_sas_upper_case_table_name.yaml
@@ -0,0 +1,188 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee48713a5"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee48713a5"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablee48713a5')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pke48713a5", "RowKey": "rke48713a5", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablee48713a5
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee48713a5/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A12.0637078Z''\"","PartitionKey":"pke48713a5","RowKey":"rke48713a5","Timestamp":"2020-07-30T14:25:12.0637078Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:11 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A12.0637078Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttablee48713a5(PartitionKey='pke48713a5',RowKey='rke48713a5')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablee48713a5()?st=2020-07-30T14%3A24%3A13Z&se=2020-07-30T15%3A25%3A13Z&sp=r&sv=2019-07-07&tn=UTTABLEE48713A5&sig=c55VGZIwHLTfBkqqVOl8pyJj%2BlAOJfxp3O5Znm4typg%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee48713a5","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A12.0637078Z''\"","PartitionKey":"pke48713a5","RowKey":"rke48713a5","Timestamp":"2020-07-30T14:25:12.0637078Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee48713a5')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_timezone.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_timezone.yaml
new file mode 100644
index 000000000000..90d266e0bb83
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_timezone.yaml
@@ -0,0 +1,245 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablecd510cdc"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+<<<<<<< HEAD
+ - Mon, 20 Jul 2020 13:33:55 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 20 Jul 2020 13:33:55 GMT
+=======
+ - Thu, 02 Jul 2020 17:25:01 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 02 Jul 2020 17:25:01 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablecd510cdc"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+<<<<<<< HEAD
+ - Mon, 20 Jul 2020 13:33:50 GMT
+=======
+ - Thu, 02 Jul 2020 17:24:58 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablecd510cdc')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkcd510cdc", "RowKey": "rkcd510cdc", "date": "2003-09-27T09:52:43Z",
+ "date@odata.type": "Edm.DateTime"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '121'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+<<<<<<< HEAD
+ - Mon, 20 Jul 2020 13:33:55 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 20 Jul 2020 13:33:55 GMT
+=======
+ - Thu, 02 Jul 2020 17:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 02 Jul 2020 17:25:02 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablecd510cdc
+ response:
+ body:
+<<<<<<< HEAD
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablecd510cdc/@Element","odata.etag":"W/\"datetime''2020-07-20T13%3A33%3A51.7472327Z''\"","PartitionKey":"pkcd510cdc","RowKey":"rkcd510cdc","Timestamp":"2020-07-20T13:33:51.7472327Z","date@odata.type":"Edm.DateTime","date":"2003-09-27T09:52:43Z"}'
+=======
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablecd510cdc/@Element","odata.etag":"W/\"datetime''2020-07-02T17%3A24%3A59.5396317Z''\"","PartitionKey":"pkcd510cdc","RowKey":"rkcd510cdc","Timestamp":"2020-07-02T17:24:59.5396317Z","date@odata.type":"Edm.DateTime","date":"2003-09-27T09:52:43Z"}'
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+<<<<<<< HEAD
+ - Mon, 20 Jul 2020 13:33:50 GMT
+ etag:
+ - W/"datetime'2020-07-20T13%3A33%3A51.7472327Z'"
+=======
+ - Thu, 02 Jul 2020 17:24:58 GMT
+ etag:
+ - W/"datetime'2020-07-02T17%3A24%3A59.5396317Z'"
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ location:
+ - https://storagename.table.core.windows.net/uttablecd510cdc(PartitionKey='pkcd510cdc',RowKey='rkcd510cdc')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+<<<<<<< HEAD
+ - Mon, 20 Jul 2020 13:33:56 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 20 Jul 2020 13:33:56 GMT
+=======
+ - Thu, 02 Jul 2020 17:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 02 Jul 2020 17:25:02 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablecd510cdc(PartitionKey='pkcd510cdc',RowKey='rkcd510cdc')
+ response:
+ body:
+<<<<<<< HEAD
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablecd510cdc/@Element","odata.etag":"W/\"datetime''2020-07-20T13%3A33%3A51.7472327Z''\"","PartitionKey":"pkcd510cdc","RowKey":"rkcd510cdc","Timestamp":"2020-07-20T13:33:51.7472327Z","date@odata.type":"Edm.DateTime","date":"2003-09-27T09:52:43Z"}'
+=======
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablecd510cdc/@Element","odata.etag":"W/\"datetime''2020-07-02T17%3A24%3A59.5396317Z''\"","PartitionKey":"pkcd510cdc","RowKey":"rkcd510cdc","Timestamp":"2020-07-02T17:24:59.5396317Z","date@odata.type":"Edm.DateTime","date":"2003-09-27T09:52:43Z"}'
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+<<<<<<< HEAD
+ - Mon, 20 Jul 2020 13:33:50 GMT
+ etag:
+ - W/"datetime'2020-07-20T13%3A33%3A51.7472327Z'"
+=======
+ - Thu, 02 Jul 2020 17:24:59 GMT
+ etag:
+ - W/"datetime'2020-07-02T17%3A24%3A59.5396317Z'"
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+<<<<<<< HEAD
+ - Mon, 20 Jul 2020 13:33:56 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 20 Jul 2020 13:33:56 GMT
+=======
+ - Thu, 02 Jul 2020 17:25:02 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 02 Jul 2020 17:25:02 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablecd510cdc')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+<<<<<<< HEAD
+ - Mon, 20 Jul 2020 13:33:50 GMT
+=======
+ - Thu, 02 Jul 2020 17:24:59 GMT
+>>>>>>> 8bdf4dab46b1d77ee840080c15bb142508964575
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_unicode_property_name.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_unicode_property_name.yaml
new file mode 100644
index 000000000000..44416b07b555
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_unicode_property_name.yaml
@@ -0,0 +1,234 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable9990123c"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable9990123c"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable9990123c')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk9990123c", "RowKey": "rk9990123c", "\u554a\u9f44\u4e02\u72db\u72dc":
+ "\ua015"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '98'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable9990123c
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable9990123c/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A12.9807488Z''\"","PartitionKey":"pk9990123c","RowKey":"rk9990123c","Timestamp":"2020-07-30T14:25:12.9807488Z","\u554a\u9f44\u4e02\u72db\u72dc":"\ua015"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A12.9807488Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable9990123c(PartitionKey='pk9990123c',RowKey='rk9990123c')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk9990123c", "RowKey": "test2", "\u554a\u9f44\u4e02\u72db\u72dc":
+ "hello"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '92'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable9990123c
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable9990123c/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A13.0678085Z''\"","PartitionKey":"pk9990123c","RowKey":"test2","Timestamp":"2020-07-30T14:25:13.0678085Z","\u554a\u9f44\u4e02\u72db\u72dc":"hello"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A13.0678085Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable9990123c(PartitionKey='pk9990123c',RowKey='test2')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable9990123c()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable9990123c","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A12.9807488Z''\"","PartitionKey":"pk9990123c","RowKey":"rk9990123c","Timestamp":"2020-07-30T14:25:12.9807488Z","\u554a\u9f44\u4e02\u72db\u72dc":"\ua015"},{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A13.0678085Z''\"","PartitionKey":"pk9990123c","RowKey":"test2","Timestamp":"2020-07-30T14:25:13.0678085Z","\u554a\u9f44\u4e02\u72db\u72dc":"hello"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable9990123c')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_unicode_property_value.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_unicode_property_value.yaml
new file mode 100644
index 000000000000..77aaaf12be36
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_unicode_property_value.yaml
@@ -0,0 +1,232 @@
+interactions:
+- request:
+ body: '{"TableName": "uttableac7612b8"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableac7612b8"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:12 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttableac7612b8')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkac7612b8", "RowKey": "rkac7612b8", "Description": "\ua015"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '79'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableac7612b8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableac7612b8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A13.7006244Z''\"","PartitionKey":"pkac7612b8","RowKey":"rkac7612b8","Timestamp":"2020-07-30T14:25:13.7006244Z","Description":"\ua015"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A13.7006244Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttableac7612b8(PartitionKey='pkac7612b8',RowKey='rkac7612b8')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkac7612b8", "RowKey": "test2", "Description": "\ua015"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '74'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableac7612b8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableac7612b8/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A13.7896884Z''\"","PartitionKey":"pkac7612b8","RowKey":"test2","Timestamp":"2020-07-30T14:25:13.7896884Z","Description":"\ua015"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A13.7896884Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttableac7612b8(PartitionKey='pkac7612b8',RowKey='test2')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttableac7612b8()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableac7612b8","value":[{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A13.7006244Z''\"","PartitionKey":"pkac7612b8","RowKey":"rkac7612b8","Timestamp":"2020-07-30T14:25:13.7006244Z","Description":"\ua015"},{"odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A13.7896884Z''\"","PartitionKey":"pkac7612b8","RowKey":"test2","Timestamp":"2020-07-30T14:25:13.7896884Z","Description":"\ua015"}]}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttableac7612b8')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity.yaml
new file mode 100644
index 000000000000..6707b72ce817
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity.yaml
@@ -0,0 +1,240 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable13250ef0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable13250ef0"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable13250ef0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk13250ef0", "RowKey": "rk13250ef0", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable13250ef0
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable13250ef0/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A14.4293512Z''\"","PartitionKey":"pk13250ef0","RowKey":"rk13250ef0","Timestamp":"2020-07-30T14:25:14.4293512Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A14.4293512Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable13250ef0(PartitionKey='pk13250ef0',RowKey='rk13250ef0')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk13250ef0", "RowKey": "rk13250ef0", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable13250ef0(PartitionKey='pk13250ef0',RowKey='rk13250ef0')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A14.5137747Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable13250ef0(PartitionKey='pk13250ef0',RowKey='rk13250ef0')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable13250ef0/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A14.5137747Z''\"","PartitionKey":"pk13250ef0","RowKey":"rk13250ef0","Timestamp":"2020-07-30T14:25:14.5137747Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A14.5137747Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable13250ef0')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:13 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_not_existing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_not_existing.yaml
new file mode 100644
index 000000000000..d20af7e259fd
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_not_existing.yaml
@@ -0,0 +1,145 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablefb67146a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablefb67146a"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttablefb67146a')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkfb67146a", "RowKey": "rkfb67146a", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttablefb67146a(PartitionKey='pkfb67146a',RowKey='rkfb67146a')
+ response:
+ body:
+ string: 'ResourceNotFound
The specified resource does not exist.
+
+ RequestId:dfb6a408-a002-0029-6c7d-66dfbb000000
+
+ Time:2020-07-30T14:25:15.2185782Z'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/xml;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablefb67146a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:14 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_with_if_doesnt_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_with_if_doesnt_match.yaml
new file mode 100644
index 000000000000..cd52d96f8b89
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_with_if_doesnt_match.yaml
@@ -0,0 +1,201 @@
+interactions:
+- request:
+ body: '{"TableName": "uttableabcb1791"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableabcb1791"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttableabcb1791')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkabcb1791", "RowKey": "rkabcb1791", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableabcb1791
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableabcb1791/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A15.8403997Z''\"","PartitionKey":"pkabcb1791","RowKey":"rkabcb1791","Timestamp":"2020-07-30T14:25:15.8403997Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A15.8403997Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttableabcb1791(PartitionKey='pkabcb1791',RowKey='rkabcb1791')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pkabcb1791", "RowKey": "rkabcb1791", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ If-Match:
+ - W/"datetime'2012-06-15T22%3A51%3A44.9662825Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttableabcb1791(PartitionKey='pkabcb1791',RowKey='rkabcb1791')
+ response:
+ body:
+ string: 'UpdateConditionNotSatisfied
The update condition specified in the request was not satisfied.
+
+ RequestId:7e044957-8002-003e-677d-661fd8000000
+
+ Time:2020-07-30T14:25:15.9364680Z'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/xml;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 412
+ message: Precondition Failed
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttableabcb1791')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_with_if_matches.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_with_if_matches.yaml
new file mode 100644
index 000000000000..8fcdd010bada
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_update_entity_with_if_matches.yaml
@@ -0,0 +1,240 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable39e2157d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable39e2157d"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ location:
+ - https://storagename.table.core.windows.net/Tables('uttable39e2157d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk39e2157d", "RowKey": "rk39e2157d", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable39e2157d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable39e2157d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A16.4963252Z''\"","PartitionKey":"pk39e2157d","RowKey":"rk39e2157d","Timestamp":"2020-07-30T14:25:16.4963252Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A16.4963252Z'"
+ location:
+ - https://storagename.table.core.windows.net/uttable39e2157d(PartitionKey='pk39e2157d',RowKey='rk39e2157d')
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 201
+ message: Created
+- request:
+ body: '{"PartitionKey": "pk39e2157d", "RowKey": "rk39e2157d", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ If-Match:
+ - W/"datetime'2020-07-30T14%3A25%3A16.4963252Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable39e2157d(PartitionKey='pk39e2157d',RowKey='rk39e2157d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A16.5932449Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable39e2157d(PartitionKey='pk39e2157d',RowKey='rk39e2157d')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable39e2157d/@Element","odata.etag":"W/\"datetime''2020-07-30T14%3A25%3A16.5932449Z''\"","PartitionKey":"pk39e2157d","RowKey":"rk39e2157d","Timestamp":"2020-07-30T14:25:16.5932449Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control:
+ - no-cache
+ content-type:
+ - application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ etag:
+ - W/"datetime'2020-07-30T14%3A25%3A16.5932449Z'"
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '0'
+ Date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 14:25:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable39e2157d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control:
+ - no-cache
+ content-length:
+ - '0'
+ date:
+ - Thu, 30 Jul 2020 14:25:15 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options:
+ - nosniff
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_binary_property_value.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_binary_property_value.yaml
new file mode 100644
index 000000000000..a904f4e50dc3
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_binary_property_value.yaml
@@ -0,0 +1,138 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable10a914d3"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:08 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:08 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable10a914d3"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:07 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable10a914d3')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk10a914d3", "RowKey": "rk10a914d3", "binary": "AQIDBAUGBwgJCg==",
+ "binary@odata.type": "Edm.Binary"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '119'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:08 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:08 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable10a914d3
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable10a914d3/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A07.5921964Z''\"","PartitionKey":"pk10a914d3","RowKey":"rk10a914d3","Timestamp":"2020-07-30T13:33:07.5921964Z","binary@odata.type":"Edm.Binary","binary":"AQIDBAUGBwgJCg=="}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:07 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A07.5921964Z'"
+ location: https://storagename.table.core.windows.net/uttable10a914d3(PartitionKey='pk10a914d3',RowKey='rk10a914d3')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable10a914d3
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:08 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:08 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable10a914d3(PartitionKey='pk10a914d3',RowKey='rk10a914d3')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable10a914d3/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A07.5921964Z''\"","PartitionKey":"pk10a914d3","RowKey":"rk10a914d3","Timestamp":"2020-07-30T13:33:07.5921964Z","binary@odata.type":"Edm.Binary","binary":"AQIDBAUGBwgJCg=="}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:07 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A07.5921964Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable10a914d3(PartitionKey='pk10a914d3',RowKey='rk10a914d3')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable10a914d3')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:07 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable10a914d3')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity.yaml
new file mode 100644
index 000000000000..723ce487482f
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity.yaml
@@ -0,0 +1,174 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable74f8115d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable74f8115d"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:08 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable74f8115d')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk74f8115d", "RowKey": "rk74f8115d", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable74f8115d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable74f8115d/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A08.4768117Z''\"","PartitionKey":"pk74f8115d","RowKey":"rk74f8115d","Timestamp":"2020-07-30T13:33:08.4768117Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:08 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A08.4768117Z'"
+ location: https://storagename.table.core.windows.net/uttable74f8115d(PartitionKey='pk74f8115d',RowKey='rk74f8115d')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable74f8115d
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttable74f8115d(PartitionKey='pk74f8115d',RowKey='rk74f8115d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:08 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable74f8115d(PartitionKey='pk74f8115d',RowKey='rk74f8115d')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable74f8115d(PartitionKey='pk74f8115d',RowKey='rk74f8115d')
+ response:
+ body:
+ string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
+ specified resource does not exist.\nRequestId:60a46c4d-d002-0020-1175-6666c6000000\nTime:2020-07-30T13:33:08.6499351Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:08 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable74f8115d(PartitionKey='pk74f8115d',RowKey='rk74f8115d')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable74f8115d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:08 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable74f8115d')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_not_existing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_not_existing.yaml
new file mode 100644
index 000000000000..b7653b5883db
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_not_existing.yaml
@@ -0,0 +1,103 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable7cd216d7"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:09 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable7cd216d7"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:08 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable7cd216d7')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttable7cd216d7(PartitionKey='pk7cd216d7',RowKey='rk7cd216d7')
+ response:
+ body:
+ string: 'ResourceNotFound
The specified resource does not exist.
+
+ RequestId:c2880782-2002-001c-6b75-66d21d000000
+
+ Time:2020-07-30T13:33:09.1571934Z'
+ headers:
+ cache-control: no-cache
+ content-type: application/xml;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:08 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable7cd216d7(PartitionKey='pk7cd216d7',RowKey='rk7cd216d7')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable7cd216d7')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:08 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable7cd216d7')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_with_if_doesnt_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_with_if_doesnt_match.yaml
new file mode 100644
index 000000000000..d4d913a0c1d9
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_with_if_doesnt_match.yaml
@@ -0,0 +1,147 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable409e19fe"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable409e19fe"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:09 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable409e19fe')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk409e19fe", "RowKey": "rk409e19fe", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable409e19fe
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable409e19fe/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A09.6372886Z''\"","PartitionKey":"pk409e19fe","RowKey":"rk409e19fe","Timestamp":"2020-07-30T13:33:09.6372886Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:09 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A09.6372886Z'"
+ location: https://storagename.table.core.windows.net/uttable409e19fe(PartitionKey='pk409e19fe',RowKey='rk409e19fe')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable409e19fe
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ If-Match:
+ - W/"datetime'2012-06-15T22%3A51%3A44.9662825Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttable409e19fe(PartitionKey='pk409e19fe',RowKey='rk409e19fe')
+ response:
+ body:
+ string: 'UpdateConditionNotSatisfied
The update condition specified in the request was not satisfied.
+
+ RequestId:76b253b9-0002-006d-0775-66a024000000
+
+ Time:2020-07-30T13:33:09.7123389Z'
+ headers:
+ cache-control: no-cache
+ content-type: application/xml;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:09 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 412
+ message: Precondition Failed
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable409e19fe(PartitionKey='pk409e19fe',RowKey='rk409e19fe')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable409e19fe')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:09 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable409e19fe')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_with_if_matches.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_with_if_matches.yaml
new file mode 100644
index 000000000000..31afb48c7ea5
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_with_if_matches.yaml
@@ -0,0 +1,174 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablec28517ea"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:10 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablec28517ea"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:09 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablec28517ea')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkc28517ea", "RowKey": "rkc28517ea", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablec28517ea
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablec28517ea/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A10.2016072Z''\"","PartitionKey":"pkc28517ea","RowKey":"rkc28517ea","Timestamp":"2020-07-30T13:33:10.2016072Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:09 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A10.2016072Z'"
+ location: https://storagename.table.core.windows.net/uttablec28517ea(PartitionKey='pkc28517ea',RowKey='rkc28517ea')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablec28517ea
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ If-Match:
+ - W/"datetime'2020-07-30T13%3A33%3A10.2016072Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttablec28517ea(PartitionKey='pkc28517ea',RowKey='rkc28517ea')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:09 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablec28517ea(PartitionKey='pkc28517ea',RowKey='rkc28517ea')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablec28517ea(PartitionKey='pkc28517ea',RowKey='rkc28517ea')
+ response:
+ body:
+ string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
+ specified resource does not exist.\nRequestId:90187323-e002-0023-6275-6665c1000000\nTime:2020-07-30T13:33:10.3637214Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:09 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablec28517ea(PartitionKey='pkc28517ea',RowKey='rkc28517ea')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablec28517ea')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:10 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablec28517ea')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_empty_and_spaces_property_value.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_empty_and_spaces_property_value.yaml
new file mode 100644
index 000000000000..dee2b6066079
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_empty_and_spaces_property_value.yaml
@@ -0,0 +1,141 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablef58f18ed"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablef58f18ed"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:10 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablef58f18ed')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkf58f18ed", "RowKey": "rkf58f18ed", "EmptyByte": "",
+ "EmptyUnicode": "", "SpacesOnlyByte": " ", "SpacesOnlyUnicode": " ", "SpacesBeforeByte":
+ " Text", "SpacesBeforeUnicode": " Text", "SpacesAfterByte": "Text ", "SpacesAfterUnicode":
+ "Text ", "SpacesBeforeAndAfterByte": " Text ", "SpacesBeforeAndAfterUnicode":
+ " Text "}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '359'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablef58f18ed
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablef58f18ed/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A10.8499402Z''\"","PartitionKey":"pkf58f18ed","RowKey":"rkf58f18ed","Timestamp":"2020-07-30T13:33:10.8499402Z","EmptyByte":"","EmptyUnicode":"","SpacesOnlyByte":" ","SpacesOnlyUnicode":" ","SpacesBeforeByte":" Text","SpacesBeforeUnicode":" Text","SpacesAfterByte":"Text ","SpacesAfterUnicode":"Text ","SpacesBeforeAndAfterByte":" Text ","SpacesBeforeAndAfterUnicode":" Text "}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:10 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A10.8499402Z'"
+ location: https://storagename.table.core.windows.net/uttablef58f18ed(PartitionKey='pkf58f18ed',RowKey='rkf58f18ed')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablef58f18ed
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablef58f18ed(PartitionKey='pkf58f18ed',RowKey='rkf58f18ed')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablef58f18ed/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A10.8499402Z''\"","PartitionKey":"pkf58f18ed","RowKey":"rkf58f18ed","Timestamp":"2020-07-30T13:33:10.8499402Z","EmptyByte":"","EmptyUnicode":"","SpacesOnlyByte":" ","SpacesOnlyUnicode":" ","SpacesBeforeByte":" Text","SpacesBeforeUnicode":" Text","SpacesAfterByte":"Text ","SpacesAfterUnicode":"Text ","SpacesBeforeAndAfterByte":" Text ","SpacesBeforeAndAfterUnicode":" Text "}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:10 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A10.8499402Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablef58f18ed(PartitionKey='pkf58f18ed',RowKey='rkf58f18ed')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:11 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablef58f18ed')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:10 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablef58f18ed')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity.yaml
new file mode 100644
index 000000000000..23ff699e1ce5
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity.yaml
@@ -0,0 +1,143 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable42bf102a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable42bf102a"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable42bf102a')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk42bf102a", "RowKey": "rk42bf102a", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable42bf102a
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable42bf102a/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A11.4231078Z''\"","PartitionKey":"pk42bf102a","RowKey":"rk42bf102a","Timestamp":"2020-07-30T13:33:11.4231078Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A11.4231078Z'"
+ location: https://storagename.table.core.windows.net/uttable42bf102a(PartitionKey='pk42bf102a',RowKey='rk42bf102a')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42bf102a
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable42bf102a(PartitionKey='pk42bf102a',RowKey='rk42bf102a')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable42bf102a/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A11.4231078Z''\"","PartitionKey":"pk42bf102a","RowKey":"rk42bf102a","Timestamp":"2020-07-30T13:33:11.4231078Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A11.4231078Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42bf102a(PartitionKey='pk42bf102a',RowKey='rk42bf102a')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable42bf102a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable42bf102a')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_full_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_full_metadata.yaml
new file mode 100644
index 000000000000..d559f65c235e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_full_metadata.yaml
@@ -0,0 +1,143 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable4fed15dc"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable4fed15dc"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable4fed15dc')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk4fed15dc", "RowKey": "rk4fed15dc", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:12 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable4fed15dc
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable4fed15dc/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A11.996063Z''\"","PartitionKey":"pk4fed15dc","RowKey":"rk4fed15dc","Timestamp":"2020-07-30T13:33:11.996063Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A11.996063Z'"
+ location: https://storagename.table.core.windows.net/uttable4fed15dc(PartitionKey='pk4fed15dc',RowKey='rk4fed15dc')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable4fed15dc
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ accept:
+ - application/json;odata=fullmetadata
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable4fed15dc(PartitionKey='pk4fed15dc',RowKey='rk4fed15dc')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable4fed15dc/@Element","odata.type":"storagename.uttable4fed15dc","odata.id":"https://storagename.table.core.windows.net/uttable4fed15dc(PartitionKey=''pk4fed15dc'',RowKey=''rk4fed15dc'')","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A11.996063Z''\"","odata.editLink":"uttable4fed15dc(PartitionKey=''pk4fed15dc'',RowKey=''rk4fed15dc'')","PartitionKey":"pk4fed15dc","RowKey":"rk4fed15dc","Timestamp@odata.type":"Edm.DateTime","Timestamp":"2020-07-30T13:33:11.996063Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=fullmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A11.996063Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable4fed15dc(PartitionKey='pk4fed15dc',RowKey='rk4fed15dc')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable4fed15dc')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable4fed15dc')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_if_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_if_match.yaml
new file mode 100644
index 000000000000..1c6e7e62b85b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_if_match.yaml
@@ -0,0 +1,174 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee60b13c4"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee60b13c4"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablee60b13c4')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pke60b13c4", "RowKey": "rke60b13c4", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablee60b13c4
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee60b13c4/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A12.5681839Z''\"","PartitionKey":"pke60b13c4","RowKey":"rke60b13c4","Timestamp":"2020-07-30T13:33:12.5681839Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A12.5681839Z'"
+ location: https://storagename.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablee60b13c4
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee60b13c4/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A12.5681839Z''\"","PartitionKey":"pke60b13c4","RowKey":"rke60b13c4","Timestamp":"2020-07-30T13:33:12.5681839Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A12.5681839Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4')
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ If-Match:
+ - W/"datetime'2020-07-30T13%3A33%3A12.5681839Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee60b13c4')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:11 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablee60b13c4')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_no_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_no_metadata.yaml
new file mode 100644
index 000000000000..00b4d7e7ee0b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_no_metadata.yaml
@@ -0,0 +1,143 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable24651506"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:13 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable24651506"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:12 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable24651506')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk24651506", "RowKey": "rk24651506", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable24651506
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable24651506/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A13.2354777Z''\"","PartitionKey":"pk24651506","RowKey":"rk24651506","Timestamp":"2020-07-30T13:33:13.2354777Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:12 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A13.2354777Z'"
+ location: https://storagename.table.core.windows.net/uttable24651506(PartitionKey='pk24651506',RowKey='rk24651506')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable24651506
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ accept:
+ - application/json;odata=nometadata
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable24651506(PartitionKey='pk24651506',RowKey='rk24651506')
+ response:
+ body:
+ string: '{"PartitionKey":"pk24651506","RowKey":"rk24651506","Timestamp":"2020-07-30T13:33:13.2354777Z","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":"933311100","Birthday":"1973-10-04T00:00:00Z","birthday":"1970-10-04T00:00:00Z","binary":"YmluYXJ5","other":20,"clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=nometadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:12 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A13.2354777Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable24651506(PartitionKey='pk24651506',RowKey='rk24651506')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable24651506')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:12 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable24651506')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_not_existing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_not_existing.yaml
new file mode 100644
index 000000000000..562d270636ff
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_not_existing.yaml
@@ -0,0 +1,99 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3b0215a4"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3b0215a4"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:12 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable3b0215a4')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable3b0215a4(PartitionKey='pk3b0215a4',RowKey='rk3b0215a4')
+ response:
+ body:
+ string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
+ specified resource does not exist.\nRequestId:a97c0a5d-b002-0030-6775-665020000000\nTime:2020-07-30T13:33:13.8058709Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:13 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable3b0215a4(PartitionKey='pk3b0215a4',RowKey='rk3b0215a4')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3b0215a4')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:13 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable3b0215a4')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_hook.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_hook.yaml
new file mode 100644
index 000000000000..064b00c78381
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_hook.yaml
@@ -0,0 +1,143 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablefb3d1455"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:14 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablefb3d1455"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:13 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablefb3d1455')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkfb3d1455", "RowKey": "rkfb3d1455", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablefb3d1455
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablefb3d1455/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A14.2838561Z''\"","PartitionKey":"pkfb3d1455","RowKey":"rkfb3d1455","Timestamp":"2020-07-30T13:33:14.2838561Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:13 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A14.2838561Z'"
+ location: https://storagename.table.core.windows.net/uttablefb3d1455(PartitionKey='pkfb3d1455',RowKey='rkfb3d1455')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablefb3d1455
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablefb3d1455(PartitionKey='pkfb3d1455',RowKey='rkfb3d1455')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablefb3d1455/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A14.2838561Z''\"","PartitionKey":"pkfb3d1455","RowKey":"rkfb3d1455","Timestamp":"2020-07-30T13:33:14.2838561Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:13 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A14.2838561Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablefb3d1455(PartitionKey='pkfb3d1455',RowKey='rkfb3d1455')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablefb3d1455')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:13 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablefb3d1455')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_select.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_select.yaml
new file mode 100644
index 000000000000..b3be2e1559d4
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_select.yaml
@@ -0,0 +1,110 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable25221524"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Fri, 24 Jul 2020 15:12:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Fri, 24 Jul 2020 15:12:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable25221524"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Fri, 24 Jul 2020 15:12:18 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable25221524')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragerbrqrhumwwkw.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk25221524", "RowKey": "rk25221524", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Fri, 24 Jul 2020 15:12:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Fri, 24 Jul 2020 15:12:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable25221524
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable25221524/@Element","odata.etag":"W/\"datetime''2020-07-24T15%3A12%3A19.0328764Z''\"","PartitionKey":"pk25221524","RowKey":"rk25221524","Timestamp":"2020-07-24T15:12:19.0328764Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Fri, 24 Jul 2020 15:12:18 GMT
+ etag: W/"datetime'2020-07-24T15%3A12%3A19.0328764Z'"
+ location: https://storagename.table.core.windows.net/uttable25221524(PartitionKey='pk25221524',RowKey='rk25221524')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragerbrqrhumwwkw.table.core.windows.net/uttable25221524
+- request:
+ body: null
+ headers:
+ Date:
+ - Fri, 24 Jul 2020 15:12:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Fri, 24 Jul 2020 15:12:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable25221524')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Fri, 24 Jul 2020 15:12:18 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstoragerbrqrhumwwkw.table.core.windows.net/Tables('uttable25221524')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_special_doubles.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_special_doubles.yaml
new file mode 100644
index 000000000000..89bfa2a0b07c
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_with_special_doubles.yaml
@@ -0,0 +1,139 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablef57d18d2"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablef57d18d2"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:14 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablef57d18d2')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkf57d18d2", "RowKey": "rkf57d18d2", "inf": "Infinity",
+ "inf@odata.type": "Edm.Double", "negativeinf": "-Infinity", "negativeinf@odata.type":
+ "Edm.Double", "nan": "NaN", "nan@odata.type": "Edm.Double"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '219'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablef57d18d2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablef57d18d2/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A14.8799464Z''\"","PartitionKey":"pkf57d18d2","RowKey":"rkf57d18d2","Timestamp":"2020-07-30T13:33:14.8799464Z","inf@odata.type":"Edm.Double","inf":"Infinity","negativeinf@odata.type":"Edm.Double","negativeinf":"-Infinity","nan@odata.type":"Edm.Double","nan":"NaN"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:14 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A14.8799464Z'"
+ location: https://storagename.table.core.windows.net/uttablef57d18d2(PartitionKey='pkf57d18d2',RowKey='rkf57d18d2')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablef57d18d2
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:15 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablef57d18d2(PartitionKey='pkf57d18d2',RowKey='rkf57d18d2')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablef57d18d2/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A14.8799464Z''\"","PartitionKey":"pkf57d18d2","RowKey":"rkf57d18d2","Timestamp":"2020-07-30T13:33:14.8799464Z","inf@odata.type":"Edm.Double","inf":"Infinity","negativeinf@odata.type":"Edm.Double","negativeinf":"-Infinity","nan@odata.type":"Edm.Double","nan":"NaN"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:14 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A14.8799464Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablef57d18d2(PartitionKey='pkf57d18d2',RowKey='rkf57d18d2')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablef57d18d2')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:14 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablef57d18d2')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_conflict.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_conflict.yaml
new file mode 100644
index 000000000000..1ab3026d9dc2
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_conflict.yaml
@@ -0,0 +1,153 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable260d1530"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable260d1530"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable260d1530')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk260d1530", "RowKey": "rk260d1530", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable260d1530
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable260d1530/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A15.4517171Z''\"","PartitionKey":"pk260d1530","RowKey":"rk260d1530","Timestamp":"2020-07-30T13:33:15.4517171Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A15.4517171Z'"
+ location: https://storagename.table.core.windows.net/uttable260d1530(PartitionKey='pk260d1530',RowKey='rk260d1530')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable260d1530
+- request:
+ body: '{"PartitionKey": "pk260d1530", "RowKey": "rk260d1530", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable260d1530
+ response:
+ body:
+ string: '{"odata.error":{"code":"EntityAlreadyExists","message":{"lang":"en-US","value":"The
+ specified entity already exists.\nRequestId:5786b892-3002-0003-3875-66090d000000\nTime:2020-07-30T13:33:15.5347750Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 409
+ message: Conflict
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable260d1530
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable260d1530')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable260d1530')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_dictionary.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_dictionary.yaml
new file mode 100644
index 000000000000..6a44439fa684
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_dictionary.yaml
@@ -0,0 +1,110 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable51a71614"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:16 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable51a71614"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:14 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable51a71614')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk51a71614", "RowKey": "rk51a71614", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable51a71614
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable51a71614/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A16.0395768Z''\"","PartitionKey":"pk51a71614","RowKey":"rk51a71614","Timestamp":"2020-07-30T13:33:16.0395768Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A16.0395768Z'"
+ location: https://storagename.table.core.windows.net/uttable51a71614(PartitionKey='pk51a71614',RowKey='rk51a71614')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable51a71614
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable51a71614')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable51a71614')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_empty_string_pk.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_empty_string_pk.yaml
new file mode 100644
index 000000000000..03513853ac48
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_empty_string_pk.yaml
@@ -0,0 +1,104 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablec79a183d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablec79a183d"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablec79a183d')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"RowKey": "rk", "PartitionKey": ""}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablec79a183d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablec79a183d/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A16.5337845Z''\"","PartitionKey":"","RowKey":"rk","Timestamp":"2020-07-30T13:33:16.5337845Z"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A16.5337845Z'"
+ location: https://storagename.table.core.windows.net/uttablec79a183d(PartitionKey='',RowKey='rk')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablec79a183d
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablec79a183d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablec79a183d')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_empty_string_rk.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_empty_string_rk.yaml
new file mode 100644
index 000000000000..6fa4f5a1f320
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_empty_string_rk.yaml
@@ -0,0 +1,104 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablec79e183f"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablec79e183f"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:15 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablec79e183f')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk", "RowKey": ""}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '36'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablec79e183f
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablec79e183f/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A17.0466104Z''\"","PartitionKey":"pk","RowKey":"","Timestamp":"2020-07-30T13:33:17.0466104Z"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:16 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A17.0466104Z'"
+ location: https://storagename.table.core.windows.net/uttablec79e183f(PartitionKey='pk',RowKey='')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablec79e183f
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablec79e183f')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:16 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablec79e183f')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_missing_pk.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_missing_pk.yaml
new file mode 100644
index 000000000000..7ea32dbb2b6b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_missing_pk.yaml
@@ -0,0 +1,66 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable52411612"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable52411612"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:17 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable52411612')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable52411612')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:17 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable52411612')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_missing_rk.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_missing_rk.yaml
new file mode 100644
index 000000000000..5dcbe0d947a5
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_missing_rk.yaml
@@ -0,0 +1,66 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable52451614"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable52451614"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:17 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable52451614')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable52451614')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:17 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable52451614')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_property_name_too_long.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_property_name_too_long.yaml
new file mode 100644
index 000000000000..8eb10a0aaabd
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_property_name_too_long.yaml
@@ -0,0 +1,104 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable7d0b1b23"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable7d0b1b23"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:18 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable7d0b1b23')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk7d0b1b23", "RowKey": "rk7d0b1b23", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":
+ "badval"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '324'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable7d0b1b23
+ response:
+ body:
+ string: '{"odata.error":{"code":"PropertyNameTooLong","message":{"lang":"en-US","value":"The
+ property name exceeds the maximum allowed length (255).\nRequestId:a90cc38a-9002-002c-2675-668837000000\nTime:2020-07-30T13:33:18.4270043Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:18 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 400
+ message: Bad Request
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable7d0b1b23
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable7d0b1b23')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:18 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable7d0b1b23')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_too_many_properties.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_too_many_properties.yaml
new file mode 100644
index 000000000000..2d562e0e26df
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_too_many_properties.yaml
@@ -0,0 +1,173 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable2c5919f0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable2c5919f0"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:18 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable2c5919f0')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk2c5919f0", "RowKey": "rk2c5919f0", "key0": "value0",
+ "key1": "value1", "key2": "value2", "key3": "value3", "key4": "value4", "key5":
+ "value5", "key6": "value6", "key7": "value7", "key8": "value8", "key9": "value9",
+ "key10": "value10", "key11": "value11", "key12": "value12", "key13": "value13",
+ "key14": "value14", "key15": "value15", "key16": "value16", "key17": "value17",
+ "key18": "value18", "key19": "value19", "key20": "value20", "key21": "value21",
+ "key22": "value22", "key23": "value23", "key24": "value24", "key25": "value25",
+ "key26": "value26", "key27": "value27", "key28": "value28", "key29": "value29",
+ "key30": "value30", "key31": "value31", "key32": "value32", "key33": "value33",
+ "key34": "value34", "key35": "value35", "key36": "value36", "key37": "value37",
+ "key38": "value38", "key39": "value39", "key40": "value40", "key41": "value41",
+ "key42": "value42", "key43": "value43", "key44": "value44", "key45": "value45",
+ "key46": "value46", "key47": "value47", "key48": "value48", "key49": "value49",
+ "key50": "value50", "key51": "value51", "key52": "value52", "key53": "value53",
+ "key54": "value54", "key55": "value55", "key56": "value56", "key57": "value57",
+ "key58": "value58", "key59": "value59", "key60": "value60", "key61": "value61",
+ "key62": "value62", "key63": "value63", "key64": "value64", "key65": "value65",
+ "key66": "value66", "key67": "value67", "key68": "value68", "key69": "value69",
+ "key70": "value70", "key71": "value71", "key72": "value72", "key73": "value73",
+ "key74": "value74", "key75": "value75", "key76": "value76", "key77": "value77",
+ "key78": "value78", "key79": "value79", "key80": "value80", "key81": "value81",
+ "key82": "value82", "key83": "value83", "key84": "value84", "key85": "value85",
+ "key86": "value86", "key87": "value87", "key88": "value88", "key89": "value89",
+ "key90": "value90", "key91": "value91", "key92": "value92", "key93": "value93",
+ "key94": "value94", "key95": "value95", "key96": "value96", "key97": "value97",
+ "key98": "value98", "key99": "value99", "key100": "value100", "key101": "value101",
+ "key102": "value102", "key103": "value103", "key104": "value104", "key105":
+ "value105", "key106": "value106", "key107": "value107", "key108": "value108",
+ "key109": "value109", "key110": "value110", "key111": "value111", "key112":
+ "value112", "key113": "value113", "key114": "value114", "key115": "value115",
+ "key116": "value116", "key117": "value117", "key118": "value118", "key119":
+ "value119", "key120": "value120", "key121": "value121", "key122": "value122",
+ "key123": "value123", "key124": "value124", "key125": "value125", "key126":
+ "value126", "key127": "value127", "key128": "value128", "key129": "value129",
+ "key130": "value130", "key131": "value131", "key132": "value132", "key133":
+ "value133", "key134": "value134", "key135": "value135", "key136": "value136",
+ "key137": "value137", "key138": "value138", "key139": "value139", "key140":
+ "value140", "key141": "value141", "key142": "value142", "key143": "value143",
+ "key144": "value144", "key145": "value145", "key146": "value146", "key147":
+ "value147", "key148": "value148", "key149": "value149", "key150": "value150",
+ "key151": "value151", "key152": "value152", "key153": "value153", "key154":
+ "value154", "key155": "value155", "key156": "value156", "key157": "value157",
+ "key158": "value158", "key159": "value159", "key160": "value160", "key161":
+ "value161", "key162": "value162", "key163": "value163", "key164": "value164",
+ "key165": "value165", "key166": "value166", "key167": "value167", "key168":
+ "value168", "key169": "value169", "key170": "value170", "key171": "value171",
+ "key172": "value172", "key173": "value173", "key174": "value174", "key175":
+ "value175", "key176": "value176", "key177": "value177", "key178": "value178",
+ "key179": "value179", "key180": "value180", "key181": "value181", "key182":
+ "value182", "key183": "value183", "key184": "value184", "key185": "value185",
+ "key186": "value186", "key187": "value187", "key188": "value188", "key189":
+ "value189", "key190": "value190", "key191": "value191", "key192": "value192",
+ "key193": "value193", "key194": "value194", "key195": "value195", "key196":
+ "value196", "key197": "value197", "key198": "value198", "key199": "value199",
+ "key200": "value200", "key201": "value201", "key202": "value202", "key203":
+ "value203", "key204": "value204", "key205": "value205", "key206": "value206",
+ "key207": "value207", "key208": "value208", "key209": "value209", "key210":
+ "value210", "key211": "value211", "key212": "value212", "key213": "value213",
+ "key214": "value214", "key215": "value215", "key216": "value216", "key217":
+ "value217", "key218": "value218", "key219": "value219", "key220": "value220",
+ "key221": "value221", "key222": "value222", "key223": "value223", "key224":
+ "value224", "key225": "value225", "key226": "value226", "key227": "value227",
+ "key228": "value228", "key229": "value229", "key230": "value230", "key231":
+ "value231", "key232": "value232", "key233": "value233", "key234": "value234",
+ "key235": "value235", "key236": "value236", "key237": "value237", "key238":
+ "value238", "key239": "value239", "key240": "value240", "key241": "value241",
+ "key242": "value242", "key243": "value243", "key244": "value244", "key245":
+ "value245", "key246": "value246", "key247": "value247", "key248": "value248",
+ "key249": "value249", "key250": "value250", "key251": "value251", "key252":
+ "value252", "key253": "value253", "key254": "value254"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '5444'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable2c5919f0
+ response:
+ body:
+ string: '{"odata.error":{"code":"TooManyProperties","message":{"lang":"en-US","value":"The
+ entity contains more properties than allowed. Each entity can include up to
+ 252 properties to store data. Each entity also has 3 system properties.\nRequestId:ea5fadab-6002-0032-2a75-6652da000000\nTime:2020-07-30T13:33:18.9421142Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:18 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 400
+ message: Bad Request
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable2c5919f0
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable2c5919f0')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:18 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable2c5919f0')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_full_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_full_metadata.yaml
new file mode 100644
index 000000000000..f2b0b22a505e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_full_metadata.yaml
@@ -0,0 +1,110 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable1172194c"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable1172194c"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:19 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable1172194c')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk1172194c", "RowKey": "rk1172194c", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=fullmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable1172194c
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable1172194c/@Element","odata.type":"storagename.uttable1172194c","odata.id":"https://storagename.table.core.windows.net/uttable1172194c(PartitionKey=''pk1172194c'',RowKey=''rk1172194c'')","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A19.4416834Z''\"","odata.editLink":"uttable1172194c(PartitionKey=''pk1172194c'',RowKey=''rk1172194c'')","PartitionKey":"pk1172194c","RowKey":"rk1172194c","Timestamp@odata.type":"Edm.DateTime","Timestamp":"2020-07-30T13:33:19.4416834Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=fullmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:19 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A19.4416834Z'"
+ location: https://storagename.table.core.windows.net/uttable1172194c(PartitionKey='pk1172194c',RowKey='rk1172194c')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable1172194c
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable1172194c')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:19 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable1172194c')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_hook.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_hook.yaml
new file mode 100644
index 000000000000..379da267200c
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_hook.yaml
@@ -0,0 +1,110 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3c3715aa"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3c3715aa"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:19 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable3c3715aa')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk3c3715aa", "RowKey": "rk3c3715aa", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:20 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable3c3715aa
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable3c3715aa/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A19.9370096Z''\"","PartitionKey":"pk3c3715aa","RowKey":"rk3c3715aa","Timestamp":"2020-07-30T13:33:19.9370096Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:19 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A19.9370096Z'"
+ location: https://storagename.table.core.windows.net/uttable3c3715aa(PartitionKey='pk3c3715aa',RowKey='rk3c3715aa')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable3c3715aa
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3c3715aa')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:19 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable3c3715aa')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_large_int32_value_throws.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_large_int32_value_throws.yaml
new file mode 100644
index 000000000000..1589d29c968a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_large_int32_value_throws.yaml
@@ -0,0 +1,66 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3d151d95"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3d151d95"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:19 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable3d151d95')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3d151d95')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable3d151d95')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_large_int64_value_throws.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_large_int64_value_throws.yaml
new file mode 100644
index 000000000000..06958c4d088a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_large_int64_value_throws.yaml
@@ -0,0 +1,66 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3d5e1d9a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3d5e1d9a"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable3d5e1d9a')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3d5e1d9a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable3d5e1d9a')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_no_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_no_metadata.yaml
new file mode 100644
index 000000000000..19a5e6b24ba0
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_entity_with_no_metadata.yaml
@@ -0,0 +1,110 @@
+interactions:
+- request:
+ body: '{"TableName": "uttabledefb1876"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttabledefb1876"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttabledefb1876')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkdefb1876", "RowKey": "rkdefb1876", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=nometadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttabledefb1876
+ response:
+ body:
+ string: '{"PartitionKey":"pkdefb1876","RowKey":"rkdefb1876","Timestamp":"2020-07-30T13:33:21.239417Z","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":"933311100","Birthday":"1973-10-04T00:00:00Z","birthday":"1970-10-04T00:00:00Z","binary":"YmluYXJ5","other":20,"clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=nometadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A21.239417Z'"
+ location: https://storagename.table.core.windows.net/uttabledefb1876(PartitionKey='pkdefb1876',RowKey='rkdefb1876')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttabledefb1876
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttabledefb1876')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttabledefb1876')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_merge_entity_with_existing_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_merge_entity_with_existing_entity.yaml
new file mode 100644
index 000000000000..4520acc7d1fa
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_merge_entity_with_existing_entity.yaml
@@ -0,0 +1,179 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable42df1e0f"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable42df1e0f"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable42df1e0f')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk42df1e0f", "RowKey": "rk42df1e0f", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable42df1e0f
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable42df1e0f/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A21.7215424Z''\"","PartitionKey":"pk42df1e0f","RowKey":"rk42df1e0f","Timestamp":"2020-07-30T13:33:21.7215424Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A21.7215424Z'"
+ location: https://storagename.table.core.windows.net/uttable42df1e0f(PartitionKey='pk42df1e0f',RowKey='rk42df1e0f')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42df1e0f
+- request:
+ body: '{"PartitionKey": "pk42df1e0f", "RowKey": "rk42df1e0f", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable42df1e0f(PartitionKey='pk42df1e0f',RowKey='rk42df1e0f')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A21.7979671Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42df1e0f(PartitionKey='pk42df1e0f',RowKey='rk42df1e0f')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable42df1e0f(PartitionKey='pk42df1e0f',RowKey='rk42df1e0f')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable42df1e0f/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A21.7979671Z''\"","PartitionKey":"pk42df1e0f","RowKey":"rk42df1e0f","Timestamp":"2020-07-30T13:33:21.7979671Z","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","age":"abc","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","deceased":false,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","married":true,"other":20,"ratio":3.1,"sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:20 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A21.7979671Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42df1e0f(PartitionKey='pk42df1e0f',RowKey='rk42df1e0f')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable42df1e0f')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:21 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable42df1e0f')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_merge_entity_with_non_existing_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_merge_entity_with_non_existing_entity.yaml
new file mode 100644
index 000000000000..d574267939a7
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_merge_entity_with_non_existing_entity.yaml
@@ -0,0 +1,135 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablebeb51fb9"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablebeb51fb9"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:22 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablebeb51fb9')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkbeb51fb9", "RowKey": "rkbeb51fb9", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttablebeb51fb9(PartitionKey='pkbeb51fb9',RowKey='rkbeb51fb9')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:22 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A22.3793844Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablebeb51fb9(PartitionKey='pkbeb51fb9',RowKey='rkbeb51fb9')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablebeb51fb9(PartitionKey='pkbeb51fb9',RowKey='rkbeb51fb9')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablebeb51fb9/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A22.3793844Z''\"","PartitionKey":"pkbeb51fb9","RowKey":"rkbeb51fb9","Timestamp":"2020-07-30T13:33:22.3793844Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:22 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A22.3793844Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablebeb51fb9(PartitionKey='pkbeb51fb9',RowKey='rkbeb51fb9')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablebeb51fb9')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:22 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablebeb51fb9')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_replace_entity_with_existing_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_replace_entity_with_existing_entity.yaml
new file mode 100644
index 000000000000..96bdf6ac19f6
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_replace_entity_with_existing_entity.yaml
@@ -0,0 +1,179 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable7edf1edb"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable7edf1edb"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:21 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable7edf1edb')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk7edf1edb", "RowKey": "rk7edf1edb", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:23 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable7edf1edb
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable7edf1edb/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A22.9650908Z''\"","PartitionKey":"pk7edf1edb","RowKey":"rk7edf1edb","Timestamp":"2020-07-30T13:33:22.9650908Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:21 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A22.9650908Z'"
+ location: https://storagename.table.core.windows.net/uttable7edf1edb(PartitionKey='pk7edf1edb',RowKey='rk7edf1edb')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable7edf1edb
+- request:
+ body: '{"PartitionKey": "pk7edf1edb", "RowKey": "rk7edf1edb", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable7edf1edb(PartitionKey='pk7edf1edb',RowKey='rk7edf1edb')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:22 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A23.0428641Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable7edf1edb(PartitionKey='pk7edf1edb',RowKey='rk7edf1edb')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable7edf1edb(PartitionKey='pk7edf1edb',RowKey='rk7edf1edb')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable7edf1edb/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A23.0428641Z''\"","PartitionKey":"pk7edf1edb","RowKey":"rk7edf1edb","Timestamp":"2020-07-30T13:33:23.0428641Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:22 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A23.0428641Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable7edf1edb(PartitionKey='pk7edf1edb',RowKey='rk7edf1edb')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable7edf1edb')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:22 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable7edf1edb')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_replace_entity_with_non_existing_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_replace_entity_with_non_existing_entity.yaml
new file mode 100644
index 000000000000..8bf49e04586f
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_insert_or_replace_entity_with_non_existing_entity.yaml
@@ -0,0 +1,135 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablefde52085"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablefde52085"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablefde52085')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkfde52085", "RowKey": "rkfde52085", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttablefde52085(PartitionKey='pkfde52085',RowKey='rkfde52085')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A23.6242812Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablefde52085(PartitionKey='pkfde52085',RowKey='rkfde52085')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablefde52085(PartitionKey='pkfde52085',RowKey='rkfde52085')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablefde52085/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A23.6242812Z''\"","PartitionKey":"pkfde52085","RowKey":"rkfde52085","Timestamp":"2020-07-30T13:33:23.6242812Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A23.6242812Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablefde52085(PartitionKey='pkfde52085',RowKey='rkfde52085')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablefde52085')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablefde52085')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity.yaml
new file mode 100644
index 000000000000..8dc57b3a47bc
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity.yaml
@@ -0,0 +1,181 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable641610fa"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:24 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable641610fa"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable641610fa')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk641610fa", "RowKey": "rk641610fa", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable641610fa
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable641610fa/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A24.1995293Z''\"","PartitionKey":"pk641610fa","RowKey":"rk641610fa","Timestamp":"2020-07-30T13:33:24.1995293Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A24.1995293Z'"
+ location: https://storagename.table.core.windows.net/uttable641610fa(PartitionKey='pk641610fa',RowKey='rk641610fa')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable641610fa
+- request:
+ body: '{"PartitionKey": "pk641610fa", "RowKey": "rk641610fa", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable641610fa(PartitionKey='pk641610fa',RowKey='rk641610fa')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A24.2867548Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable641610fa(PartitionKey='pk641610fa',RowKey='rk641610fa')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable641610fa(PartitionKey='pk641610fa',RowKey='rk641610fa')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable641610fa/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A24.2867548Z''\"","PartitionKey":"pk641610fa","RowKey":"rk641610fa","Timestamp":"2020-07-30T13:33:24.2867548Z","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","age":"abc","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","deceased":false,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","married":true,"other":20,"ratio":3.1,"sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A24.2867548Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable641610fa(PartitionKey='pk641610fa',RowKey='rk641610fa')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable641610fa')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:23 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable641610fa')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_not_existing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_not_existing.yaml
new file mode 100644
index 000000000000..0b46ed07058d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_not_existing.yaml
@@ -0,0 +1,109 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable66e91674"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable66e91674"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:24 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable66e91674')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk66e91674", "RowKey": "rk66e91674", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable66e91674(PartitionKey='pk66e91674',RowKey='rk66e91674')
+ response:
+ body:
+ string: 'ResourceNotFound
The specified resource does not exist.
+
+ RequestId:ae81374a-8002-005e-7276-66f909000000
+
+ Time:2020-07-30T13:33:24.8775073Z'
+ headers:
+ cache-control: no-cache
+ content-type: application/xml;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:24 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable66e91674(PartitionKey='pk66e91674',RowKey='rk66e91674')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:25 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable66e91674')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:24 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable66e91674')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_with_if_doesnt_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_with_if_doesnt_match.yaml
new file mode 100644
index 000000000000..348da17ccc4a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_with_if_doesnt_match.yaml
@@ -0,0 +1,153 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable279d199b"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable279d199b"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:24 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable279d199b')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk279d199b", "RowKey": "rk279d199b", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable279d199b
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable279d199b/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A25.3681155Z''\"","PartitionKey":"pk279d199b","RowKey":"rk279d199b","Timestamp":"2020-07-30T13:33:25.3681155Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A25.3681155Z'"
+ location: https://storagename.table.core.windows.net/uttable279d199b(PartitionKey='pk279d199b',RowKey='rk279d199b')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable279d199b
+- request:
+ body: '{"PartitionKey": "pk279d199b", "RowKey": "rk279d199b", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ If-Match:
+ - W/"datetime'2012-06-15T22%3A51%3A44.9662825Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttable279d199b(PartitionKey='pk279d199b',RowKey='rk279d199b')
+ response:
+ body:
+ string: 'UpdateConditionNotSatisfied
The update condition specified in the request was not satisfied.
+
+ RequestId:a318a23c-d002-0064-5c76-66baaa000000
+
+ Time:2020-07-30T13:33:25.4471689Z'
+ headers:
+ cache-control: no-cache
+ content-type: application/xml;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 412
+ message: Precondition Failed
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable279d199b(PartitionKey='pk279d199b',RowKey='rk279d199b')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable279d199b')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable279d199b')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_with_if_matches.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_with_if_matches.yaml
new file mode 100644
index 000000000000..d5fd83830dc2
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_merge_entity_with_if_matches.yaml
@@ -0,0 +1,181 @@
+interactions:
+- request:
+ body: '{"TableName": "uttableab731787"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableab731787"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttableab731787')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkab731787", "RowKey": "rkab731787", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:26 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttableab731787
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableab731787/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A25.9352892Z''\"","PartitionKey":"pkab731787","RowKey":"rkab731787","Timestamp":"2020-07-30T13:33:25.9352892Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A25.9352892Z'"
+ location: https://storagename.table.core.windows.net/uttableab731787(PartitionKey='pkab731787',RowKey='rkab731787')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttableab731787
+- request:
+ body: '{"PartitionKey": "pkab731787", "RowKey": "rkab731787", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ If-Match:
+ - W/"datetime'2020-07-30T13%3A33%3A25.9352892Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PATCH
+ uri: https://storagename.table.core.windows.net/uttableab731787(PartitionKey='pkab731787',RowKey='rkab731787')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A26.0170037Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttableab731787(PartitionKey='pkab731787',RowKey='rkab731787')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttableab731787(PartitionKey='pkab731787',RowKey='rkab731787')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttableab731787/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A26.0170037Z''\"","PartitionKey":"pkab731787","RowKey":"rkab731787","Timestamp":"2020-07-30T13:33:26.0170037Z","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","age":"abc","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","deceased":false,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","married":true,"other":20,"ratio":3.1,"sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A26.0170037Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttableab731787(PartitionKey='pkab731787',RowKey='rkab731787')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttableab731787')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:26 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttableab731787')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_none_property_value.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_none_property_value.yaml
new file mode 100644
index 000000000000..935b170b5dba
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_none_property_value.yaml
@@ -0,0 +1,137 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee7f813fe"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee7f813fe"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablee7f813fe')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pke7f813fe", "RowKey": "rke7f813fe"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '54'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablee7f813fe
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee7f813fe/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A26.5834879Z''\"","PartitionKey":"pke7f813fe","RowKey":"rke7f813fe","Timestamp":"2020-07-30T13:33:26.5834879Z"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A26.5834879Z'"
+ location: https://storagename.table.core.windows.net/uttablee7f813fe(PartitionKey='pke7f813fe',RowKey='rke7f813fe')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablee7f813fe
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablee7f813fe(PartitionKey='pke7f813fe',RowKey='rke7f813fe')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee7f813fe/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A26.5834879Z''\"","PartitionKey":"pke7f813fe","RowKey":"rke7f813fe","Timestamp":"2020-07-30T13:33:26.5834879Z"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A26.5834879Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablee7f813fe(PartitionKey='pke7f813fe',RowKey='rke7f813fe')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee7f813fe')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:25 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablee7f813fe')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_operations_on_entity_with_partition_key_having_single_quote.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_operations_on_entity_with_partition_key_having_single_quote.yaml
new file mode 100644
index 000000000000..6b628ec2887d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_operations_on_entity_with_partition_key_having_single_quote.yaml
@@ -0,0 +1,151 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable5da124b0"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Fri, 10 Jul 2020 13:55:21 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Fri, 10 Jul 2020 13:55:21 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable5da124b0"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Fri, 10 Jul 2020 13:55:20 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable5da124b0')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragebwq3yp5o6ygk.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "a''''''''b", "RowKey": "a''''''''b", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '529'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Fri, 10 Jul 2020 13:55:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Fri, 10 Jul 2020 13:55:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable5da124b0
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable5da124b0/@Element","odata.etag":"W/\"datetime''2020-07-10T13%3A55%3A21.1923413Z''\"","PartitionKey":"a''''''''b","RowKey":"a''''''''b","Timestamp":"2020-07-10T13:55:21.1923413Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Fri, 10 Jul 2020 13:55:20 GMT
+ etag: W/"datetime'2020-07-10T13%3A55%3A21.1923413Z'"
+ location: https://storagename.table.core.windows.net/uttable5da124b0(PartitionKey='a''''''''b',RowKey='a''''''''b')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstoragebwq3yp5o6ygk.table.core.windows.net/uttable5da124b0
+- request:
+ body: '{"PartitionKey": "a''''''''b", "RowKey": "a''''''''b", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '172'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Fri, 10 Jul 2020 13:55:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Fri, 10 Jul 2020 13:55:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable5da124b0(PartitionKey='a''''b',RowKey='a''''b')
+ response:
+ body:
+ string: 'AuthenticationFailedServer failed to authenticate the request. Make sure the
+ value of Authorization header is formed correctly including the signature.
+
+ RequestId:dc840ea1-1002-0035-50c1-56faa6000000
+
+ Time:2020-07-10T13:55:21.2723986Z'
+ headers:
+ content-length: '419'
+ content-type: application/xml
+ date: Fri, 10 Jul 2020 13:55:21 GMT
+ server: Microsoft-HTTPAPI/2.0
+ x-ms-error-code: AuthenticationFailed
+ status:
+ code: 403
+ message: Server failed to authenticate the request. Make sure the value of Authorization
+ header is formed correctly including the signature.
+ url: https://pyacrstoragebwq3yp5o6ygk.table.core.windows.net/uttable5da124b0(PartitionKey='a''''b',RowKey='a''''b')
+- request:
+ body: null
+ headers:
+ Date:
+ - Fri, 10 Jul 2020 13:55:22 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Fri, 10 Jul 2020 13:55:22 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable5da124b0')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Fri, 10 Jul 2020 13:55:21 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstoragebwq3yp5o6ygk.table.core.windows.net/Tables('uttable5da124b0')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities.yaml
new file mode 100644
index 000000000000..dcdeb04dde32
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities.yaml
@@ -0,0 +1,250 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable88c411e8"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:27 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable88c411e8"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:26 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable88c411e8')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "querytable88c411e8"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable88c411e8"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:26 GMT
+ location: https://storagename.table.core.windows.net/Tables('querytable88c411e8')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk88c411e8", "RowKey": "rk88c411e81", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable88c411e8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable88c411e8/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A27.2270172Z''\"","PartitionKey":"pk88c411e8","RowKey":"rk88c411e81","Timestamp":"2020-07-30T13:33:27.2270172Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:26 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A27.2270172Z'"
+ location: https://storagename.table.core.windows.net/querytable88c411e8(PartitionKey='pk88c411e8',RowKey='rk88c411e81')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable88c411e8
+- request:
+ body: '{"PartitionKey": "pk88c411e8", "RowKey": "rk88c411e812", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable88c411e8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable88c411e8/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A27.3090776Z''\"","PartitionKey":"pk88c411e8","RowKey":"rk88c411e812","Timestamp":"2020-07-30T13:33:27.3090776Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:26 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A27.3090776Z'"
+ location: https://storagename.table.core.windows.net/querytable88c411e8(PartitionKey='pk88c411e8',RowKey='rk88c411e812')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable88c411e8
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable88c411e8()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable88c411e8","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A27.2270172Z''\"","PartitionKey":"pk88c411e8","RowKey":"rk88c411e81","Timestamp":"2020-07-30T13:33:27.2270172Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A27.3090776Z''\"","PartitionKey":"pk88c411e8","RowKey":"rk88c411e812","Timestamp":"2020-07-30T13:33:27.3090776Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:26 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable88c411e8()
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable88c411e8')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable88c411e8')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable88c411e8')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('querytable88c411e8')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_full_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_full_metadata.yaml
new file mode 100644
index 000000000000..f795f77d9bfb
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_full_metadata.yaml
@@ -0,0 +1,250 @@
+interactions:
+- request:
+ body: '{"TableName": "uttableae56179a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableae56179a"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttableae56179a')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "querytableae56179a"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:28 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytableae56179a"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ location: https://storagename.table.core.windows.net/Tables('querytableae56179a')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkae56179a", "RowKey": "rkae56179a1", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytableae56179a
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytableae56179a/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A28.0729727Z''\"","PartitionKey":"pkae56179a","RowKey":"rkae56179a1","Timestamp":"2020-07-30T13:33:28.0729727Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A28.0729727Z'"
+ location: https://storagename.table.core.windows.net/querytableae56179a(PartitionKey='pkae56179a',RowKey='rkae56179a1')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytableae56179a
+- request:
+ body: '{"PartitionKey": "pkae56179a", "RowKey": "rkae56179a12", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytableae56179a
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytableae56179a/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A28.1550282Z''\"","PartitionKey":"pkae56179a","RowKey":"rkae56179a12","Timestamp":"2020-07-30T13:33:28.1550282Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A28.1550282Z'"
+ location: https://storagename.table.core.windows.net/querytableae56179a(PartitionKey='pkae56179a',RowKey='rkae56179a12')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytableae56179a
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ accept:
+ - application/json;odata=fullmetadata
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytableae56179a()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytableae56179a","value":[{"odata.type":"storagename.querytableae56179a","odata.id":"https://storagename.table.core.windows.net/querytableae56179a(PartitionKey=''pkae56179a'',RowKey=''rkae56179a1'')","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A28.0729727Z''\"","odata.editLink":"querytableae56179a(PartitionKey=''pkae56179a'',RowKey=''rkae56179a1'')","PartitionKey":"pkae56179a","RowKey":"rkae56179a1","Timestamp@odata.type":"Edm.DateTime","Timestamp":"2020-07-30T13:33:28.0729727Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.type":"storagename.querytableae56179a","odata.id":"https://storagename.table.core.windows.net/querytableae56179a(PartitionKey=''pkae56179a'',RowKey=''rkae56179a12'')","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A28.1550282Z''\"","odata.editLink":"querytableae56179a(PartitionKey=''pkae56179a'',RowKey=''rkae56179a12'')","PartitionKey":"pkae56179a","RowKey":"rkae56179a12","Timestamp@odata.type":"Edm.DateTime","Timestamp":"2020-07-30T13:33:28.1550282Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=fullmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytableae56179a()
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttableae56179a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttableae56179a')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytableae56179a')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:27 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('querytableae56179a')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_no_metadata.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_no_metadata.yaml
new file mode 100644
index 000000000000..b137d54d1715
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_no_metadata.yaml
@@ -0,0 +1,250 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable7f5216c4"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable7f5216c4"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable7f5216c4')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "querytable7f5216c4"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable7f5216c4"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ location: https://storagename.table.core.windows.net/Tables('querytable7f5216c4')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk7f5216c4", "RowKey": "rk7f5216c41", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable7f5216c4
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable7f5216c4/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A28.8912087Z''\"","PartitionKey":"pk7f5216c4","RowKey":"rk7f5216c41","Timestamp":"2020-07-30T13:33:28.8912087Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A28.8912087Z'"
+ location: https://storagename.table.core.windows.net/querytable7f5216c4(PartitionKey='pk7f5216c4',RowKey='rk7f5216c41')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable7f5216c4
+- request:
+ body: '{"PartitionKey": "pk7f5216c4", "RowKey": "rk7f5216c412", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:29 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable7f5216c4
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable7f5216c4/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A28.9752708Z''\"","PartitionKey":"pk7f5216c4","RowKey":"rk7f5216c412","Timestamp":"2020-07-30T13:33:28.9752708Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A28.9752708Z'"
+ location: https://storagename.table.core.windows.net/querytable7f5216c4(PartitionKey='pk7f5216c4',RowKey='rk7f5216c412')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable7f5216c4
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ accept:
+ - application/json;odata=nometadata
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable7f5216c4()
+ response:
+ body:
+ string: '{"value":[{"PartitionKey":"pk7f5216c4","RowKey":"rk7f5216c41","Timestamp":"2020-07-30T13:33:28.8912087Z","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":"933311100","Birthday":"1973-10-04T00:00:00Z","birthday":"1970-10-04T00:00:00Z","binary":"YmluYXJ5","other":20,"clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"PartitionKey":"pk7f5216c4","RowKey":"rk7f5216c412","Timestamp":"2020-07-30T13:33:28.9752708Z","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":"933311100","Birthday":"1973-10-04T00:00:00Z","birthday":"1970-10-04T00:00:00Z","binary":"YmluYXJ5","other":20,"clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=nometadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable7f5216c4()
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable7f5216c4')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable7f5216c4')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable7f5216c4')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:29 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('querytable7f5216c4')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_filter.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_filter.yaml
new file mode 100644
index 000000000000..62d2b7e7fb87
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_filter.yaml
@@ -0,0 +1,142 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable800416e8"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable800416e8"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable800416e8')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk800416e8", "RowKey": "rk800416e8", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable800416e8
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable800416e8/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A29.6529072Z''\"","PartitionKey":"pk800416e8","RowKey":"rk800416e8","Timestamp":"2020-07-30T13:33:29.6529072Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A29.6529072Z'"
+ location: https://storagename.table.core.windows.net/uttable800416e8(PartitionKey='pk800416e8',RowKey='rk800416e8')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable800416e8
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable800416e8()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable800416e8","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A29.6529072Z''\"","PartitionKey":"pk800416e8","RowKey":"rk800416e8","Timestamp":"2020-07-30T13:33:29.6529072Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable800416e8()
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable800416e8')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:28 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable800416e8')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_select.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_select.yaml
new file mode 100644
index 000000000000..3df27b738929
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_select.yaml
@@ -0,0 +1,250 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable800f16e2"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:30 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable800f16e2"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:30 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable800f16e2')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "querytable800f16e2"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable800f16e2"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:30 GMT
+ location: https://storagename.table.core.windows.net/Tables('querytable800f16e2')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk800f16e2", "RowKey": "rk800f16e21", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable800f16e2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable800f16e2/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A30.5282919Z''\"","PartitionKey":"pk800f16e2","RowKey":"rk800f16e21","Timestamp":"2020-07-30T13:33:30.5282919Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:30 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A30.5282919Z'"
+ location: https://storagename.table.core.windows.net/querytable800f16e2(PartitionKey='pk800f16e2',RowKey='rk800f16e21')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable800f16e2
+- request:
+ body: '{"PartitionKey": "pk800f16e2", "RowKey": "rk800f16e212", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable800f16e2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable800f16e2/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A30.6073436Z''\"","PartitionKey":"pk800f16e2","RowKey":"rk800f16e212","Timestamp":"2020-07-30T13:33:30.6073436Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:30 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A30.6073436Z'"
+ location: https://storagename.table.core.windows.net/querytable800f16e2(PartitionKey='pk800f16e2',RowKey='rk800f16e212')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable800f16e2
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable800f16e2()?$select=age,%20sex
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable800f16e2&$select=age,%20sex","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A30.5282919Z''\"","age@odata.type":"Edm.Int64","age":"39","sex":"male"},{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A30.6073436Z''\"","age@odata.type":"Edm.Int64","age":"39","sex":"male"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:30 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable800f16e2()?$select=age,%20sex
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable800f16e2')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:30 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable800f16e2')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable800f16e2')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:30 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('querytable800f16e2')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_top.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_top.yaml
new file mode 100644
index 000000000000..af7f41dca97d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_top.yaml
@@ -0,0 +1,328 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable3ccf15b5"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:31 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable3ccf15b5"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable3ccf15b5')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "querytable3ccf15b5"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable3ccf15b5"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ location: https://storagename.table.core.windows.net/Tables('querytable3ccf15b5')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk3ccf15b5", "RowKey": "rk3ccf15b51", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable3ccf15b5
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable3ccf15b5/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A31.3262287Z''\"","PartitionKey":"pk3ccf15b5","RowKey":"rk3ccf15b51","Timestamp":"2020-07-30T13:33:31.3262287Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A31.3262287Z'"
+ location: https://storagename.table.core.windows.net/querytable3ccf15b5(PartitionKey='pk3ccf15b5',RowKey='rk3ccf15b51')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable3ccf15b5
+- request:
+ body: '{"PartitionKey": "pk3ccf15b5", "RowKey": "rk3ccf15b512", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable3ccf15b5
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable3ccf15b5/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A31.4082838Z''\"","PartitionKey":"pk3ccf15b5","RowKey":"rk3ccf15b512","Timestamp":"2020-07-30T13:33:31.4082838Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A31.4082838Z'"
+ location: https://storagename.table.core.windows.net/querytable3ccf15b5(PartitionKey='pk3ccf15b5',RowKey='rk3ccf15b512')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable3ccf15b5
+- request:
+ body: '{"PartitionKey": "pk3ccf15b5", "RowKey": "rk3ccf15b5123", "age": "39",
+ "age@odata.type": "Edm.Int64", "sex": "male", "married": true, "deceased": false,
+ "ratio": 3.1, "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64",
+ "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday":
+ "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5",
+ "binary@odata.type": "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '540'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable3ccf15b5
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable3ccf15b5/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A31.4863362Z''\"","PartitionKey":"pk3ccf15b5","RowKey":"rk3ccf15b5123","Timestamp":"2020-07-30T13:33:31.4863362Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A31.4863362Z'"
+ location: https://storagename.table.core.windows.net/querytable3ccf15b5(PartitionKey='pk3ccf15b5',RowKey='rk3ccf15b5123')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable3ccf15b5
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable3ccf15b5()?$top=2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable3ccf15b5","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A31.3262287Z''\"","PartitionKey":"pk3ccf15b5","RowKey":"rk3ccf15b51","Timestamp":"2020-07-30T13:33:31.3262287Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A31.4082838Z''\"","PartitionKey":"pk3ccf15b5","RowKey":"rk3ccf15b512","Timestamp":"2020-07-30T13:33:31.4082838Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-continuation-nextpartitionkey: 1!16!cGszY2NmMTViNQ--
+ x-ms-continuation-nextrowkey: 1!20!cmszY2NmMTViNTEyMw--
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable3ccf15b5()?$top=2
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable3ccf15b5()?$top=2&NextPartitionKey=1!16!cGszY2NmMTViNQ--&NextRowKey=1!20!cmszY2NmMTViNTEyMw--
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable3ccf15b5","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A31.4863362Z''\"","PartitionKey":"pk3ccf15b5","RowKey":"rk3ccf15b5123","Timestamp":"2020-07-30T13:33:31.4863362Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable3ccf15b5()?$top=2&NextPartitionKey=1!16!cGszY2NmMTViNQ--&NextRowKey=1!20!cmszY2NmMTViNTEyMw--
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable3ccf15b5')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable3ccf15b5')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable3ccf15b5')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('querytable3ccf15b5')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_top_and_next.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_top_and_next.yaml
new file mode 100644
index 000000000000..0fedde43bb5a
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_entities_with_top_and_next.yaml
@@ -0,0 +1,450 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable121a1965"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:32 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable121a1965"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable121a1965')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "querytable121a1965"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytable121a1965"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:31 GMT
+ location: https://storagename.table.core.windows.net/Tables('querytable121a1965')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk121a1965", "RowKey": "rk121a19651", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '538'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable121a1965
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable121a1965/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.3079379Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a19651","Timestamp":"2020-07-30T13:33:32.3079379Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A32.3079379Z'"
+ location: https://storagename.table.core.windows.net/querytable121a1965(PartitionKey='pk121a1965',RowKey='rk121a19651')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable121a1965
+- request:
+ body: '{"PartitionKey": "pk121a1965", "RowKey": "rk121a196512", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '539'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable121a1965
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable121a1965/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.3849929Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a196512","Timestamp":"2020-07-30T13:33:32.3849929Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A32.3849929Z'"
+ location: https://storagename.table.core.windows.net/querytable121a1965(PartitionKey='pk121a1965',RowKey='rk121a196512')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable121a1965
+- request:
+ body: '{"PartitionKey": "pk121a1965", "RowKey": "rk121a1965123", "age": "39",
+ "age@odata.type": "Edm.Int64", "sex": "male", "married": true, "deceased": false,
+ "ratio": 3.1, "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64",
+ "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday":
+ "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5",
+ "binary@odata.type": "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '540'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable121a1965
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable121a1965/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.4630479Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a1965123","Timestamp":"2020-07-30T13:33:32.4630479Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A32.4630479Z'"
+ location: https://storagename.table.core.windows.net/querytable121a1965(PartitionKey='pk121a1965',RowKey='rk121a1965123')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable121a1965
+- request:
+ body: '{"PartitionKey": "pk121a1965", "RowKey": "rk121a19651234", "age": "39",
+ "age@odata.type": "Edm.Int64", "sex": "male", "married": true, "deceased": false,
+ "ratio": 3.1, "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64",
+ "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday":
+ "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5",
+ "binary@odata.type": "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '541'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable121a1965
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable121a1965/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.5411024Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a19651234","Timestamp":"2020-07-30T13:33:32.5411024Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A32.5411024Z'"
+ location: https://storagename.table.core.windows.net/querytable121a1965(PartitionKey='pk121a1965',RowKey='rk121a19651234')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable121a1965
+- request:
+ body: '{"PartitionKey": "pk121a1965", "RowKey": "rk121a196512345", "age": "39",
+ "age@odata.type": "Edm.Int64", "sex": "male", "married": true, "deceased": false,
+ "ratio": 3.1, "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64",
+ "Birthday": "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday":
+ "1970-10-04T00:00:00Z", "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5",
+ "binary@odata.type": "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '542'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/querytable121a1965
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable121a1965/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.6241603Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a196512345","Timestamp":"2020-07-30T13:33:32.6241603Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A32.6241603Z'"
+ location: https://storagename.table.core.windows.net/querytable121a1965(PartitionKey='pk121a1965',RowKey='rk121a196512345')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable121a1965
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable121a1965()?$top=2
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable121a1965","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.3079379Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a19651","Timestamp":"2020-07-30T13:33:32.3079379Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.3849929Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a196512","Timestamp":"2020-07-30T13:33:32.3849929Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-continuation-nextpartitionkey: 1!16!cGsxMjFhMTk2NQ--
+ x-ms-continuation-nextrowkey: 1!20!cmsxMjFhMTk2NTEyMw--
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable121a1965()?$top=2
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable121a1965()?$top=2&NextPartitionKey=1!16!cGsxMjFhMTk2NQ--&NextRowKey=1!20!cmsxMjFhMTk2NTEyMw--
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable121a1965","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.4630479Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a1965123","Timestamp":"2020-07-30T13:33:32.4630479Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"},{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.5411024Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a19651234","Timestamp":"2020-07-30T13:33:32.5411024Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-continuation-nextpartitionkey: 1!16!cGsxMjFhMTk2NQ--
+ x-ms-continuation-nextrowkey: 1!20!cmsxMjFhMTk2NTEyMzQ1
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable121a1965()?$top=2&NextPartitionKey=1!16!cGsxMjFhMTk2NQ--&NextRowKey=1!20!cmsxMjFhMTk2NTEyMw--
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytable121a1965()?$top=2&NextPartitionKey=1!16!cGsxMjFhMTk2NQ--&NextRowKey=1!20!cmsxMjFhMTk2NTEyMzQ1
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytable121a1965","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A32.6241603Z''\"","PartitionKey":"pk121a1965","RowKey":"rk121a196512345","Timestamp":"2020-07-30T13:33:32.6241603Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytable121a1965()?$top=2&NextPartitionKey=1!16!cGsxMjFhMTk2NQ--&NextRowKey=1!20!cmsxMjFhMTk2NTEyMzQ1
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:33 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable121a1965')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable121a1965')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytable121a1965')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('querytable121a1965')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_zero_entities.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_zero_entities.yaml
new file mode 100644
index 000000000000..e85ccf3abfcb
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_zero_entities.yaml
@@ -0,0 +1,162 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee8d41407"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee8d41407"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablee8d41407')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"TableName": "querytablee8d41407"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '35'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"querytablee8d41407"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ location: https://storagename.table.core.windows.net/Tables('querytablee8d41407')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/querytablee8d41407()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#querytablee8d41407","value":[]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:32 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/querytablee8d41407()
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee8d41407')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:33 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablee8d41407')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('querytablee8d41407')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:33 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('querytablee8d41407')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add.yaml
new file mode 100644
index 000000000000..3b20767dc4cc
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add.yaml
@@ -0,0 +1,143 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable13ae0ebd"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:34 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable13ae0ebd"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:33 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable13ae0ebd')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk13ae0ebd", "RowKey": "rk13ae0ebd", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable13ae0ebd?st=2020-07-30T13:32:35Z&se=2020-07-30T14:33:35Z&sp=a&sv=2019-07-07&tn=uttable13ae0ebd&sig=WxzHZgYHDTlzLoEOhOtqM2qCfpzt/sMOfTbaHPOn58s%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable13ae0ebd/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A34.3757525Z''\"","PartitionKey":"pk13ae0ebd","RowKey":"rk13ae0ebd","Timestamp":"2020-07-30T13:33:34.3757525Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:33 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A34.3757525Z'"
+ location: https://storagename.table.core.windows.net/uttable13ae0ebd(PartitionKey='pk13ae0ebd',RowKey='rk13ae0ebd')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable13ae0ebd?st=2020-07-30T13:32:35Z&se=2020-07-30T14:33:35Z&sp=a&sv=2019-07-07&tn=uttable13ae0ebd&sig=WxzHZgYHDTlzLoEOhOtqM2qCfpzt/sMOfTbaHPOn58s%3D
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable13ae0ebd(PartitionKey='pk13ae0ebd',RowKey='rk13ae0ebd')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable13ae0ebd/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A34.3757525Z''\"","PartitionKey":"pk13ae0ebd","RowKey":"rk13ae0ebd","Timestamp":"2020-07-30T13:33:34.3757525Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:33 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A34.3757525Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable13ae0ebd(PartitionKey='pk13ae0ebd',RowKey='rk13ae0ebd')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable13ae0ebd')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:33 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable13ae0ebd')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add_inside_range.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add_inside_range.yaml
new file mode 100644
index 000000000000..24a27ff11755
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add_inside_range.yaml
@@ -0,0 +1,143 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablef8471404"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablef8471404"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:34 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablef8471404')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "test", "RowKey": "test1", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '526'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:35 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablef8471404?se=2020-07-30T14:33:35Z&sp=a&sv=2019-07-07&tn=uttablef8471404&spk=test&srk=test1&epk=test&erk=test1&sig=7duoTvsLWKu/FhiLqPQM5VxWnCc/a4fARPfYUuPOqZw%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablef8471404/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A35.2671919Z''\"","PartitionKey":"test","RowKey":"test1","Timestamp":"2020-07-30T13:33:35.2671919Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:34 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A35.2671919Z'"
+ location: https://storagename.table.core.windows.net/uttablef8471404(PartitionKey='test',RowKey='test1')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablef8471404?se=2020-07-30T14:33:35Z&sp=a&sv=2019-07-07&tn=uttablef8471404&spk=test&srk=test1&epk=test&erk=test1&sig=7duoTvsLWKu/FhiLqPQM5VxWnCc/a4fARPfYUuPOqZw%3D
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:36 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablef8471404(PartitionKey='test',RowKey='test1')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablef8471404/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A35.2671919Z''\"","PartitionKey":"test","RowKey":"test1","Timestamp":"2020-07-30T13:33:35.2671919Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:34 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A35.2671919Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablef8471404(PartitionKey='test',RowKey='test1')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:36 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablef8471404')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:35 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablef8471404')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add_outside_range.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add_outside_range.yaml
new file mode 100644
index 000000000000..b3ccdbcfd505
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_add_outside_range.yaml
@@ -0,0 +1,109 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablede71485"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '31'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:36 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablede71485"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:35 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablede71485')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkde71485", "RowKey": "rkde71485", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '535'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:36 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:36 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablede71485?se=2020-07-30T14:33:36Z&sp=a&sv=2019-07-07&tn=uttablede71485&spk=test&srk=test1&epk=test&erk=test1&sig=TwwbtbiFSisOHC74dgcQHfcipNxl2Nw15ydMVKpJ9U4%3D
+ response:
+ body:
+ string: '{"odata.error":{"code":"AuthorizationFailure","message":{"lang":"en-US","value":"This
+ request is not authorized to perform this operation.\nRequestId:552d0ca1-f002-0073-1f76-667ac9000000\nTime:2020-07-30T13:33:36.0762491Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:35 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 403
+ message: Forbidden
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablede71485?se=2020-07-30T14:33:36Z&sp=a&sv=2019-07-07&tn=uttablede71485&spk=test&srk=test1&epk=test&erk=test1&sig=TwwbtbiFSisOHC74dgcQHfcipNxl2Nw15ydMVKpJ9U4%3D
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablede71485')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:35 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablede71485')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_delete.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_delete.yaml
new file mode 100644
index 000000000000..92a1f0000070
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_delete.yaml
@@ -0,0 +1,174 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable42981007"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable42981007"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:35 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable42981007')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk42981007", "RowKey": "rk42981007", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable42981007
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable42981007/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A36.5681979Z''\"","PartitionKey":"pk42981007","RowKey":"rk42981007","Timestamp":"2020-07-30T13:33:36.5681979Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:35 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A36.5681979Z'"
+ location: https://storagename.table.core.windows.net/uttable42981007(PartitionKey='pk42981007',RowKey='rk42981007')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42981007
+- request:
+ body: null
+ headers:
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/uttable42981007(PartitionKey='pk42981007',RowKey='rk42981007')?se=2020-07-30T14:33:37Z&sp=d&sv=2019-07-07&tn=uttable42981007&sig=4Z9kxh5oJNJvciPDm3x52tEKQ7RkjwQ6dz2/zZIBHAo%3D
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:36 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42981007(PartitionKey='pk42981007',RowKey='rk42981007')?se=2020-07-30T14:33:37Z&sp=d&sv=2019-07-07&tn=uttable42981007&sig=4Z9kxh5oJNJvciPDm3x52tEKQ7RkjwQ6dz2/zZIBHAo%3D
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:37 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable42981007(PartitionKey='pk42981007',RowKey='rk42981007')
+ response:
+ body:
+ string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
+ specified resource does not exist.\nRequestId:ab8779d8-d002-004d-5a76-66cce8000000\nTime:2020-07-30T13:33:36.9524748Z"}}}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:36 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42981007(PartitionKey='pk42981007',RowKey='rk42981007')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable42981007')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:36 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable42981007')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_query.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_query.yaml
new file mode 100644
index 000000000000..159f9d6cf355
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_query.yaml
@@ -0,0 +1,142 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable331c0fca"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable331c0fca"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:36 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable331c0fca')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk331c0fca", "RowKey": "rk331c0fca", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable331c0fca
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable331c0fca/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A37.4490452Z''\"","PartitionKey":"pk331c0fca","RowKey":"rk331c0fca","Timestamp":"2020-07-30T13:33:37.4490452Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:36 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A37.4490452Z'"
+ location: https://storagename.table.core.windows.net/uttable331c0fca(PartitionKey='pk331c0fca',RowKey='rk331c0fca')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable331c0fca
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable331c0fca()?st=2020-07-30T13:32:38Z&se=2020-07-30T14:33:38Z&sp=r&sv=2019-07-07&tn=uttable331c0fca&sig=3rch/4gu9Mvfd4m3oaojF5iruQ8d4qQgSVcSD/GfRIw%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable331c0fca","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A37.4490452Z''\"","PartitionKey":"pk331c0fca","RowKey":"rk331c0fca","Timestamp":"2020-07-30T13:33:37.4490452Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:37 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable331c0fca()?st=2020-07-30T13:32:38Z&se=2020-07-30T14:33:38Z&sp=r&sv=2019-07-07&tn=uttable331c0fca&sig=3rch/4gu9Mvfd4m3oaojF5iruQ8d4qQgSVcSD/GfRIw%3D
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable331c0fca')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:37 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable331c0fca')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_signed_identifier.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_signed_identifier.yaml
new file mode 100644
index 000000000000..7619d39d62fe
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_signed_identifier.yaml
@@ -0,0 +1,175 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablee481490"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '31'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:38 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablee481490"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:37 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablee481490')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pke481490", "RowKey": "rke481490", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '535'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablee481490
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee481490/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A38.2608037Z''\"","PartitionKey":"pke481490","RowKey":"rke481490","Timestamp":"2020-07-30T13:33:38.2608037Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:37 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A38.2608037Z'"
+ location: https://storagename.table.core.windows.net/uttablee481490(PartitionKey='pke481490',RowKey='rke481490')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablee481490
+- request:
+ body: '
+
+ testid2011-10-11T00:00:00Z2020-10-12T00:00:00Zr'
+ headers:
+ Accept:
+ - application/xml
+ Content-Length:
+ - '257'
+ Content-Type:
+ - application/xml
+ Date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttablee481490?comp=acl
+ response:
+ body:
+ string: ''
+ headers:
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:38 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablee481490?comp=acl
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablee481490()?sv=2019-07-07&si=testid&tn=uttablee481490&sig=RWZ1rGuXKKZLqORU0cZb%2BJNGhO3/2QlfMY0Osw1Ukmo%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablee481490","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A38.2608037Z''\"","PartitionKey":"pke481490","RowKey":"rke481490","Timestamp":"2020-07-30T13:33:38.2608037Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:38 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablee481490()?sv=2019-07-07&si=testid&tn=uttablee481490&sig=RWZ1rGuXKKZLqORU0cZb%2BJNGhO3/2QlfMY0Osw1Ukmo%3D
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablee481490')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:38 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablee481490')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_update.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_update.yaml
new file mode 100644
index 000000000000..f224177c6b42
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_update.yaml
@@ -0,0 +1,181 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable43091017"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:39 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable43091017"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:38 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable43091017')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk43091017", "RowKey": "rk43091017", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable43091017
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable43091017/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A39.2403647Z''\"","PartitionKey":"pk43091017","RowKey":"rk43091017","Timestamp":"2020-07-30T13:33:39.2403647Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:38 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A39.2403647Z'"
+ location: https://storagename.table.core.windows.net/uttable43091017(PartitionKey='pk43091017',RowKey='rk43091017')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable43091017
+- request:
+ body: '{"PartitionKey": "pk43091017", "RowKey": "rk43091017", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable43091017(PartitionKey='pk43091017',RowKey='rk43091017')?se=2020-07-30T14:33:40Z&sp=u&sv=2019-07-07&tn=uttable43091017&sig=/M5WdeL2zW%2B%2Biy3EwaS/ceaedpQXFs0OMKWXRdfnaCs%3D
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:39 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A39.5627442Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable43091017(PartitionKey='pk43091017',RowKey='rk43091017')?se=2020-07-30T14:33:40Z&sp=u&sv=2019-07-07&tn=uttable43091017&sig=/M5WdeL2zW%2B%2Biy3EwaS/ceaedpQXFs0OMKWXRdfnaCs%3D
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable43091017(PartitionKey='pk43091017',RowKey='rk43091017')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable43091017/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A39.5627442Z''\"","PartitionKey":"pk43091017","RowKey":"rk43091017","Timestamp":"2020-07-30T13:33:39.5627442Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:39 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A39.5627442Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable43091017(PartitionKey='pk43091017',RowKey='rk43091017')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable43091017')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:39 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable43091017')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_upper_case_table_name.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_upper_case_table_name.yaml
new file mode 100644
index 000000000000..5341421c5fe8
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_sas_upper_case_table_name.yaml
@@ -0,0 +1,142 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable65261622"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:40 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable65261622"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:39 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable65261622')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk65261622", "RowKey": "rk65261622", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable65261622
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable65261622/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A40.1430638Z''\"","PartitionKey":"pk65261622","RowKey":"rk65261622","Timestamp":"2020-07-30T13:33:40.1430638Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:39 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A40.1430638Z'"
+ location: https://storagename.table.core.windows.net/uttable65261622(PartitionKey='pk65261622',RowKey='rk65261622')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable65261622
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable65261622()?st=2020-07-30T13:32:41Z&se=2020-07-30T14:33:41Z&sp=r&sv=2019-07-07&tn=UTTABLE65261622&sig=8sgKEU7fUTZ87pIwZNa7aZMUE6bs5YtrYTEBfgSa7Pc%3D
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable65261622","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A40.1430638Z''\"","PartitionKey":"pk65261622","RowKey":"rk65261622","Timestamp":"2020-07-30T13:33:40.1430638Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:39 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable65261622()?st=2020-07-30T13:32:41Z&se=2020-07-30T14:33:41Z&sp=r&sv=2019-07-07&tn=UTTABLE65261622&sig=8sgKEU7fUTZ87pIwZNa7aZMUE6bs5YtrYTEBfgSa7Pc%3D
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable65261622')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:40 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable65261622')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_timezone.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_timezone.yaml
new file mode 100644
index 000000000000..b0c69c3ce162
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_timezone.yaml
@@ -0,0 +1,138 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable23a30f59"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable23a30f59"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:40 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable23a30f59')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk23a30f59", "RowKey": "rk23a30f59", "date": "2003-09-27T09:52:43Z",
+ "date@odata.type": "Edm.DateTime"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '121'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable23a30f59
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable23a30f59/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A40.9211942Z''\"","PartitionKey":"pk23a30f59","RowKey":"rk23a30f59","Timestamp":"2020-07-30T13:33:40.9211942Z","date@odata.type":"Edm.DateTime","date":"2003-09-27T09:52:43Z"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:40 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A40.9211942Z'"
+ location: https://storagename.table.core.windows.net/uttable23a30f59(PartitionKey='pk23a30f59',RowKey='rk23a30f59')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable23a30f59
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:41 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable23a30f59(PartitionKey='pk23a30f59',RowKey='rk23a30f59')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable23a30f59/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A40.9211942Z''\"","PartitionKey":"pk23a30f59","RowKey":"rk23a30f59","Timestamp":"2020-07-30T13:33:40.9211942Z","date@odata.type":"Edm.DateTime","date":"2003-09-27T09:52:43Z"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:40 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A40.9211942Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable23a30f59(PartitionKey='pk23a30f59',RowKey='rk23a30f59')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable23a30f59')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:40 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable23a30f59')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_unicode_property_name.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_unicode_property_name.yaml
new file mode 100644
index 000000000000..088e51bb0e13
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_unicode_property_name.yaml
@@ -0,0 +1,176 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable103b14b9"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable103b14b9"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:40 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable103b14b9')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk103b14b9", "RowKey": "rk103b14b9", "\u554a\u9f44\u4e02\u72db\u72dc":
+ "\ua015"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '98'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable103b14b9
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable103b14b9/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A41.4943173Z''\"","PartitionKey":"pk103b14b9","RowKey":"rk103b14b9","Timestamp":"2020-07-30T13:33:41.4943173Z","\u554a\u9f44\u4e02\u72db\u72dc":"\ua015"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:40 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A41.4943173Z'"
+ location: https://storagename.table.core.windows.net/uttable103b14b9(PartitionKey='pk103b14b9',RowKey='rk103b14b9')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable103b14b9
+- request:
+ body: '{"PartitionKey": "pk103b14b9", "RowKey": "test2", "\u554a\u9f44\u4e02\u72db\u72dc":
+ "hello"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '92'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable103b14b9
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable103b14b9/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A41.5763716Z''\"","PartitionKey":"pk103b14b9","RowKey":"test2","Timestamp":"2020-07-30T13:33:41.5763716Z","\u554a\u9f44\u4e02\u72db\u72dc":"hello"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:40 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A41.5763716Z'"
+ location: https://storagename.table.core.windows.net/uttable103b14b9(PartitionKey='pk103b14b9',RowKey='test2')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable103b14b9
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable103b14b9()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable103b14b9","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A41.4943173Z''\"","PartitionKey":"pk103b14b9","RowKey":"rk103b14b9","Timestamp":"2020-07-30T13:33:41.4943173Z","\u554a\u9f44\u4e02\u72db\u72dc":"\ua015"},{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A41.5763716Z''\"","PartitionKey":"pk103b14b9","RowKey":"test2","Timestamp":"2020-07-30T13:33:41.5763716Z","\u554a\u9f44\u4e02\u72db\u72dc":"hello"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:41 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable103b14b9()
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable103b14b9')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:41 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable103b14b9')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_unicode_property_value.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_unicode_property_value.yaml
new file mode 100644
index 000000000000..779fda5149a2
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_unicode_property_value.yaml
@@ -0,0 +1,174 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable259e1535"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:42 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable259e1535"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:41 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable259e1535')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk259e1535", "RowKey": "rk259e1535", "Description": "\ua015"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '79'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable259e1535
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable259e1535/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A42.1455988Z''\"","PartitionKey":"pk259e1535","RowKey":"rk259e1535","Timestamp":"2020-07-30T13:33:42.1455988Z","Description":"\ua015"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:41 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A42.1455988Z'"
+ location: https://storagename.table.core.windows.net/uttable259e1535(PartitionKey='pk259e1535',RowKey='rk259e1535')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable259e1535
+- request:
+ body: '{"PartitionKey": "pk259e1535", "RowKey": "test2", "Description": "\ua015"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '74'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable259e1535
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable259e1535/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A42.2226551Z''\"","PartitionKey":"pk259e1535","RowKey":"test2","Timestamp":"2020-07-30T13:33:42.2226551Z","Description":"\ua015"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:42 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A42.2226551Z'"
+ location: https://storagename.table.core.windows.net/uttable259e1535(PartitionKey='pk259e1535',RowKey='test2')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable259e1535
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable259e1535()
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable259e1535","value":[{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A42.1455988Z''\"","PartitionKey":"pk259e1535","RowKey":"rk259e1535","Timestamp":"2020-07-30T13:33:42.1455988Z","Description":"\ua015"},{"odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A42.2226551Z''\"","PartitionKey":"pk259e1535","RowKey":"test2","Timestamp":"2020-07-30T13:33:42.2226551Z","Description":"\ua015"}]}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:42 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable259e1535()
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable259e1535')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:42 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable259e1535')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity.yaml
new file mode 100644
index 000000000000..0d134f54739d
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity.yaml
@@ -0,0 +1,181 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable75d9116d"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable75d9116d"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:42 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable75d9116d')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk75d9116d", "RowKey": "rk75d9116d", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable75d9116d
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable75d9116d/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A42.8016945Z''\"","PartitionKey":"pk75d9116d","RowKey":"rk75d9116d","Timestamp":"2020-07-30T13:33:42.8016945Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:42 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A42.8016945Z'"
+ location: https://storagename.table.core.windows.net/uttable75d9116d(PartitionKey='pk75d9116d',RowKey='rk75d9116d')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable75d9116d
+- request:
+ body: '{"PartitionKey": "pk75d9116d", "RowKey": "rk75d9116d", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable75d9116d(PartitionKey='pk75d9116d',RowKey='rk75d9116d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:42 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A42.8821308Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable75d9116d(PartitionKey='pk75d9116d',RowKey='rk75d9116d')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:43 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttable75d9116d(PartitionKey='pk75d9116d',RowKey='rk75d9116d')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable75d9116d/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A42.8821308Z''\"","PartitionKey":"pk75d9116d","RowKey":"rk75d9116d","Timestamp":"2020-07-30T13:33:42.8821308Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:42 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A42.8821308Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable75d9116d(PartitionKey='pk75d9116d',RowKey='rk75d9116d')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable75d9116d')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:42 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable75d9116d')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_not_existing.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_not_existing.yaml
new file mode 100644
index 000000000000..3c820f4b0c60
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_not_existing.yaml
@@ -0,0 +1,109 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable7e8316e7"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable7e8316e7"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable7e8316e7')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk7e8316e7", "RowKey": "rk7e8316e7", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ If-Match:
+ - '*'
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable7e8316e7(PartitionKey='pk7e8316e7',RowKey='rk7e8316e7')
+ response:
+ body:
+ string: 'ResourceNotFound
The specified resource does not exist.
+
+ RequestId:7fdb0557-b002-0012-6176-663e16000000
+
+ Time:2020-07-30T13:33:43.4765134Z'
+ headers:
+ cache-control: no-cache
+ content-type: application/xml;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 404
+ message: Not Found
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable7e8316e7(PartitionKey='pk7e8316e7',RowKey='rk7e8316e7')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable7e8316e7')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable7e8316e7')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_with_if_doesnt_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_with_if_doesnt_match.yaml
new file mode 100644
index 000000000000..d6aa209277db
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_with_if_doesnt_match.yaml
@@ -0,0 +1,153 @@
+interactions:
+- request:
+ body: '{"TableName": "uttable42cf1a0e"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable42cf1a0e"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttable42cf1a0e')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pk42cf1a0e", "RowKey": "rk42cf1a0e", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:44 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttable42cf1a0e
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttable42cf1a0e/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A43.9720295Z''\"","PartitionKey":"pk42cf1a0e","RowKey":"rk42cf1a0e","Timestamp":"2020-07-30T13:33:43.9720295Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A43.9720295Z'"
+ location: https://storagename.table.core.windows.net/uttable42cf1a0e(PartitionKey='pk42cf1a0e',RowKey='rk42cf1a0e')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42cf1a0e
+- request:
+ body: '{"PartitionKey": "pk42cf1a0e", "RowKey": "rk42cf1a0e", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ If-Match:
+ - W/"datetime'2012-06-15T22%3A51%3A44.9662825Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttable42cf1a0e(PartitionKey='pk42cf1a0e',RowKey='rk42cf1a0e')
+ response:
+ body:
+ string: 'UpdateConditionNotSatisfied
The update condition specified in the request was not satisfied.
+
+ RequestId:d60563e1-d002-006f-1976-66a2de000000
+
+ Time:2020-07-30T13:33:44.0560854Z'
+ headers:
+ cache-control: no-cache
+ content-type: application/xml;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 412
+ message: Precondition Failed
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttable42cf1a0e(PartitionKey='pk42cf1a0e',RowKey='rk42cf1a0e')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttable42cf1a0e')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttable42cf1a0e')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_with_if_matches.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_with_if_matches.yaml
new file mode 100644
index 000000000000..2451cec2d1ef
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_update_entity_with_if_matches.yaml
@@ -0,0 +1,181 @@
+interactions:
+- request:
+ body: '{"TableName": "uttablec46617fa"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '32'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/Tables
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablec46617fa"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ location: https://storagename.table.core.windows.net/Tables('uttablec46617fa')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables
+- request:
+ body: '{"PartitionKey": "pkc46617fa", "RowKey": "rkc46617fa", "age": "39", "age@odata.type":
+ "Edm.Int64", "sex": "male", "married": true, "deceased": false, "ratio": 3.1,
+ "evenratio": 3.0, "large": "933311100", "large@odata.type": "Edm.Int64", "Birthday":
+ "1973-10-04T00:00:00Z", "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z",
+ "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type":
+ "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833",
+ "clsid@odata.type": "Edm.Guid"}'
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ Content-Length:
+ - '537'
+ Content-Type:
+ - application/json;odata=nometadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: POST
+ uri: https://storagename.table.core.windows.net/uttablec46617fa
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablec46617fa/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A44.565449Z''\"","PartitionKey":"pkc46617fa","RowKey":"rkc46617fa","Timestamp":"2020-07-30T13:33:44.565449Z","age@odata.type":"Edm.Int64","age":"39","sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large@odata.type":"Edm.Int64","large":"933311100","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A44.565449Z'"
+ location: https://storagename.table.core.windows.net/uttablec46617fa(PartitionKey='pkc46617fa',RowKey='rkc46617fa')
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 201
+ message: Created
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablec46617fa
+- request:
+ body: '{"PartitionKey": "pkc46617fa", "RowKey": "rkc46617fa", "age": "abc", "sex":
+ "female", "sign": "aquarius", "birthday": "1991-10-04T00:00:00Z", "birthday@odata.type":
+ "Edm.DateTime"}'
+ headers:
+ Content-Length:
+ - '180'
+ Content-Type:
+ - application/json
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ If-Match:
+ - W/"datetime'2020-07-30T13%3A33%3A44.565449Z'"
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/uttablec46617fa(PartitionKey='pkc46617fa',RowKey='rkc46617fa')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A44.6504014Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablec46617fa(PartitionKey='pkc46617fa',RowKey='rkc46617fa')
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/json;odata=minimalmetadata
+ DataServiceVersion:
+ - '3.0'
+ Date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/uttablec46617fa(PartitionKey='pkc46617fa',RowKey='rkc46617fa')
+ response:
+ body:
+ string: '{"odata.metadata":"https://storagename.table.core.windows.net/$metadata#uttablec46617fa/@Element","odata.etag":"W/\"datetime''2020-07-30T13%3A33%3A44.6504014Z''\"","PartitionKey":"pkc46617fa","RowKey":"rkc46617fa","Timestamp":"2020-07-30T13:33:44.6504014Z","age":"abc","birthday@odata.type":"Edm.DateTime","birthday":"1991-10-04T00:00:00Z","sex":"female","sign":"aquarius"}'
+ headers:
+ cache-control: no-cache
+ content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
+ date: Thu, 30 Jul 2020 13:33:43 GMT
+ etag: W/"datetime'2020-07-30T13%3A33%3A44.6504014Z'"
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding: chunked
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 200
+ message: OK
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/uttablec46617fa(PartitionKey='pkc46617fa',RowKey='rkc46617fa')
+- request:
+ body: null
+ headers:
+ Date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Thu, 30 Jul 2020 13:33:45 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: DELETE
+ uri: https://storagename.table.core.windows.net/Tables('uttablec46617fa')
+ response:
+ body:
+ string: ''
+ headers:
+ cache-control: no-cache
+ content-length: '0'
+ date: Thu, 30 Jul 2020 13:33:44 GMT
+ server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-content-type-options: nosniff
+ x-ms-version: '2019-07-07'
+ status:
+ code: 204
+ message: No Content
+ url: https://pyacrstorageubqarxe6dhep.table.core.windows.net/Tables('uttablec46617fa')
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_retention_too_long.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_retention_too_long.yaml
new file mode 100644
index 000000000000..2261cd4e7fdf
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_retention_too_long.yaml
@@ -0,0 +1,51 @@
+interactions:
+- request:
+ body: '
+
+ 1.0truetruetrue366'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '273'
+ Content-Type:
+ - application/xml
+ Date:
+ - Mon, 27 Jul 2020 14:13:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:13:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: 'InvalidXmlDocumentXML specified is not syntactically valid.
+
+ RequestId:64885058-b002-006e-2a20-647748000000
+
+ Time:2020-07-27T14:13:17.6459931Z'
+ headers:
+ content-length:
+ - '327'
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:13:17 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-error-code:
+ - InvalidXmlDocument
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 400
+ message: XML specified is not syntactically valid.
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_cors.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_cors.yaml
new file mode 100644
index 000000000000..0d783e68fc65
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_cors.yaml
@@ -0,0 +1,82 @@
+interactions:
+- request:
+ body: '
+
+ www.xyz.comGET0www.xyz.com,www.ab.com,www.bc.comGET,PUTx-ms-meta-data*,x-ms-meta-target*,x-ms-meta-xyz,x-ms-meta-foox-ms-meta-data*,x-ms-meta-source*,x-ms-meta-abc,x-ms-meta-bcd500'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '631'
+ Content-Type:
+ - application/xml
+ Date:
+ - Mon, 27 Jul 2020 14:13:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:13:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: ''
+ headers:
+ date:
+ - Mon, 27 Jul 2020 14:13:17 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 202
+ message: Accepted
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Mon, 27 Jul 2020 14:13:48 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:13:48 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: "\uFEFF1.0falsefalsefalsefalse1.0truetruetrue71.0falsefalseGETwww.xyz.com0GET,PUTwww.xyz.com,www.ab.com,www.bc.comx-ms-meta-xyz,x-ms-meta-foo,x-ms-meta-data*,x-ms-meta-target*x-ms-meta-abc,x-ms-meta-bcd,x-ms-meta-data*,x-ms-meta-source*500"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:13:47 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ vary:
+ - Origin
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_hour_metrics.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_hour_metrics.yaml
new file mode 100644
index 000000000000..2869e4fcbb32
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_hour_metrics.yaml
@@ -0,0 +1,81 @@
+interactions:
+- request:
+ body: '
+
+ 1.0truetruetrue5'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '267'
+ Content-Type:
+ - application/xml
+ Date:
+ - Mon, 27 Jul 2020 14:13:48 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:13:48 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: ''
+ headers:
+ date:
+ - Mon, 27 Jul 2020 14:13:48 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 202
+ message: Accepted
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Mon, 27 Jul 2020 14:14:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:14:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: "\uFEFF1.0falsefalsefalsefalse1.0truetruetrue51.0falsefalseGETwww.xyz.com0GET,PUTwww.xyz.com,www.ab.com,www.bc.comx-ms-meta-xyz,x-ms-meta-foo,x-ms-meta-data*,x-ms-meta-target*x-ms-meta-abc,x-ms-meta-bcd,x-ms-meta-data*,x-ms-meta-source*500"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:14:18 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ vary:
+ - Origin
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_logging.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_logging.yaml
new file mode 100644
index 000000000000..3cf3b29b2d6b
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_logging.yaml
@@ -0,0 +1,81 @@
+interactions:
+- request:
+ body: '
+
+ 1.0truetruetruetrue5'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '262'
+ Content-Type:
+ - application/xml
+ Date:
+ - Mon, 27 Jul 2020 14:14:18 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:14:18 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: ''
+ headers:
+ date:
+ - Mon, 27 Jul 2020 14:14:18 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 202
+ message: Accepted
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Mon, 27 Jul 2020 14:14:49 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:14:49 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: "\uFEFF1.0truetruetruetrue51.0truetruetrue51.0falsefalseGETwww.xyz.com0GET,PUTwww.xyz.com,www.ab.com,www.bc.comx-ms-meta-xyz,x-ms-meta-foo,x-ms-meta-data*,x-ms-meta-target*x-ms-meta-abc,x-ms-meta-bcd,x-ms-meta-data*,x-ms-meta-source*500"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:14:48 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ vary:
+ - Origin
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_minute_metrics.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_minute_metrics.yaml
new file mode 100644
index 000000000000..fbb969d64816
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_set_minute_metrics.yaml
@@ -0,0 +1,81 @@
+interactions:
+- request:
+ body: '
+
+ 1.0truetruetrue5'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '271'
+ Content-Type:
+ - application/xml
+ Date:
+ - Mon, 27 Jul 2020 14:14:49 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:14:49 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: ''
+ headers:
+ date:
+ - Mon, 27 Jul 2020 14:14:49 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 202
+ message: Accepted
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Mon, 27 Jul 2020 14:15:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:15:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: "\uFEFF1.0truetruetruetrue51.0truetruetrue51.0truetruetrue5GETwww.xyz.com0GET,PUTwww.xyz.com,www.ab.com,www.bc.comx-ms-meta-xyz,x-ms-meta-foo,x-ms-meta-data*,x-ms-meta-target*x-ms-meta-abc,x-ms-meta-bcd,x-ms-meta-data*,x-ms-meta-source*500"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:15:19 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ vary:
+ - Origin
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_table_service_properties.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_table_service_properties.yaml
new file mode 100644
index 000000000000..7ead60c10ac1
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_table_service_properties.yaml
@@ -0,0 +1,80 @@
+interactions:
+- request:
+ body: '
+
+ 1.0falsefalsefalsefalse1.0falsefalse1.0falsefalse'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '528'
+ Content-Type:
+ - application/xml
+ Date:
+ - Mon, 27 Jul 2020 14:15:19 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:15:19 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: ''
+ headers:
+ date:
+ - Mon, 27 Jul 2020 14:15:19 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 202
+ message: Accepted
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Mon, 27 Jul 2020 14:15:50 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:15:50 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: "\uFEFF1.0falsefalsefalsefalse1.0falsefalse1.0falsefalse"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:15:49 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_too_many_cors_rules.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_too_many_cors_rules.yaml
new file mode 100644
index 000000000000..19c947aaa589
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_properties.test_too_many_cors_rules.yaml
@@ -0,0 +1,57 @@
+interactions:
+- request:
+ body: '
+
+ www.xyz.comGET0www.xyz.comGET0www.xyz.comGET0www.xyz.comGET0www.xyz.comGET0www.xyz.comGET0'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '1143'
+ Content-Type:
+ - application/xml
+ Date:
+ - Mon, 27 Jul 2020 14:15:50 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:15:50 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: PUT
+ uri: https://storagename.table.core.windows.net/?restype=service&comp=properties
+ response:
+ body:
+ string: 'InvalidXmlDocumentXML specified is not syntactically valid.
+
+ RequestId:2f02f88a-4002-0016-0920-641fff000000
+
+ Time:2020-07-27T14:15:50.7668519Z'
+ headers:
+ content-length:
+ - '327'
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:15:49 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ x-ms-error-code:
+ - InvalidXmlDocument
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 400
+ message: XML specified is not syntactically valid.
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_stats.test_table_service_stats_f.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_stats.test_table_service_stats_f.yaml
new file mode 100644
index 000000000000..a0d6be6a6532
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_stats.test_table_service_stats_f.yaml
@@ -0,0 +1,38 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Mon, 27 Jul 2020 14:26:52 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:26:52 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://pyacrstoragestorname-secondary.table.core.windows.net/?restype=service&comp=stats
+ response:
+ body:
+ string: "\uFEFFunavailable"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:26:52 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_service_stats.test_table_service_stats_when_unavailable.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_stats.test_table_service_stats_when_unavailable.yaml
new file mode 100644
index 000000000000..9dc1202b85e1
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_service_stats.test_table_service_stats_when_unavailable.yaml
@@ -0,0 +1,38 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - application/xml
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ Date:
+ - Mon, 27 Jul 2020 14:27:17 GMT
+ User-Agent:
+ - azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
+ x-ms-date:
+ - Mon, 27 Jul 2020 14:27:17 GMT
+ x-ms-version:
+ - '2019-07-07'
+ method: GET
+ uri: https://pyacrstoragestorname-secondary.table.core.windows.net/?restype=service&comp=stats
+ response:
+ body:
+ string: "\uFEFFunavailable"
+ headers:
+ content-type:
+ - application/xml
+ date:
+ - Mon, 27 Jul 2020 14:27:17 GMT
+ server:
+ - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
+ transfer-encoding:
+ - chunked
+ x-ms-version:
+ - '2019-07-07'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/sdk/tables/azure-data-tables/tests/test_table.py b/sdk/tables/azure-data-tables/tests/test_table.py
new file mode 100644
index 000000000000..63a76c8dc315
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table.py
@@ -0,0 +1,489 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import pytest
+import sys
+import locale
+import os
+from azure.data.tables import TableServiceClient
+from datetime import (
+ datetime,
+ timedelta,
+)
+
+from azure.data.tables._models import TableSasPermissions, UpdateMode, AccessPolicy, TableAnalyticsLogging, Metrics, CorsRule, \
+ RetentionPolicy
+from azure.data.tables._shared.models import ResourceTypes, AccountSasPermissions
+from azure.core.pipeline import Pipeline
+from azure.core.pipeline.policies import (
+ HeadersPolicy,
+ ContentDecodePolicy,
+)
+
+from _shared.testcase import TableTestCase, GlobalStorageAccountPreparer
+from azure.data.tables._shared.authentication import SharedKeyCredentialPolicy
+from azure.core.pipeline.transport import RequestsTransport
+from azure.core.exceptions import (
+ HttpResponseError,
+ ResourceNotFoundError,
+ ResourceExistsError)
+
+# ------------------------------------------------------------------------------
+from azure.data.tables._shared.table_shared_access_signature import generate_account_sas
+
+TEST_TABLE_PREFIX = 'pytablesync'
+
+
+# ------------------------------------------------------------------------------
+
+def _create_pipeline(account, credential, **kwargs):
+ # type: (Any, **Any) -> Tuple[Configuration, Pipeline]
+ credential_policy = SharedKeyCredentialPolicy(account_name=account.name, account_key=credential)
+ transport = RequestsTransport(**kwargs)
+ policies = [
+ HeadersPolicy(),
+ credential_policy,
+ ContentDecodePolicy(response_encoding="utf-8")]
+ return Pipeline(transport, policies=policies)
+
+
+class StorageTableTest(TableTestCase):
+
+ # --Helpers-----------------------------------------------------------------
+ def _get_table_reference(self, prefix=TEST_TABLE_PREFIX):
+ table_name = self.get_resource_name(prefix)
+ return table_name
+
+ def _create_table(self, ts, prefix=TEST_TABLE_PREFIX, table_list=None):
+ table_name = self._get_table_reference(prefix)
+ try:
+ table = ts.create_table(table_name)
+ if table_list is not None:
+ table_list.append(table)
+ except ResourceExistsError:
+ table = ts.get_table_client(table_name)
+ return table
+
+ def _delete_table(self, ts, table):
+ if table is None:
+ return
+ try:
+ ts.delete_table(table.table_name)
+ except ResourceNotFoundError:
+ pass
+
+ # --Test cases for tables --------------------------------------------------
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_properties(self, resource_group, location, storage_account, storage_account_key):
+ # # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table_name = self._get_table_reference()
+ # Act
+ created = ts.create_table(table_name)
+
+ # Assert
+ assert created.table_name == table_name
+
+ properties = ts.get_service_properties()
+ print(properties)
+ ts.set_service_properties(analytics_logging=TableAnalyticsLogging(write=True))
+ # have to wait for return to service
+ p = ts.get_service_properties()
+ # have to wait for return to service
+ ts.set_service_properties(minute_metrics= Metrics(enabled=True, include_apis=True,
+ retention_policy=RetentionPolicy(enabled=True, days=5)))
+
+ ps = ts.get_service_properties()
+ print(ps)
+ print(p)
+ ts.delete_table(table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_table(self, resource_group, location, storage_account, storage_account_key):
+ # # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+
+ table_name = self._get_table_reference()
+
+ # Act
+ created = ts.create_table(table_name)
+
+ # Assert
+ assert created.table_name == table_name
+ ts.delete_table(table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_table_fail_on_exist(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table_name = self._get_table_reference()
+ # btable_client = ts.get_table_client(table_name)
+
+ # Act
+ created = ts.create_table(table_name)
+ with self.assertRaises(ResourceExistsError):
+ ts.create_table(table_name)
+
+ # Assert
+ self.assertTrue(created)
+ # existing = list(ts.query_tables(query_options=QueryOptions(filter="TableName eq '{}'".format(table_name))))
+ # self.assertEqual(existing[0], [table_name])
+ ts.delete_table(table_name)
+
+ @GlobalStorageAccountPreparer()
+ def test_create_table_invalid_name(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ invalid_table_name = "my_table"
+
+ with pytest.raises(ValueError) as excinfo:
+ ts.create_table(table_name=invalid_table_name)
+
+ assert "Table names must be alphanumeric, cannot begin with a number, and must be between 3-63 characters long.""" in str(
+ excinfo)
+
+ @GlobalStorageAccountPreparer()
+ def test_delete_table_invalid_name(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ invalid_table_name = "my_table"
+
+ with pytest.raises(ValueError) as excinfo:
+ ts.create_table(invalid_table_name)
+
+ assert "Table names must be alphanumeric, cannot begin with a number, and must be between 3-63 characters long.""" in str(
+ excinfo)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_tables(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = self._create_table(ts)
+
+ # Act
+ tables = list(ts.list_tables())
+
+ # Assert
+ self.assertIsNotNone(tables)
+ self.assertGreaterEqual(len(tables), 1)
+ self.assertIsNotNone(tables[0])
+ # self.assertNamedItemInContainer(tables, table.table_name)
+ ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_tables_with_filter(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = self._create_table(ts)
+
+ # Act
+ name_filter = "TableName eq '{}'".format(table.table_name)
+ tables = list(ts.query_tables(filter=name_filter))
+ # Assert
+ self.assertIsNotNone(tables)
+ self.assertEqual(len(tables), 1)
+ # self.assertEqual(tables[0].table_name, [table.table_name])
+ # table.delete_table()
+ ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_tables_with_num_results(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ prefix = 'listtable'
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table_list = []
+ for i in range(0, 4):
+ self._create_table(ts, prefix + str(i), table_list)
+
+ # Act
+ small_page = []
+ big_page = []
+ for s in next(ts.list_tables(results_per_page=3).by_page()):
+ small_page.append(s)
+ for t in next(ts.list_tables().by_page()):
+ big_page.append(t)
+ # big_page = (next(ts.query_tables().by_page()))
+ # small_page = (next(ts.query_tables(results_per_page=3).by_page()))
+
+ # Assert
+ self.assertEqual(len(small_page), 3)
+ self.assertGreaterEqual(len(big_page), 4)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_tables_with_marker(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ prefix = 'listtable'
+ table_names = []
+ for i in range(0, 4):
+ self._create_table(ts, prefix + str(i), table_names)
+
+ # table_names.sort()
+
+ # Act
+ generator1 = ts.list_tables(results_per_page=2).by_page()
+ next(generator1)
+ generator2 = ts.list_tables(results_per_page=2).by_page(
+ continuation_token=generator1.continuation_token)
+ next(generator2)
+
+ tables1 = generator1._current_page
+ tables2 = generator2._current_page
+
+ # Assert
+ self.assertEqual(len(tables1), 2)
+ self.assertEqual(len(tables2), 2)
+ self.assertNotEqual(tables1, tables2)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_delete_table_with_existing_table(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = self._create_table(ts)
+
+ # Act
+ # deleted = table.delete_table()
+ deleted = ts.delete_table(table_name=table.table_name)
+
+ # Assert
+ self.assertIsNone(deleted)
+ # existing = list(ts.query_tables("TableName eq '{}'".format(table.table_name)))
+ # self.assertEqual(existing, [])
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_delete_table_with_non_existing_table_fail_not_exist(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table_name = self._get_table_reference()
+
+ # Act
+ with self.assertRaises(HttpResponseError):
+ ts.delete_table(table_name)
+
+ # Assert
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_unicode_create_table_unicode_name(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos URLs support unicode table names")
+ ts = TableServiceClient(url, storage_account_key)
+ table_name = u'啊齄丂狛狜'
+
+ # Act
+ with self.assertRaises(HttpResponseError):
+ # not supported - table name must be alphanumeric, lowercase
+ ts.create_table(table_name)
+
+ # Assert
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_get_table_acl(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = self._create_table(ts)
+ try:
+ # Act
+ acl = table.get_table_access_policy()
+ # acl = table.get_table_access_policy()
+
+ # Assert
+ self.assertIsNotNone(acl)
+ self.assertEqual(len(acl), 0)
+ finally:
+ # self._delete_table(table)
+ ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_set_table_acl_with_empty_signed_identifiers(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(url, storage_account_key)
+ table = self._create_table(ts)
+ try:
+ # Act
+ table.set_table_access_policy(signed_identifiers={})
+
+ # Assert
+ acl = table.get_table_access_policy()
+ self.assertIsNotNone(acl)
+ self.assertEqual(len(acl), 0)
+ finally:
+ # self._delete_table(table)
+ ts.delete_table(table.table_name)
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_set_table_acl_with_empty_signed_identifier(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(url, storage_account_key)
+ table = self._create_table(ts)
+ try:
+ # Act
+ table.set_table_access_policy(signed_identifiers={'empty': None})
+ # Assert
+ acl = table.get_table_access_policy()
+ self.assertIsNotNone(acl)
+ self.assertEqual(len(acl), 1)
+ self.assertIsNotNone(acl['empty'])
+ self.assertIsNone(acl['empty'].permission)
+ self.assertIsNone(acl['empty'].expiry)
+ self.assertIsNone(acl['empty'].start)
+ finally:
+ # self._delete_table(table)
+ ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_set_table_acl_with_signed_identifiers(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(url, storage_account_key)
+ table = self._create_table(ts)
+ client = ts.get_table_client(table_name=table.table_name)
+
+ # Act
+ identifiers = dict()
+ identifiers['testid'] = AccessPolicy(start=datetime.utcnow() - timedelta(minutes=5),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ permission='r')
+ try:
+ client.set_table_access_policy(signed_identifiers=identifiers)
+ # Assert
+ acl = client.get_table_access_policy()
+ self.assertIsNotNone(acl)
+ self.assertEqual(len(acl), 1)
+ self.assertTrue('testid' in acl)
+ finally:
+ # self._delete_table(table)
+ ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_set_table_acl_too_many_ids(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(url, storage_account_key)
+ table = self._create_table(ts)
+ try:
+ # Act
+ identifiers = dict()
+ for i in range(0, 6):
+ identifiers['id{}'.format(i)] = None
+
+ # Assert
+ with self.assertRaises(ValueError):
+ table.set_table_access_policy(table_name=table.table_name, signed_identifiers=identifiers)
+ finally:
+ ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_account_sas(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ tsc = TableServiceClient(url, storage_account_key)
+ table = self._create_table(tsc)
+ try:
+ entity = {
+ 'PartitionKey': 'test',
+ 'RowKey': 'test1',
+ 'text': 'hello',
+ }
+ table.upsert_entity(mode=UpdateMode.MERGE, entity=entity)
+
+ entity['RowKey'] = 'test2'
+ table.upsert_entity(mode=UpdateMode.MERGE, entity=entity)
+
+ token = generate_account_sas(
+ storage_account.name,
+ storage_account_key,
+ resource_types=ResourceTypes(object=True),
+ permission=AccountSasPermissions(read=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ sas_table = service.get_table_client(table.table_name)
+ entities = list(sas_table.list_entities())
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ self.assertEqual(entities[0].text, 'hello')
+ self.assertEqual(entities[1].text, 'hello')
+ finally:
+ self._delete_table(table=table, ts=tsc)
+
+ @pytest.mark.skip("msrest fails deserialization: https://github.com/Azure/msrest-for-python/issues/192")
+ @GlobalStorageAccountPreparer()
+ def test_locale(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = (self._get_table_reference())
+ init_locale = locale.getlocale()
+ if os.name is "nt":
+ culture = "Spanish_Spain"
+ elif os.name is 'posix':
+ culture = 'es_ES.UTF-8'
+ else:
+ culture = 'es_ES.utf8'
+
+ try:
+ locale.setlocale(locale.LC_ALL, culture)
+ e = None
+
+ # Act
+ table.create_table()
+ try:
+ resp = ts.query_tables()
+ except:
+ e = sys.exc_info()[0]
+
+ # Assert
+ self.assertIsNone(e)
+ finally:
+ ts.delete_table(table.table_name)
+ locale.setlocale(locale.LC_ALL, init_locale[0] or 'en_US')
diff --git a/sdk/tables/azure-data-tables/tests/test_table_async.py b/sdk/tables/azure-data-tables/tests/test_table_async.py
new file mode 100644
index 000000000000..5b6de7387b22
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table_async.py
@@ -0,0 +1,435 @@
+import locale
+import os
+import sys
+from datetime import datetime, timedelta
+
+import pytest
+from azure.core.exceptions import ResourceNotFoundError, ResourceExistsError, HttpResponseError
+from _shared.asynctestcase import AsyncTableTestCase
+from _shared.testcase import GlobalStorageAccountPreparer
+from azure.data.tables import AccessPolicy, TableSasPermissions, ResourceTypes, AccountSasPermissions
+from azure.data.tables.aio import TableServiceClient
+from azure.data.tables._generated.models import QueryOptions
+from azure.data.tables._shared.table_shared_access_signature import generate_account_sas
+
+TEST_TABLE_PREFIX = 'pytableasync'
+
+
+# ------------------------------------------------------------------------------
+
+class TableTestAsync(AsyncTableTestCase):
+ # --Helpers-----------------------------------------------------------------
+ def _get_table_reference(self, prefix=TEST_TABLE_PREFIX):
+ table_name = self.get_resource_name(prefix)
+ return table_name
+
+ async def _create_table(self, ts, prefix=TEST_TABLE_PREFIX, table_list=None):
+ table_name = self._get_table_reference(prefix)
+ try:
+ table = await ts.create_table(table_name)
+ if table_list is not None:
+ table_list.append(table)
+ except ResourceExistsError:
+ table = await ts.get_table_client(table_name)
+ return table
+
+ async def _delete_table(self, ts, table):
+ if table is None:
+ return
+ try:
+ await ts.delete_table(table.table_name)
+ except ResourceNotFoundError:
+ pass
+
+ # --Test cases for tables --------------------------------------------------
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_create_table(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table_name = self._get_table_reference()
+
+ # Act
+ created = await ts.create_table(table_name=table_name)
+
+ # Assert
+ assert created.table_name == table_name
+
+ await ts.delete_table(table_name=table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_create_table_fail_on_exist(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table_name = self._get_table_reference()
+
+ # Act
+ created = await ts.create_table(table_name=table_name)
+ with self.assertRaises(ResourceExistsError):
+ await ts.create_table(table_name=table_name)
+
+ # Assert
+ self.assertTrue(created)
+ await ts.delete_table(table_name=table_name)
+
+ @GlobalStorageAccountPreparer()
+ async def test_create_table_invalid_name(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ invalid_table_name = "my_table"
+
+ with pytest.raises(ValueError) as excinfo:
+ await ts.create_table(table_name=invalid_table_name)
+
+ assert "Table names must be alphanumeric, cannot begin with a number, and must be between 3-63 characters long.""" in str(
+ excinfo)
+
+ @GlobalStorageAccountPreparer()
+ async def test_delete_table_invalid_name(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ invalid_table_name = "my_table"
+
+ with pytest.raises(ValueError) as excinfo:
+ await ts.create_table(invalid_table_name)
+
+ assert "Table names must be alphanumeric, cannot begin with a number, and must be between 3-63 characters long.""" in str(
+ excinfo)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_list_tables(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = await self._create_table(ts)
+
+ # Act
+ tables = []
+ async for t in ts.list_tables():
+ tables.append(t)
+
+ # Assert
+ self.assertIsNotNone(tables)
+ self.assertGreaterEqual(len(tables), 1)
+ self.assertIsNotNone(tables[0])
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_tables_with_filter(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = await self._create_table(ts)
+
+ # Act
+ name_filter = "TableName eq '{}'".format(table.table_name)
+ tables = []
+ async for t in ts.query_tables(filter=name_filter):
+ tables.append(t)
+
+ # Assert
+ self.assertIsNotNone(tables)
+ self.assertEqual(len(tables), 1)
+ # self.assertEqual(tables[0].table_name, [table.table_name])
+ # table.delete_table()
+ await ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ # TODO: the small_page is getting 16, can't figure it out, skipping for now
+ @GlobalStorageAccountPreparer()
+ async def test_list_tables_with_num_results(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ prefix = 'listtable'
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table_list = []
+ for i in range(0, 4):
+ await self._create_table(ts, prefix + str(i), table_list)
+
+ # Act
+ big_page = []
+ async for t in ts.list_tables():
+ big_page.append(t)
+
+ small_page = []
+ async for s in ts.list_tables(results_per_page=3).by_page():
+ small_page.append(s)
+
+ self.assertEqual(len(small_page), 2)
+ self.assertGreaterEqual(len(big_page), 4)
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_list_tables_with_marker(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ prefix = 'listtable'
+ table_names = []
+ for i in range(0, 4):
+ await self._create_table(ts, prefix + str(i), table_names)
+
+ # table_names.sort()
+
+ # Act
+ generator1 = ts.list_tables(query_options=QueryOptions(top=2)).by_page()
+ tables1 = []
+ async for el in await generator1: #.__anext__():
+ tables1.append(el)
+ generator2 = ts.list_tables(query_options=QueryOptions(top=2)).by_page(
+ continuation_token=generator1.continuation_token)
+ tables2 = []
+ async for el in await generator2:# .__anext__():
+ tables2.append(el)
+
+ # Assert
+ self.assertEqual(len(tables1), 2)
+ self.assertEqual(len(tables2), 2)
+ self.assertNotEqual(tables1, tables2)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_delete_table_with_existing_table(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = await self._create_table(ts)
+
+ # Act
+ # deleted = table.delete_table()
+ deleted = await ts.delete_table(table_name=table.table_name)
+
+ # Assert
+ self.assertIsNone(deleted)
+ # existing = list(ts.query_tables("TableName eq '{}'".format(table.table_name)))
+ # self.assertEqual(existing, [])
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_delete_table_with_non_existing_table_fail_not_exist(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table_name = self._get_table_reference()
+
+ # Act
+ with self.assertRaises(ResourceNotFoundError):
+ await ts.delete_table(table_name)
+
+ # Assert
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_unicode_create_table_unicode_name(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos URLs support unicode table names")
+ ts = TableServiceClient(url, storage_account_key)
+ table_name = u'啊齄丂狛狜'
+
+ # Act
+ # with self.assertRaises(HttpResponseError):
+
+ with pytest.raises(ValueError) as excinfo:
+ await ts.create_table(table_name=table_name)
+
+ assert "Table names must be alphanumeric, cannot begin with a number, and must be between 3-63 characters long.""" in str(
+ excinfo)
+
+ # Assert
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_get_table_acl(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = await self._create_table(ts)
+ try:
+ # Act
+ acl = await table.get_table_access_policy()
+ # acl = table.get_table_access_policy()
+
+ # Assert
+ self.assertIsNotNone(acl)
+ self.assertEqual(len(acl), 0)
+ finally:
+ # self._delete_table(table)
+ await ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_set_table_acl_with_empty_signed_identifiers(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(url, storage_account_key)
+ table = await self._create_table(ts)
+ try:
+ # Act
+ await table.set_table_access_policy(signed_identifiers={})
+
+ # Assert
+ acl = await table.get_table_access_policy()
+ self.assertIsNotNone(acl)
+ self.assertEqual(len(acl), 0)
+ finally:
+ # self._delete_table(table)
+ await ts.delete_table(table.table_name)
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_set_table_acl_with_empty_signed_identifier(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(url, storage_account_key)
+ table = await self._create_table(ts)
+ try:
+ # Act
+ await table.set_table_access_policy(signed_identifiers={'empty': None})
+ # Assert
+ acl = await table.get_table_access_policy()
+ self.assertIsNotNone(acl)
+ self.assertEqual(len(acl), 1)
+ self.assertIsNotNone(acl['empty'])
+ self.assertIsNone(acl['empty'].permission)
+ self.assertIsNone(acl['empty'].expiry)
+ self.assertIsNone(acl['empty'].start)
+ finally:
+ # self._delete_table(table)
+ await ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_set_table_acl_with_signed_identifiers(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(url, storage_account_key)
+ table = await self._create_table(ts)
+ client = ts.get_table_client(table=table.table_name)
+
+ # Act
+ identifiers = dict()
+ identifiers['testid'] = AccessPolicy(start=datetime.utcnow() - timedelta(minutes=5),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ permission=TableSasPermissions(read=True))
+ try:
+ await client.set_table_access_policy(signed_identifiers=identifiers)
+ # Assert
+ acl = await client.get_table_access_policy()
+ self.assertIsNotNone(acl)
+ self.assertEqual(len(acl), 1)
+ self.assertTrue('testid' in acl)
+ finally:
+ # self._delete_table(table)
+ await ts.delete_table(table.table_name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_set_table_acl_too_many_ids(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos endpoint does not support this")
+ ts = TableServiceClient(url, storage_account_key)
+ table = await self._create_table(ts)
+ try:
+ # Act
+ identifiers = dict()
+ for i in range(0, 6):
+ identifiers['id{}'.format(i)] = None
+
+ # Assert
+ with self.assertRaises(ValueError):
+ await table.set_table_access_policy(table_name=table.table_name, signed_identifiers=identifiers)
+ finally:
+ await ts.delete_table(table.table_name)
+
+ @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_account_sas(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ tsc = TableServiceClient(url, storage_account_key)
+ table = await self._create_table(tsc)
+ try:
+ entity = {
+ 'PartitionKey': 'test',
+ 'RowKey': 'test1',
+ 'text': 'hello',
+ }
+ await table.upsert_insert_merge_entity(table_entity_properties=entity)
+
+ entity['RowKey'] = 'test2'
+ await table.upsert_insert_merge_entity(table_entity_properties=entity)
+
+ token = generate_account_sas(
+ storage_account.name,
+ storage_account_key,
+ resource_types=ResourceTypes(container=True),
+ permission=AccountSasPermissions(list=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ entities = []
+ async for e in service.list_tables():
+ entities.append(e)
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ # self.assertEqual(entities[0].text, 'hello')
+ # self.assertEqual(entities[1].text, 'hello')
+ finally:
+ await self._delete_table(table=table, ts=tsc)
+
+ @pytest.mark.skip("msrest fails deserialization: https://github.com/Azure/msrest-for-python/issues/192")
+ @GlobalStorageAccountPreparer()
+ async def test_locale(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ table = (self._get_table_reference())
+ init_locale = locale.getlocale()
+ if os.name == "nt":
+ culture = "Spanish_Spain"
+ elif os.name == 'posix':
+ culture = 'es_ES.UTF-8'
+ else:
+ culture = 'es_ES.utf8'
+
+ try:
+ locale.setlocale(locale.LC_ALL, culture)
+ e = None
+
+ # Act
+ await table.create_table()
+ try:
+ resp = ts.list_tables()
+ except:
+ e = sys.exc_info()[0]
+
+ # Assert
+ self.assertIsNone(e)
+ finally:
+ await ts.delete_table(table.table_name)
+ locale.setlocale(locale.LC_ALL, init_locale[0] or 'en_US')
diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch.py b/sdk/tables/azure-data-tables/tests/test_table_batch.py
new file mode 100644
index 000000000000..62d20bd42bd3
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table_batch.py
@@ -0,0 +1,646 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import unittest
+import pytest
+
+import uuid
+from datetime import datetime
+from dateutil.tz import tzutc
+
+from azure.core import MatchConditions
+from azure.core.exceptions import (
+ ResourceExistsError)
+
+from _shared.testcase import GlobalStorageAccountPreparer, TableTestCase, LogCaptured
+
+#------------------------------------------------------------------------------
+TEST_TABLE_PREFIX = 'table'
+#------------------------------------------------------------------------------
+
+class StorageTableBatchTest(TableTestCase):
+
+ def _set_up(self, storage_account, storage_account_key):
+ self.ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ self.table_name = self.get_resource_name('uttable')
+ self.table = self.ts.get_table_client(self.table_name)
+ if self.is_live:
+ try:
+ self.ts.create_table(self.table_name)
+ except ResourceExistsError:
+ pass
+
+ self.test_tables = []
+
+ def _tear_down(self):
+ if self.is_live:
+ try:
+ self.ts.delete_table(self.table_name)
+ except:
+ pass
+
+ for table_name in self.test_tables:
+ try:
+ self.ts.delete_table(table_name)
+ except:
+ pass
+
+ #--Helpers-----------------------------------------------------------------
+
+ def _get_table_reference(self, prefix=TEST_TABLE_PREFIX):
+ table_name = self.get_resource_name(prefix)
+ self.test_tables.append(table_name)
+ return self.ts.get_table_client(table_name)
+
+ def _create_random_entity_dict(self, pk=None, rk=None):
+ '''
+ Creates a dictionary-based entity with fixed values, using all
+ of the supported data types.
+ '''
+ partition = pk if pk is not None else self.get_resource_name('pk')
+ row = rk if rk is not None else self.get_resource_name('rk')
+ properties = {
+ 'PartitionKey': partition,
+ 'RowKey': row,
+ 'age': 39,
+ 'sex': 'male',
+ 'married': True,
+ 'deceased': False,
+ 'optional': None,
+ 'ratio': 3.1,
+ 'evenratio': 3.0,
+ 'large': 933311100,
+ 'Birthday': datetime(1973, 10, 4, tzinfo=tzutc()),
+ 'birthday': datetime(1970, 10, 4, tzinfo=tzutc()),
+ 'binary': b'binary',
+ 'other': EntityProperty(EdmType.INT32, 20),
+ 'clsid': uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833')
+ }
+ return Entity(**properties)
+
+ def _create_updated_entity_dict(self, partition, row):
+ '''
+ Creates a dictionary-based entity with fixed values, with a
+ different set of values than the default entity. It
+ adds fields, changes field values, changes field types,
+ and removes fields when compared to the default entity.
+ '''
+ return {
+ 'PartitionKey': partition,
+ 'RowKey': row,
+ 'age': 'abc',
+ 'sex': 'female',
+ 'sign': 'aquarius',
+ 'birthday': datetime(1991, 10, 4, tzinfo=tzutc())
+ }
+
+ def _assert_default_entity(self, entity, headers=None):
+ '''
+ Asserts that the entity passed in matches the default entity.
+ '''
+ self.assertEqual(entity['age'], 39)
+ self.assertEqual(entity['sex'], 'male')
+ self.assertEqual(entity['married'], True)
+ self.assertEqual(entity['deceased'], False)
+ self.assertFalse("optional" in entity)
+ self.assertFalse("aquarius" in entity)
+ self.assertEqual(entity['ratio'], 3.1)
+ self.assertEqual(entity['evenratio'], 3.0)
+ self.assertEqual(entity['large'], 933311100)
+ self.assertEqual(entity['Birthday'], datetime(1973, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['birthday'], datetime(1970, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['binary'], b'binary')
+ self.assertIsInstance(entity['other'], EntityProperty)
+ self.assertEqual(entity['other'].type, EdmType.INT32)
+ self.assertEqual(entity['other'].value, 20)
+ self.assertEqual(entity['clsid'], uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833'))
+ self.assertTrue('metadata' in entity.odata)
+ self.assertIsNotNone(entity.timestamp)
+ self.assertIsInstance(entity.timestamp, datetime)
+ if headers:
+ self.assertTrue("etag" in headers)
+ self.assertIsNotNone(headers['etag'])
+
+ def _assert_updated_entity(self, entity):
+ '''
+ Asserts that the entity passed in matches the updated entity.
+ '''
+ self.assertEqual(entity.age, 'abc')
+ self.assertEqual(entity.sex, 'female')
+ self.assertFalse(hasattr(entity, "married"))
+ self.assertFalse(hasattr(entity, "deceased"))
+ self.assertEqual(entity.sign, 'aquarius')
+ self.assertFalse(hasattr(entity, "optional"))
+ self.assertFalse(hasattr(entity, "ratio"))
+ self.assertFalse(hasattr(entity, "evenratio"))
+ self.assertFalse(hasattr(entity, "large"))
+ self.assertFalse(hasattr(entity, "Birthday"))
+ self.assertEqual(entity.birthday, datetime(1991, 10, 4, tzinfo=tzutc()))
+ self.assertFalse(hasattr(entity, "other"))
+ self.assertFalse(hasattr(entity, "clsid"))
+ self.assertIsNotNone(entity.odata['etag'])
+ self.assertIsNotNone(entity.timestamp)
+ self.assertIsInstance(entity.timestamp, datetime)
+
+ #--Test cases for batch ---------------------------------------------
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_insert(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '001'
+ entity.RowKey = 'batch_insert'
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+
+ batch = self.table.create_batch()
+ batch.create_item(entity)
+ resp = self.table.commit_batch(batch)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ result, headers = self.table.read_item('001', 'batch_insert', response_hook=lambda e, h: (e, h))
+ self.assertEqual(list(resp)[0].headers['Etag'], headers['etag'])
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_update(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '001'
+ entity.RowKey = 'batch_update'
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+ self.table.create_item(entity)
+
+ entity = self.table.read_item('001', 'batch_update')
+ self.assertEqual(3, entity.test3)
+ entity.test2 = 'value1'
+
+ batch = self.table.create_batch()
+ batch.update_item(entity)
+ resp = self.table.commit_batch(batch)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ result, headers = self.table.read_item('001', 'batch_update', response_hook=lambda e, h: (e, h))
+ self.assertEqual('value1', result.test2)
+ self.assertEqual(list(resp)[0].headers['Etag'], headers['etag'])
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_merge(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '001'
+ entity.RowKey = 'batch_merge'
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+ self.table.create_item(entity)
+
+ entity = self.table.read_item('001', 'batch_merge')
+ self.assertEqual(3, entity.test3)
+ entity = Entity()
+ entity.PartitionKey = '001'
+ entity.RowKey = 'batch_merge'
+ entity.test2 = 'value1'
+
+ batch = self.table.create_batch()
+ batch.update_item(entity, mode='MERGE')
+ resp = self.table.commit_batch(batch)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ entity, headers = self.table.read_item('001', 'batch_merge', response_hook=lambda e, h: (e, h))
+ self.assertEqual('value1', entity.test2)
+ self.assertEqual(1234567890, entity.test4)
+ self.assertEqual(list(resp)[0].headers['Etag'], headers['etag'])
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_update_if_match(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+ etag = self.table.create_item(entity, response_hook=lambda e, h: h['etag'])
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ batch = self.table.create_batch()
+ batch.update_item(sent_entity, etag=etag, match_condition=MatchConditions.IfNotModified)
+ resp = self.table.commit_batch(batch)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ entity, headers = self.table.read_item(entity['PartitionKey'], entity['RowKey'], response_hook=lambda e, h: (e, h))
+ self._assert_updated_entity(entity)
+ self.assertEqual(list(resp)[0].headers['Etag'], headers['etag'])
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_update_if_doesnt_match(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+ self.table.create_item(entity)
+
+ # Act
+ sent_entity1 = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+
+ batch = self.table.create_batch()
+ batch.update_item(
+ sent_entity1,
+ etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"',
+ match_condition=MatchConditions.IfNotModified)
+ try:
+ self.table.commit_batch(batch)
+ except PartialBatchErrorException as error:
+ pass # TODO
+ #self.assertEqual(error.code, 'UpdateConditionNotSatisfied')
+ #self.assertTrue('The update condition specified in the request was not satisfied.' in str(error))
+ else:
+ self.fail('AzureBatchOperationError was expected')
+
+ # Assert
+ received_entity = self.table.read_item(entity['PartitionKey'], entity['RowKey'])
+ self._assert_default_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_insert_replace(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '001'
+ entity.RowKey = 'batch_insert_replace'
+ entity.test = True
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+
+ batch = self.table.create_batch()
+ batch.upsert_item(entity)
+ resp = self.table.commit_batch(batch)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ entity, headers = self.table.read_item('001', 'batch_insert_replace', response_hook=lambda e, h: (e, h))
+ self.assertIsNotNone(entity)
+ self.assertEqual('value', entity.test2)
+ self.assertEqual(1234567890, entity.test4)
+ self.assertEqual(list(resp)[0].headers['Etag'], headers['etag'])
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_insert_merge(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '001'
+ entity.RowKey = 'batch_insert_merge'
+ entity.test = True
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+
+ batch = self.table.create_batch()
+ batch.upsert_item(entity, mode='MERGE')
+ resp = self.table.commit_batch(batch)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ entity, headers = self.table.read_item('001', 'batch_insert_merge', response_hook=lambda e, h: (e, h))
+ self.assertIsNotNone(entity)
+ self.assertEqual('value', entity.test2)
+ self.assertEqual(1234567890, entity.test4)
+ self.assertEqual(list(resp)[0].headers['Etag'], headers['etag'])
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_delete(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '001'
+ entity.RowKey = 'batch_delete'
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+ self.table.create_item(entity)
+
+ entity = self.table.read_item('001', 'batch_delete')
+ self.assertEqual(3, entity.test3)
+
+ batch = self.table.create_batch()
+ batch.delete_item('001', 'batch_delete')
+ resp = self.table.commit_batch(batch)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self.assertEqual(list(resp)[0].status_code, 204)
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_inserts(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = 'batch_inserts'
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+
+ batch = self.table.create_batch()
+ for i in range(100):
+ entity.RowKey = str(i)
+ batch.create_item(entity)
+ self.table.commit_batch(batch)
+
+ entities = list(self.table.query_items("PartitionKey eq 'batch_inserts'"))
+
+ # Assert
+ self.assertIsNotNone(entities)
+ self.assertEqual(100, len(entities))
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_all_operations_together(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '003'
+ entity.RowKey = 'batch_all_operations_together-1'
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+ self.table.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-2'
+ self.table.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-3'
+ self.table.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-4'
+ self.table.create_item(entity)
+
+ batch = self.table.create_batch()
+ entity.RowKey = 'batch_all_operations_together'
+ batch.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-1'
+ batch.delete_item(entity.PartitionKey, entity.RowKey)
+ entity.RowKey = 'batch_all_operations_together-2'
+ entity.test3 = 10
+ batch.update_item(entity)
+ entity.RowKey = 'batch_all_operations_together-3'
+ entity.test3 = 100
+ batch.update_item(entity, mode='MERGE')
+ entity.RowKey = 'batch_all_operations_together-4'
+ entity.test3 = 10
+ batch.upsert_item(entity)
+ entity.RowKey = 'batch_all_operations_together-5'
+ batch.upsert_item(entity, mode='MERGE')
+ resp = self.table.commit_batch(batch)
+
+ # Assert
+ self.assertEqual(6, len(list(resp)))
+ entities = list(self.table.query_items("PartitionKey eq '003'"))
+ self.assertEqual(5, len(entities))
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_all_operations_together_context_manager(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '003'
+ entity.RowKey = 'batch_all_operations_together-1'
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+ self.table.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-2'
+ self.table.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-3'
+ self.table.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-4'
+ self.table.create_item(entity)
+
+ with self.table.create_batch() as batch:
+ entity.RowKey = 'batch_all_operations_together'
+ batch.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-1'
+ batch.delete_item(entity.PartitionKey, entity.RowKey)
+ entity.RowKey = 'batch_all_operations_together-2'
+ entity.test3 = 10
+ batch.update_item(entity)
+ entity.RowKey = 'batch_all_operations_together-3'
+ entity.test3 = 100
+ batch.update_item(entity, mode='MERGE')
+ entity.RowKey = 'batch_all_operations_together-4'
+ entity.test3 = 10
+ batch.upsert_item(entity)
+ entity.RowKey = 'batch_all_operations_together-5'
+ batch.upsert_item(entity, mode='MERGE')
+
+ # Assert
+ entities = list(self.table.query_items("PartitionKey eq '003'"))
+ self.assertEqual(5, len(entities))
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_reuse(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ table2 = self._get_table_reference('table2')
+ table2.create_table()
+
+ # Act
+ entity = Entity()
+ entity.PartitionKey = '003'
+ entity.RowKey = 'batch_all_operations_together-1'
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'value'
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime.utcnow()
+
+ batch = TableBatchClient()
+ batch.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-2'
+ batch.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-3'
+ batch.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-4'
+ batch.create_item(entity)
+
+ self.table.commit_batch(batch)
+ table2.commit_batch(batch)
+
+ batch = TableBatchClient()
+ entity.RowKey = 'batch_all_operations_together'
+ batch.create_item(entity)
+ entity.RowKey = 'batch_all_operations_together-1'
+ batch.delete_item(entity.PartitionKey, entity.RowKey)
+ entity.RowKey = 'batch_all_operations_together-2'
+ entity.test3 = 10
+ batch.update_item(entity)
+ entity.RowKey = 'batch_all_operations_together-3'
+ entity.test3 = 100
+ batch.update_item(entity, mode='MERGE')
+ entity.RowKey = 'batch_all_operations_together-4'
+ entity.test3 = 10
+ batch.upsert_item(entity)
+ entity.RowKey = 'batch_all_operations_together-5'
+ batch.upsert_item(entity, mode='MERGE')
+
+ self.table.commit_batch(batch)
+ resp = table2.commit_batch(batch)
+
+ # Assert
+ self.assertEqual(6, len(list(resp)))
+ entities = list(self.table.query_items("PartitionKey eq '003'"))
+ self.assertEqual(5, len(entities))
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_same_row_operations_fail(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict('001', 'batch_negative_1')
+ self.table.create_item(entity)
+
+ # Act
+ batch = self.table.create_batch()
+
+ entity = self._create_updated_entity_dict(
+ '001', 'batch_negative_1')
+ batch.update_item(entity)
+ entity = self._create_random_entity_dict(
+ '001', 'batch_negative_1')
+
+ # Assert
+ with self.assertRaises(ValueError):
+ batch.update_item(entity, mode='MERGE')
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_different_partition_operations_fail(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict('001', 'batch_negative_1')
+ self.table.create_item(entity)
+
+ # Act
+ batch = self.table.create_batch()
+
+ entity = self._create_updated_entity_dict(
+ '001', 'batch_negative_1')
+ batch.update_item(entity)
+
+ entity = self._create_random_entity_dict(
+ '002', 'batch_negative_1')
+
+ # Assert
+ with self.assertRaises(ValueError):
+ batch.create_item(entity)
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_batch_too_many_ops(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict('001', 'batch_negative_1')
+ self.table.create_item(entity)
+
+ # Act
+ with self.assertRaises(ValueError):
+ batch = self.table.create_batch()
+ for i in range(0, 101):
+ entity = Entity()
+ entity.PartitionKey = 'large'
+ entity.RowKey = 'item{0}'.format(i)
+ batch.create_item(entity)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+#------------------------------------------------------------------------------
+if __name__ == '__main__':
+ unittest.main()
diff --git a/sdk/tables/azure-data-tables/tests/test_table_client.py b/sdk/tables/azure-data-tables/tests/test_table_client.py
new file mode 100644
index 000000000000..34ba05da9fb6
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table_client.py
@@ -0,0 +1,567 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import unittest
+import pytest
+import platform
+
+from azure.data.tables import TableServiceClient, TableClient
+from azure.data.tables._version import VERSION
+from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer
+# from azure.data.tabless import (
+# VERSION,
+# TableServiceClient,
+# TableClient,
+# )
+from _shared.testcase import GlobalStorageAccountPreparer, TableTestCase
+
+from azure.core.exceptions import HttpResponseError
+# ------------------------------------------------------------------------------
+SERVICES = {
+ #TableServiceClient: 'table',
+ #TableClient: 'table',
+ #TableServiceClient: 'cosmos',
+ #TableClient: 'cosmos',
+}
+
+_CONNECTION_ENDPOINTS = {'table': 'TableEndpoint', 'cosmos': 'TableEndpoint'}
+
+_CONNECTION_ENDPOINTS_SECONDARY = {'table': 'TableSecondaryEndpoint', 'cosmos': 'TableSecondaryEndpoint'}
+
+class StorageTableClientTest(TableTestCase):
+ def setUp(self):
+ super(StorageTableClientTest, self).setUp()
+ self.sas_token = self.generate_sas_token()
+ self.token_credential = self.generate_oauth_token()
+
+ # --Helpers-----------------------------------------------------------------
+ def validate_standard_account_endpoints(self, service, account_name, account_key):
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, account_name)
+ self.assertEqual(service.credential.account_name, account_name)
+ self.assertEqual(service.credential.account_key, account_key)
+ self.assertTrue(
+ ('{}.{}'.format(account_name, 'table.core.windows.net') in service.url) or
+ ('{}.{}'.format(account_name, 'table.cosmos.azure.com') in service.url))
+ self.assertTrue(
+ ('{}-secondary.{}'.format(account_name, 'table.core.windows.net') in service.secondary_endpoint) or
+ ('{}-secondary.{}'.format(account_name, 'table.cosmos.azure.com') in service.secondary_endpoint))
+
+ # --Direct Parameters Test Cases --------------------------------------------
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_key(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+
+ for client, url in SERVICES.items():
+ # Act
+ service = client(
+ self.account_url(storage_account, url), credential=storage_account_key, table_name='foo')
+
+ # Assert
+ self.validate_standard_account_endpoints(service, storage_account.name, storage_account_key)
+ self.assertEqual(service.scheme, 'https')
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_connection_string(self, resource_group, location, storage_account, storage_account_key):
+
+ for service_type in SERVICES.items():
+ # Act
+ service = service_type[0].from_connection_string(
+ self.connection_string(storage_account, storage_account_key), table_name="test")
+
+ # Assert
+ self.validate_standard_account_endpoints(service, storage_account.name, storage_account_key)
+ self.assertEqual(service.scheme, 'https')
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_sas(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ suffix = '.table.core.windows.net'
+ if 'cosmos' in url:
+ suffix = '.table.cosmos.azure.com'
+ for service_type in SERVICES:
+ # Act
+ service = service_type(
+ self.account_url(storage_account, "table"), credential=self.sas_token, table_name='foo')
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertTrue(service.url.startswith('https://' + storage_account.name + suffix))
+ self.assertTrue(service.url.endswith(self.sas_token))
+ self.assertIsNone(service.credential)
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_token(self, resource_group, location, storage_account, storage_account_key):
+ url = self.account_url(storage_account, "table")
+ suffix = '.table.core.windows.net'
+ if 'cosmos' in url:
+ suffix = '.table.cosmos.azure.com'
+ for service_type in SERVICES:
+ # Act
+ service = service_type(url, credential=self.token_credential, table_name='foo')
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertTrue(service.url.startswith('https://' + storage_account.name + suffix))
+ self.assertEqual(service.credential, self.token_credential)
+ self.assertFalse(hasattr(service.credential, 'account_key'))
+ self.assertTrue(hasattr(service.credential, 'get_token'))
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_token_and_http(self, resource_group, location, storage_account, storage_account_key):
+ for service_type in SERVICES:
+ # Act
+ with self.assertRaises(ValueError):
+ url = self.account_url(storage_account, "table").replace('https', 'http')
+ service_type(url, credential=self.token_credential, table_name='foo')
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_china(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ # TODO: Confirm regional cloud cosmos URLs
+ for service_type in SERVICES.items():
+ # Act
+ url = self.account_url(storage_account, "table").replace('core.windows.net', 'core.chinacloudapi.cn')
+ if 'cosmos.azure' in url:
+ pytest.skip("Confirm cosmos national cloud URLs")
+ service = service_type[0](
+ url, credential=storage_account_key, table_name='foo')
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_key, storage_account_key)
+ self.assertTrue(service.primary_endpoint.startswith(
+ 'https://{}.{}.core.chinacloudapi.cn'.format(storage_account.name, "table")))
+ self.assertTrue(service.secondary_endpoint.startswith(
+ 'https://{}-secondary.{}.core.chinacloudapi.cn'.format(storage_account.name, "table")))
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_protocol(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+
+ for service_type in SERVICES.items():
+ # Act
+ url = self.account_url(storage_account, "table").replace('https', 'http')
+ service = service_type[0](
+ url, credential=storage_account_key, table_name='foo')
+
+ # Assert
+ self.validate_standard_account_endpoints(service, storage_account.name, storage_account_key)
+ self.assertEqual(service.scheme, 'http')
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_empty_key(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ TABLE_SERVICES = [TableServiceClient, TableClient]
+
+ for service_type in TABLE_SERVICES:
+ # Act
+ with self.assertRaises(ValueError) as e:
+ test_service = service_type('testaccount', credential='', table_name='foo')
+
+ self.assertEqual(
+ str(e.exception), "You need to provide either a SAS token or an account shared key to authenticate.")
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_socket_timeout(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+
+ for service_type in SERVICES.items():
+ # Act
+ default_service = service_type[0](
+ self.account_url(storage_account, "table"), credential=storage_account_key, table_name='foo')
+ service = service_type[0](
+ self.account_url(storage_account, "table"), credential=storage_account_key,
+ table_name='foo', connection_timeout=22)
+
+ # Assert
+ self.validate_standard_account_endpoints(service, storage_account.name, storage_account_key)
+ assert service._client._client._pipeline._transport.connection_config.timeout == 22
+ assert default_service._client._client._pipeline._transport.connection_config.timeout in [20, (20, 2000)]
+
+ # --Connection String Test Cases --------------------------------------------
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_connection_string_key(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ conn_string = 'AccountName={};AccountKey={};'.format(storage_account.name, storage_account_key)
+
+ for service_type in SERVICES.items():
+ # Act
+ service = service_type[0].from_connection_string(conn_string, table_name='foo')
+
+ # Assert
+ self.validate_standard_account_endpoints(service, storage_account.name, storage_account_key)
+ self.assertEqual(service.scheme, 'https')
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_connection_string_sas(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ conn_string = 'AccountName={};SharedAccessSignature={};'.format(storage_account.name, self.sas_token)
+
+ for service_type in SERVICES:
+ # Act
+ service = service_type.from_connection_string(conn_string, table_name='foo')
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertTrue(service.url.startswith('https://' + storage_account.name + '.table.core.windows.net'))
+ self.assertTrue(service.url.endswith(self.sas_token))
+ self.assertIsNone(service.credential)
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer() # TODO: Prepare Cosmos tables account
+ def test_create_service_with_connection_string_cosmos(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ conn_string = 'DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};TableEndpoint=https://{0}.table.cosmos.azure.com:443/;'.format(
+ storage_account.name, storage_account_key)
+
+ for service_type in SERVICES:
+ # Act
+ service = service_type.from_connection_string(conn_string, table_name='foo')
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertTrue(service.url.startswith('https://' + storage_account.name + '.table.cosmos.azure.com'))
+ self.assertEqual(service.credential.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_key, storage_account_key)
+ self.assertTrue(service.primary_endpoint.startswith('https://' + storage_account.name + '.table.cosmos.azure.com'))
+ self.assertTrue(service.secondary_endpoint.startswith('https://' + storage_account.name + '-secondary.table.cosmos.azure.com'))
+ self.assertEqual(service.scheme, 'https')
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_connection_string_endpoint_protocol(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ conn_string = 'AccountName={};AccountKey={};DefaultEndpointsProtocol=http;EndpointSuffix=core.chinacloudapi.cn;'.format(
+ storage_account.name, storage_account_key)
+
+ for service_type in SERVICES.items():
+ # Act
+ service = service_type[0].from_connection_string(conn_string, table_name="foo")
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_key, storage_account_key)
+ self.assertTrue(
+ service.primary_endpoint.startswith(
+ 'http://{}.{}.core.chinacloudapi.cn'.format(storage_account.name, "table")))
+ self.assertTrue(
+ service.secondary_endpoint.startswith(
+ 'http://{}-secondary.{}.core.chinacloudapi.cn'.format(storage_account.name, "table")))
+ self.assertEqual(service.scheme, 'http')
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_connection_string_emulated(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ for service_type in SERVICES.items():
+ conn_string = 'UseDevelopmentStorage=true;'.format(storage_account.name, storage_account_key)
+
+ # Act
+ with self.assertRaises(ValueError):
+ service = service_type[0].from_connection_string(conn_string, table_name="foo")
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_connection_string_custom_domain(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ for service_type in SERVICES.items():
+ conn_string = 'AccountName={};AccountKey={};TableEndpoint=www.mydomain.com;'.format(
+ storage_account.name, storage_account_key)
+
+ # Act
+ service = service_type[0].from_connection_string(conn_string, table_name="foo")
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_key, storage_account_key)
+ self.assertTrue(service.primary_endpoint.startswith('https://www.mydomain.com'))
+ self.assertTrue(service.secondary_endpoint.startswith('https://' + storage_account.name + '-secondary.table.core.windows.net'))
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_conn_str_custom_domain_trailing_slash(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ for service_type in SERVICES.items():
+ conn_string = 'AccountName={};AccountKey={};TableEndpoint=www.mydomain.com/;'.format(
+ storage_account.name, storage_account_key)
+
+ # Act
+ service = service_type[0].from_connection_string(conn_string, table_name="foo")
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_key, storage_account_key)
+ self.assertTrue(service.primary_endpoint.startswith('https://www.mydomain.com'))
+ self.assertTrue(service.secondary_endpoint.startswith('https://' + storage_account.name + '-secondary.table.core.windows.net'))
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_conn_str_custom_domain_sec_override(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ for service_type in SERVICES.items():
+ conn_string = 'AccountName={};AccountKey={};TableEndpoint=www.mydomain.com/;'.format(
+ storage_account.name, storage_account_key)
+
+ # Act
+ service = service_type[0].from_connection_string(
+ conn_string, secondary_hostname="www-sec.mydomain.com", table_name="foo")
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_key, storage_account_key)
+ self.assertTrue(service.primary_endpoint.startswith('https://www.mydomain.com'))
+ self.assertTrue(service.secondary_endpoint.startswith('https://www-sec.mydomain.com'))
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_conn_str_fails_if_sec_without_primary(self, resource_group, location, storage_account, storage_account_key):
+ for service_type in SERVICES.items():
+ # Arrange
+ conn_string = 'AccountName={};AccountKey={};{}=www.mydomain.com;'.format(
+ storage_account.name, storage_account_key,
+ _CONNECTION_ENDPOINTS_SECONDARY.get(service_type[1]))
+
+ # Act
+
+ # Fails if primary excluded
+ with self.assertRaises(ValueError):
+ service = service_type[0].from_connection_string(conn_string, table_name="foo")
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_conn_str_succeeds_if_sec_with_primary(self, resource_group, location, storage_account, storage_account_key):
+ for service_type in SERVICES.items():
+ # Arrange
+ conn_string = 'AccountName={};AccountKey={};{}=www.mydomain.com;{}=www-sec.mydomain.com;'.format(
+ storage_account.name,
+ storage_account_key,
+ _CONNECTION_ENDPOINTS.get(service_type[1]),
+ _CONNECTION_ENDPOINTS_SECONDARY.get(service_type[1]))
+
+ # Act
+ service = service_type[0].from_connection_string(conn_string, table_name="foo")
+
+ # Assert
+ self.assertIsNotNone(service)
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_key, storage_account_key)
+ self.assertTrue(service.primary_endpoint.startswith('https://www.mydomain.com'))
+ self.assertTrue(service.secondary_endpoint.startswith('https://www-sec.mydomain.com'))
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_service_with_custom_account_endpoint_path(self, resource_group, location, storage_account, storage_account_key):
+ custom_account_url = "http://local-machine:11002/custom/account/path/" + self.sas_token
+ for service_type in SERVICES.items():
+ conn_string = 'DefaultEndpointsProtocol=http;AccountName={};AccountKey={};TableEndpoint={};'.format(
+ storage_account.name, storage_account_key, custom_account_url)
+
+ # Act
+ service = service_type[0].from_connection_string(conn_string, table_name="foo")
+
+ # Assert
+ self.assertEqual(service.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_name, storage_account.name)
+ self.assertEqual(service.credential.account_key, storage_account_key)
+ self.assertEqual(service.primary_hostname, 'local-machine:11002/custom/account/path')
+
+ service = TableServiceClient(account_url=custom_account_url)
+ self.assertEqual(service.account_name, None)
+ self.assertEqual(service.credential, None)
+ self.assertEqual(service._primary_hostname, 'local-machine:11002/custom/account/path')
+ # mine doesnt have a question mark at the end
+ self.assertTrue(service.url.startswith('http://local-machine:11002/custom/account/path'))
+
+ service = TableClient(account_url=custom_account_url, table_name="foo")
+ self.assertEqual(service.account_name, None)
+ self.assertEqual(service.table_name, "foo")
+ self.assertEqual(service.credential, None)
+ self.assertEqual(service._primary_hostname, 'local-machine:11002/custom/account/path')
+ self.assertTrue(service.url.startswith('http://local-machine:11002/custom/account/path'))
+
+ service = TableClient.from_table_url("http://local-machine:11002/custom/account/path/foo" + self.sas_token)
+ self.assertEqual(service.account_name, None)
+ self.assertEqual(service.table_name, "foo")
+ self.assertEqual(service.credential, None)
+ self.assertEqual(service._primary_hostname, 'local-machine:11002/custom/account/path')
+ self.assertTrue(service.url.startswith('http://local-machine:11002/custom/account/path'))
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_user_agent_default(self, resource_group, location, storage_account, storage_account_key):
+ service = TableServiceClient(self.account_url(storage_account, "table"), credential=storage_account_key)
+
+ def callback(response):
+ self.assertTrue('User-Agent' in response.http_request.headers)
+ self.assertEqual(
+ response.http_request.headers['User-Agent'],
+ "azsdk-python-storage-table/{} Python/{} ({})".format(
+ VERSION,
+ platform.python_version(),
+ platform.platform()))
+
+ tables = list(service.list_tables(raw_response_hook=callback))
+ self.assertIsInstance(tables, list)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_user_agent_custom(self, resource_group, location, storage_account, storage_account_key):
+ custom_app = "TestApp/v1.0"
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"), credential=storage_account_key, user_agent=custom_app)
+
+ def callback(response):
+ self.assertTrue('User-Agent' in response.http_request.headers)
+ self.assertIn(
+ "TestApp/v1.0 azsdk-python-storage-table/{} Python/{} ({})".format(
+ VERSION,
+ platform.python_version(),
+ platform.platform()),
+ response.http_request.headers['User-Agent']
+ )
+
+ tables = list(service.list_tables(raw_response_hook=callback))
+ self.assertIsInstance(tables, list)
+
+ def callback(response):
+ self.assertTrue('User-Agent' in response.http_request.headers)
+ self.assertIn(
+ "TestApp/v2.0 TestApp/v1.0 azsdk-python-storage-table/{} Python/{} ({})".format(
+ VERSION,
+ platform.python_version(),
+ platform.platform()),
+ response.http_request.headers['User-Agent']
+ )
+
+ tables = list(service.list_tables(raw_response_hook=callback, user_agent="TestApp/v2.0"))
+ self.assertIsInstance(tables, list)
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_user_agent_append(self, resource_group, location, storage_account, storage_account_key):
+ service = TableServiceClient(self.account_url(storage_account, "table"), credential=storage_account_key)
+
+ def callback(response):
+ self.assertTrue('User-Agent' in response.http_request.headers)
+ self.assertEqual(
+ response.http_request.headers['User-Agent'],
+ "azsdk-python-storage-table/{} Python/{} ({}) customer_user_agent".format(
+ VERSION,
+ platform.python_version(),
+ platform.platform())
+)
+
+ custom_headers = {'User-Agent': 'customer_user_agent'}
+ tables = list(service.list_tables(raw_response_hook=callback, headers=custom_headers))
+ self.assertIsInstance(tables, list)
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_table_client_with_complete_table_url(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ table_url = self.account_url(storage_account, "table") + "/foo"
+ service = TableClient(table_url, table_name='bar', credential=storage_account_key)
+
+ # Assert
+ self.assertEqual(service.scheme, 'https')
+ self.assertEqual(service.table_name, 'bar')
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_table_client_with_complete_url(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ table_url = "https://{}.table.core.windows.net:443/foo".format(storage_account.name)
+ service = TableClient(account_url=table_url, table_name='bar', credential=storage_account_key)
+
+ # Assert
+ self.assertEqual(service.scheme, 'https')
+ self.assertEqual(service.table_name, 'bar')
+ self.assertEqual(service.account_name, storage_account.name)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_create_table_client_with_invalid_name(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ table_url = "https://{}.table.core.windows.net:443/foo".format(storage_account.name)
+ invalid_table_name = "my_table"
+
+ # Assert
+ with pytest.raises(ValueError) as excinfo:
+ service = TableClient(account_url=table_url, table_name=invalid_table_name, credential=storage_account_key)
+
+ assert "Table names must be alphanumeric, cannot begin with a number, and must be between 3-63 characters long.""" in str(excinfo)
+
+
+ #@pytest.mark.skip("pending")
+ def test_error_with_malformed_conn_str(self):
+ # Arrange
+
+ for conn_str in ["", "foobar", "foobar=baz=foo", "foo;bar;baz", "foo=;bar=;", "=", ";", "=;=="]:
+ for service_type in SERVICES.items():
+ # Act
+ with self.assertRaises(ValueError) as e:
+ service = service_type[0].from_connection_string(conn_str, table_name="test")
+
+ if conn_str in("", "foobar", "foo;bar;baz", ";"):
+ self.assertEqual(
+ str(e.exception), "Connection string is either blank or malformed.")
+ elif conn_str in ("foobar=baz=foo" , "foo=;bar=;", "=", "=;=="):
+ self.assertEqual(
+ str(e.exception), "Connection string missing required connection details.")
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_closing_pipeline_client(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ for client, url in SERVICES.items():
+ # Act
+ service = client(
+ self.account_url(storage_account, "table"), credential=storage_account_key, table_name='table')
+
+ # Assert
+ with service:
+ assert hasattr(service, 'close')
+ service.close()
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_closing_pipeline_client_simple(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ for client, url in SERVICES.items():
+ # Act
+ service = client(
+ self.account_url(storage_account, "table"), credential=storage_account_key, table_name='table')
+ service.close()
+# ------------------------------------------------------------------------------
+if __name__ == '__main__':
+ unittest.main()
diff --git a/sdk/tables/azure-data-tables/tests/test_table_encryption.py b/sdk/tables/azure-data-tables/tests/test_table_encryption.py
new file mode 100644
index 000000000000..008f0ea3743c
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table_encryption.py
@@ -0,0 +1,977 @@
+# # coding: utf-8
+#
+# # -------------------------------------------------------------------------
+# # Copyright (c) Microsoft Corporation. All rights reserved.
+# # Licensed under the MIT License. See License.txt in the project root for
+# # license information.
+# # --------------------------------------------------------------------------
+#
+# import unittest
+#
+# import pytest
+# from datetime import datetime
+#
+# from azure.common import AzureException
+# from azure.core.exceptions import ResourceExistsError
+# from azure.data.tables import TableServiceClient
+# from azure.data.tables._entity import EntityProperty, EdmType, Entity
+# from azure.data.tables._models import TablePayloadFormat, AccessPolicy, TableSasPermissions, TableServices
+# from azure.data.tables._shared._common_conversion import _encode_base64
+# from azure.data.tables._shared.encryption import _dict_to_encryption_data, _generate_AES_CBC_cipher
+# from dateutil.tz import tzutc
+# from os import urandom
+# from json import loads
+# from copy import deepcopy
+#
+# # from encryption_test_helper import KeyWrapper, KeyResolver, RSAKeyWrapper
+# from testutils.common_recordingtestcase import TestMode
+#
+# pytestmark = pytest.mark.skip
+#
+# # from testcase import (
+# # TableTestCase,
+# # TestMode,
+# # record,
+# # )
+# # from azure.data.tables import (
+# # Entity,
+# # EntityProperty,
+# # TableService,
+# # EdmType,
+# # TableBatch,
+# # )
+# # from azure.storage.models import(
+# # AccessPolicy,
+# # )
+# # from tests.test_encryption_helper import(
+# # KeyWrapper,
+# # KeyResolver,
+# # RSAKeyWrapper,
+# # )
+# # from azure.storage.table.models import(
+# # TablePayloadFormat,
+# # TablePermissions,
+# # )
+# from azure.data.tables._shared._error import (
+# _ERROR_UNSUPPORTED_TYPE_FOR_ENCRYPTION,
+# )
+# from azure.data.tables._shared._error import (
+# _ERROR_OBJECT_INVALID,
+# _ERROR_DECRYPTION_FAILURE,
+# )
+# #Encyption not supported yet
+# # from cryptography.hazmat.backends import default_backend
+# # from cryptography.hazmat.primitives.ciphers.algorithms import AES
+# # from cryptography.hazmat.primitives.ciphers.modes import CBC
+# # from cryptography.hazmat.primitives.padding import PKCS7
+# # from cryptography.hazmat.primitives.ciphers import Cipher
+# # from cryptography.hazmat.primitives.hashes import (
+# # Hash,
+# # SHA256,
+# # )
+#
+# from _shared.testcase import GlobalStorageAccountPreparer, TableTestCase, LogCaptured
+#
+#
+# class StorageTableEncryptionTest(TableTestCase):
+#
+# def _set_up(self, storage_account, storage_account_key):
+# self.ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+# self.table_name = self.get_resource_name('uttable')
+# self.table = self.ts.get_table_client(self.table_name)
+# if self.is_live:
+# try:
+# self.ts.create_table(table_name=self.table_name)
+# except ResourceExistsError:
+# pass
+#
+# self.query_tables = []
+#
+# def _tear_down(self):
+# if self.is_live:
+# try:
+# self.ts.delete_table(self.table_name)
+# except:
+# pass
+#
+# for table_name in self.query_tables:
+# try:
+# self.ts.delete_table(table_name)
+# except:
+# pass
+#
+# # --Helpers-----------------------------------------------------------------
+#
+# def _create_query_table_encrypted(self, entity_count):
+# '''
+# Creates a table with the specified name and adds entities with the
+# default set of values. PartitionKey is set to 'MyPartition' and RowKey
+# is set to a unique counter value starting at 1 (as a string). The
+# 'sex' attribute is set to be encrypted.
+# '''
+# table_name = self.get_resource_name('querytable')
+# self.ts.create_table(table_name, True)
+# self.query_tables.append(table_name)
+# self.ts.require_encryption = True
+#
+# entity = self._create_default_entity_for_encryption()
+# self.table.create_entity(table_entity_properties=entity)
+# # with self.ts.batch(table_name) as batch:
+# # for i in range(1, entity_count + 1):
+# # entity['RowKey'] = entity['RowKey'] + str(i)
+# # batch.insert_entity(entity)
+# return table_name
+#
+# def _create_random_base_entity_class(self):
+# '''
+# Creates a class-based entity with only pk and rk.
+# '''
+# partition = self.get_resource_name('pk')
+# row = self.get_resource_name('rk')
+# entity = Entity()
+# entity.PartitionKey = partition
+# entity.RowKey = row
+# return entity
+#
+# def _create_random_base_entity_dict(self):
+# '''
+# Creates a dict-based entity with only pk and rk.
+# '''
+# partition = self.get_resource_name('pk')
+# row = self.get_resource_name('rk')
+# return {'PartitionKey': partition,
+# 'RowKey': row,
+# }
+#
+# def _create_random_entity_class(self, pk=None, rk=None):
+# '''
+# Creates a class-based entity with fixed values, using all
+# of the supported data types.
+# '''
+# partition = pk if pk is not None else self.get_resource_name('pk')
+# row = rk if rk is not None else self.get_resource_name('rk')
+# entity = Entity()
+# entity.PartitionKey = partition
+# entity.RowKey = row
+# entity.age = 39
+# entity.sex = 'male'
+# entity.name = 'John Doe'
+# entity.married = True
+# entity.deceased = False
+# entity.optional = None
+# entity.evenratio = 3.0
+# entity.ratio = 3.1
+# entity.large = 933311100
+# entity.Birthday = datetime(1973, 10, 4)
+# entity.birthday = datetime(1970, 10, 4)
+# entity.binary = EntityProperty(EdmType.BINARY, b'binary')
+# entity.other = EntityProperty(EdmType.INT32, 20)
+# entity.clsid = EntityProperty(
+# EdmType.GUID, 'c9da6455-213d-42c9-9a79-3e9149a57833')
+# return entity
+#
+# def _create_default_entity_for_encryption(self):
+# entity = self._create_random_entity_class()
+# entity['sex'] = EntityProperty(EdmType.STRING, entity['sex'], True)
+# entity['name'] = EntityProperty(EdmType.STRING, entity['name'], True)
+# return entity
+#
+# def _create_default_entity_dict(self, pk=None, rk=None):
+# '''
+# Creates a dictionary-based entity with fixed values, using all
+# of the supported data types.
+# '''
+# partition = pk if pk is not None else self.get_resource_name('pk')
+# row = rk if rk is not None else self.get_resource_name('rk')
+# return {'PartitionKey': partition,
+# 'RowKey': row,
+# 'age': 39,
+# 'sex': 'male',
+# 'name': 'John Doe',
+# 'married': True,
+# 'deceased': False,
+# 'optional': None,
+# 'ratio': 3.1,
+# 'evenratio': 3.0,
+# 'large': 933311100,
+# 'Birthday': datetime(1973, 10, 4),
+# 'birthday': datetime(1970, 10, 4),
+# 'binary': EntityProperty(EdmType.BINARY, b'binary'),
+# 'other': EntityProperty(EdmType.INT32, 20),
+# 'clsid': EntityProperty(
+# EdmType.GUID,
+# 'c9da6455-213d-42c9-9a79-3e9149a57833')}
+#
+# def _assert_default_entity(self, entity):
+# '''
+# Asserts that the entity passed in matches the default entity.
+# '''
+# self.assertEqual(entity.age, 39)
+# self.assertEqual(entity.sex, 'male')
+# self.assertEqual(entity.name, 'John Doe')
+# self.assertEqual(entity.married, True)
+# self.assertEqual(entity.deceased, False)
+# self.assertFalse(hasattr(entity, "optional"))
+# self.assertFalse(hasattr(entity, "aquarius"))
+# self.assertEqual(entity.ratio, 3.1)
+# self.assertEqual(entity.evenratio, 3.0)
+# self.assertEqual(entity.large, 933311100)
+# self.assertEqual(entity.Birthday, datetime(1973, 10, 4, tzinfo=tzutc()))
+# self.assertEqual(entity.birthday, datetime(1970, 10, 4, tzinfo=tzutc()))
+# self.assertIsInstance(entity.binary, EntityProperty)
+# self.assertEqual(entity.binary.type, EdmType.BINARY)
+# self.assertEqual(entity.binary.value, b'binary')
+# self.assertIsInstance(entity.other, EntityProperty)
+# self.assertEqual(entity.other.type, EdmType.INT32)
+# self.assertEqual(entity.other.value, 20)
+# self.assertIsInstance(entity.clsid, EntityProperty)
+# self.assertEqual(entity.clsid.type, EdmType.GUID)
+# self.assertEqual(entity.clsid.value,
+# 'c9da6455-213d-42c9-9a79-3e9149a57833')
+# self.assertTrue(hasattr(entity, "Timestamp"))
+# self.assertIsInstance(entity.Timestamp, datetime)
+# self.assertIsNotNone(entity.etag)
+#
+# def _assert_default_entity_json_no_metadata(self, entity):
+# '''
+# Asserts that the entity passed in matches the default entity.
+# '''
+# self.assertEqual(entity.age, '39')
+# self.assertEqual(entity.sex, 'male')
+# self.assertEqual(entity.name, 'John Doe')
+# self.assertEqual(entity.married, True)
+# self.assertEqual(entity.deceased, False)
+# self.assertFalse(hasattr(entity, "optional"))
+# self.assertFalse(hasattr(entity, "aquarius"))
+# self.assertEqual(entity.ratio, 3.1)
+# self.assertEqual(entity.evenratio, 3.0)
+# self.assertEqual(entity.large, '933311100')
+# self.assertEqual(entity.Birthday, '1973-10-04T00:00:00Z')
+# self.assertEqual(entity.birthday, '1970-10-04T00:00:00Z')
+# self.assertEqual(entity.binary, _encode_base64(b'binary'))
+# self.assertIsInstance(entity.other, EntityProperty)
+# self.assertEqual(entity.other.type, EdmType.INT32)
+# self.assertEqual(entity.other.value, 20)
+# self.assertEqual(entity.clsid, 'c9da6455-213d-42c9-9a79-3e9149a57833')
+# self.assertTrue(hasattr(entity, "Timestamp"))
+# self.assertIsInstance(entity.Timestamp, datetime)
+# self.assertIsNotNone(entity.etag)
+#
+# def _default_encryption_resolver(self, x, y, property):
+# return (property == 'sex' or property == 'name')
+#
+# # @record
+# def test_get_encrypted_dict(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_dict()
+# entity['sex'] = EntityProperty(EdmType.STRING, entity['sex'], True)
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.table.create_entity(table_entity_properties=entity)
+#
+# # Act
+# new_entity = self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self._assert_default_entity(new_entity)
+#
+# # @record
+# def test_get_encrypted_entity(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# # Only want to encrypt one property in this test
+# entity['name'] = 'John Doe'
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.table.insert_entity(self.table_name, entity)
+#
+# # Act
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self._assert_default_entity(new_entity)
+#
+# # @record
+# def test_get_encrypt_multiple_properties(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.create_entity(table_entity_properties=entity)
+#
+# # Act
+# new_entity = self.ts.get_entity(entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self._assert_default_entity(new_entity)
+#
+# # @record
+# def test_get_encrypted_entity_key_resolver(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# key_resolver = KeyResolver()
+# key_resolver.put_key(self.ts.key_encryption_key)
+# self.ts.key_resolver_function = key_resolver.resolve_key
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# self.ts.key_encryption_key = None
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self._assert_default_entity(new_entity)
+#
+# # @record
+# def test_get_encrypted_entity_encryption_resolver(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_random_entity_class()
+# self.ts.encryption_resolver_function = self._default_encryption_resolver
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+# self.ts.key_encryption_key = None
+# self.ts.require_encryption = False
+# # Retrive a second copy without decrypting to ensure properties were encrypted.
+# new_entity2 = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self._assert_default_entity(new_entity)
+# self.assertEqual(EdmType.BINARY, new_entity2['sex'].type)
+# self.assertEqual(EdmType.BINARY, new_entity2['name'].type)
+#
+# # @record
+# def test_get_encrypted_entity_properties_and_resolver(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# self.ts.encryption_resolver_function = self._default_encryption_resolver
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self._assert_default_entity(new_entity)
+#
+# def _get_with_payload_format(self, format):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# entity['RowKey'] = entity['RowKey'] + format[len('application/json;odata='):]
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'],
+# accept=format)
+#
+# # Assert
+# if format == TablePayloadFormat.JSON_NO_METADATA:
+# self._assert_default_entity_json_no_metadata(new_entity)
+# else:
+# self._assert_default_entity(new_entity)
+#
+# # @record
+# def test_get_payload_formats(self):
+# self._get_with_payload_format(TablePayloadFormat.JSON_FULL_METADATA)
+# self._get_with_payload_format(TablePayloadFormat.JSON_MINIMAL_METADATA)
+# self._get_with_payload_format(TablePayloadFormat.JSON_NO_METADATA)
+#
+# def test_get_entity_kek_RSA(self):
+# # We can only generate random RSA keys, so this must be run live or
+# # the playback test will fail due to a change in kek values.
+# if TestMode.need_recording_file(self.test_mode):
+# return
+#
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = RSAKeyWrapper('key2')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self._assert_default_entity(new_entity)
+#
+# # @record
+# def test_get_entity_nonmatching_kid(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_random_entity_class()
+# self.ts.encryption_resolver_function = self._default_encryption_resolver
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# self.ts.key_encryption_key.kid = 'Invalid'
+#
+# # Assert
+# try:
+# self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+# self.fail()
+# except AzureException as e:
+# self.assertEqual(str(e), _ERROR_DECRYPTION_FAILURE)
+#
+# # @record
+# def test_get_entity_invalid_value_kek_wrap(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+#
+# self.ts.key_encryption_key.get_key_wrap_algorithm = None
+# try:
+# self.ts.insert_entity(self.table_name, entity)
+# self.fail()
+# except AttributeError as e:
+# self.assertEqual(str(e), _ERROR_OBJECT_INVALID.format('key encryption key', 'get_key_wrap_algorithm'))
+#
+# self.ts.key_encryption_key = KeyWrapper('key1')
+#
+# self.ts.key_encryption_key.get_kid = None
+# with self.assertRaises(AttributeError):
+# self.ts.insert_entity(self.table_name, entity)
+#
+# self.ts.key_encryption_key = KeyWrapper('key1')
+#
+# self.ts.key_encryption_key.wrap_key = None
+# with self.assertRaises(AttributeError):
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # @record
+# def test_get_entity_invalid_value_kek_unwrap(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# self.ts.key_encryption_key.unwrap_key = None
+# try:
+# self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+# self.fail()
+# except AzureException as e:
+# self.assertEqual(str(e), _ERROR_DECRYPTION_FAILURE)
+#
+# self.ts.key_encryption_key = KeyWrapper('key1')
+#
+# self.ts.key_encryption_key.get_kid = None
+# with self.assertRaises(AzureException):
+# self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # @record
+# def test_insert_entity_missing_attribute_kek_wrap(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# valid_key = KeyWrapper('key1')
+#
+# # Act
+# invalid_key_1 = lambda: None # functions are objects, so this effectively creates an empty object
+# invalid_key_1.get_key_wrap_algorithm = valid_key.get_key_wrap_algorithm
+# invalid_key_1.get_kid = valid_key.get_kid
+# # No attribute wrap_key
+# self.ts.key_encryption_key = invalid_key_1
+# with self.assertRaises(AttributeError):
+# self.ts.insert_entity(self.table_name, entity)
+#
+# invalid_key_2 = lambda: None # functions are objects, so this effectively creates an empty object
+# invalid_key_2.wrap_key = valid_key.wrap_key
+# invalid_key_2.get_kid = valid_key.get_kid
+# # No attribute get_key_wrap_algorithm
+# self.ts.key_encryption_key = invalid_key_2
+# with self.assertRaises(AttributeError):
+# self.ts.insert_entity(self.table_name, entity)
+#
+# invalid_key_3 = lambda: None # functions are objects, so this effectively creates an empty object
+# invalid_key_3.get_key_wrap_algorithm = valid_key.get_key_wrap_algorithm
+# invalid_key_3.wrap_key = valid_key.wrap_key
+# # No attribute get_kid
+# self.ts.key_encryption_key = invalid_key_3
+# with self.assertRaises(AttributeError):
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # @record
+# def test_get_entity_missing_attribute_kek_unwrap(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# valid_key = KeyWrapper('key1')
+# self.ts.key_encryption_key = valid_key
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# invalid_key_1 = lambda: None # functions are objects, so this effectively creates an empty object
+# invalid_key_1.get_kid = valid_key.get_kid
+# # No attribute unwrap_key
+# self.ts.key_encryption_key = invalid_key_1
+# with self.assertRaises(AzureException):
+# self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# invalid_key_2 = lambda: None # functions are objects, so this effectively creates an empty object
+# invalid_key_2.unwrap_key = valid_key.unwrap_key
+# # No attribute get_kid
+# self.ts.key_encryption_key = invalid_key_2
+# with self.assertRaises(AzureException):
+# self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # @record
+# def test_get_entity_no_decryption(self):
+# # Arrange
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# self.ts.key_encryption_key = None
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# # Access the properties to ensure they are still on the entity
+# new_entity['_ClientEncryptionMetadata1']
+# new_entity['_ClientEncryptionMetadata2']
+#
+# value = new_entity['sex']
+# self.assertEqual(value.type, EdmType.BINARY)
+#
+# # @record
+# def test_replace_entity(self):
+# # Arrange
+# entity = self._create_random_entity_class()
+# self.ts.insert_entity(self.table_name, entity)
+# entity['sex'] = EntityProperty(EdmType.STRING, 'female', True)
+# self.ts.key_encryption_key = KeyWrapper('key1')
+#
+# # Act
+# self.ts.require_encryption = True
+# self.ts.update_entity(self.table_name, entity)
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self.assertEqual(new_entity['sex'], entity['sex'].value)
+#
+# # @record
+# def test_insert_strict_mode(self):
+# # Arrange
+# entity = self._create_default_entity_for_encryption()
+# self.ts.require_encryption = True
+#
+# # Assert
+# with self.assertRaises(ValueError):
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # @record
+# def test_strict_mode_policy_no_encrypted_properties(self):
+# # Arrange
+# entity = self._create_random_entity_class()
+# self.ts.require_encryption = True
+# self.ts.key_encryption_key = KeyWrapper('key1')
+#
+# # Act
+# # Even when require encryption is true, it should be possilbe to insert
+# # an entity that happens to not have any properties marked for encyrption.
+# self.ts.insert_entity(self.table_name, entity)
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Assert
+# self._assert_default_entity(new_entity)
+#
+# # @record
+# def test_get_strict_mode_no_key(self):
+# # Arrange
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# self.ts.key_encryption_key = None
+# self.ts.require_encryption = True
+#
+# # Assert
+# with self.assertRaises(AzureException):
+# self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # @record
+# def test_get_strict_mode_unencrypted_entity(self):
+# # Arrange
+# entity = self._create_random_base_entity_class()
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# self.ts.require_encryption = True
+# self.ts.key_encryption_key = KeyWrapper('key1')
+#
+# # Assert
+# with self.assertRaises(AzureException):
+# self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # @record
+# @pytest.mark.skip("pending")
+# def test_batch_entity_inserts_context_manager(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity1 = self._create_random_entity_class()
+# entity2 = self._create_random_entity_class(rk='Entity2')
+# entity3 = self._create_random_entity_class(rk='Entity3')
+# entity2['PartitionKey'] = entity1['PartitionKey']
+# entity3['PartitionKey'] = entity1['PartitionKey']
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.require_encryption = True
+# self.ts.encryption_resolver_function = self._default_encryption_resolver
+# self.ts.insert_entity(self.table_name, entity3)
+# entity3['sex'] = 'female'
+#
+# # Act
+# with self.ts.batch(self.table_name) as batch:
+# batch.insert_entity(entity1)
+# batch.insert_or_replace_entity(entity2)
+# batch.update_entity(entity3)
+#
+# new_entity1 = self.ts.get_entity(self.table_name, entity1['PartitionKey'], entity1['RowKey'])
+# new_entity2 = self.ts.get_entity(self.table_name, entity2['PartitionKey'], entity2['RowKey'])
+# new_entity3 = self.ts.get_entity(self.table_name, entity3['PartitionKey'], entity3['RowKey'])
+#
+# # Assert
+# self.assertEqual(new_entity1['sex'], entity1['sex'])
+# self.assertEqual(new_entity2['sex'], entity2['sex'])
+# self.assertEqual(new_entity3['sex'], entity3['sex'])
+#
+# # @record
+# @pytest.mark.skip("pending")
+# def test_batch_strict_mode(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+#
+# # Act
+# batch = TableBatch(require_encryption=True)
+#
+# # Assert
+# with self.assertRaises(ValueError):
+# batch.insert_entity(entity)
+#
+# # @record
+# def test_property_resolver_decrypt_conflict(self):
+# # Tests that the encrypted properties list is given priorty
+# # over the property resolver when deserializng (i.e. the
+# # EdmType should be binary, not the result of the resolver)
+#
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# property_resolver = lambda x, y, name, a, b: EdmType.STRING if name == 'sex' else None
+#
+# # Act
+# new_entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'],
+# property_resolver=property_resolver)
+#
+# # Assert
+# # If the encrypted property list correctly took priority, this field will have been
+# # properly decrypted
+# self.assertEqual(new_entity['sex'], 'male')
+#
+# # @record
+# def test_validate_encryption(self):
+# # Arrange
+# entity = self._create_default_entity_for_encryption()
+# key_encryption_key = KeyWrapper('key1')
+# self.ts.key_encryption_key = key_encryption_key
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# self.ts.key_encryption_key = None
+# entity = self.ts.get_entity(self.table_name, entity['PartitionKey'], entity['RowKey'])
+#
+# # Note the minor discrepancy from the normal decryption process: because the entity was retrieved
+# # without being decrypted, the encrypted_properties list is now stored in an EntityProperty object
+# # and is already raw bytes.
+# encrypted_properties_list = entity['_ClientEncryptionMetadata2'].value
+# encryption_data = entity['_ClientEncryptionMetadata1']
+# encryption_data = _dict_to_encryption_data(loads(encryption_data))
+#
+# content_encryption_key = key_encryption_key.unwrap_key(encryption_data.wrapped_content_key.encrypted_key,
+# encryption_data.wrapped_content_key.algorithm)
+#
+# digest = Hash(SHA256(), default_backend())
+# digest.update(encryption_data.content_encryption_IV +
+# (entity['RowKey'] + entity['PartitionKey'] + '_ClientEncryptionMetadata2').encode('utf-8'))
+# metadataIV = digest.finalize()
+# metadataIV = metadataIV[:16]
+#
+# cipher = _generate_AES_CBC_cipher(content_encryption_key, metadataIV)
+#
+# # Decrypt the data.
+# decryptor = cipher.decryptor()
+# encrypted_properties_list = decryptor.update(encrypted_properties_list) + decryptor.finalize()
+#
+# # Unpad the data.
+# unpadder = PKCS7(128).unpadder()
+# encrypted_properties_list = unpadder.update(encrypted_properties_list) + unpadder.finalize()
+#
+# encrypted_properties_list = encrypted_properties_list.decode('utf-8')
+#
+# # Strip the square braces from the ends and split string into list.
+# encrypted_properties_list = loads(encrypted_properties_list)
+#
+# entity_iv, encrypted_properties, content_encryption_key = \
+# (encryption_data.content_encryption_IV, encrypted_properties_list, content_encryption_key)
+#
+# decrypted_entity = deepcopy(entity)
+#
+# for property in encrypted_properties_list:
+# value = entity[property]
+#
+# digest = Hash(SHA256(), default_backend())
+# digest.update(entity_iv +
+# (entity['RowKey'] + entity['PartitionKey'] + property).encode('utf-8'))
+# propertyIV = digest.finalize()
+# propertyIV = propertyIV[:16]
+#
+# cipher = _generate_AES_CBC_cipher(content_encryption_key,
+# propertyIV)
+#
+# # Decrypt the property.
+# decryptor = cipher.decryptor()
+# decrypted_data = (decryptor.update(value.value) + decryptor.finalize())
+#
+# # Unpad the data.
+# unpadder = PKCS7(128).unpadder()
+# decrypted_data = (unpadder.update(decrypted_data) + unpadder.finalize())
+#
+# decrypted_data = decrypted_data.decode('utf-8')
+#
+# decrypted_entity[property] = decrypted_data
+#
+# decrypted_entity.pop('_ClientEncryptionMetadata1')
+# decrypted_entity.pop('_ClientEncryptionMetadata2')
+#
+# # Assert
+# self.assertEqual(decrypted_entity['sex'], 'male')
+#
+# # @record
+# def test_insert_encrypt_invalid_types(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity_binary = self._create_random_entity_class()
+# entity_binary['bytes'] = EntityProperty(EdmType.BINARY, urandom(10), True)
+# entity_boolean = self._create_random_entity_class()
+# entity_boolean['married'] = EntityProperty(EdmType.BOOLEAN, True, True)
+# entity_date_time = self._create_random_entity_class()
+# entity_date_time['birthday'] = EntityProperty(EdmType.DATETIME, entity_date_time['birthday'], True)
+# entity_double = self._create_random_entity_class()
+# entity_double['ratio'] = EntityProperty(EdmType.DATETIME, entity_double['ratio'], True)
+# entity_guid = self._create_random_entity_class()
+# entity_guid['clsid'].encrypt = True
+# entity_int32 = self._create_random_entity_class()
+# entity_int32['other'].encrypt = True
+# entity_int64 = self._create_random_entity_class()
+# entity_int64['large'] = EntityProperty(EdmType.INT64, entity_int64['large'], True)
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# entity_none_str = self._create_random_entity_class()
+# entity_none_str['none_str'] = EntityProperty(EdmType.STRING, None, True)
+#
+# # Act
+#
+# # Assert
+# try:
+# self.ts.insert_entity(self.table_name, entity_binary)
+# self.fail()
+# except ValueError as e:
+# self.assertEqual(str(e), _ERROR_UNSUPPORTED_TYPE_FOR_ENCRYPTION)
+# with self.assertRaises(ValueError):
+# self.ts.insert_entity(self.table_name, entity_boolean)
+# with self.assertRaises(ValueError):
+# self.ts.insert_entity(self.table_name, entity_date_time)
+# with self.assertRaises(ValueError):
+# self.ts.insert_entity(self.table_name, entity_double)
+# with self.assertRaises(ValueError):
+# self.ts.insert_entity(self.table_name, entity_guid)
+# with self.assertRaises(ValueError):
+# self.ts.insert_entity(self.table_name, entity_int32)
+# with self.assertRaises(ValueError):
+# self.ts.insert_entity(self.table_name, entity_int64)
+# with self.assertRaises(ValueError):
+# self.ts.insert_entity(self.table_name, entity_none_str)
+#
+# # @record
+# def test_invalid_encryption_operations_fail(self):
+# # Arrange
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Assert
+# with self.assertRaises(ValueError):
+# self.ts.merge_entity(self.table_name, entity)
+#
+# with self.assertRaises(ValueError):
+# self.ts.insert_or_merge_entity(self.table_name, entity)
+#
+# self.ts.require_encryption = True
+# self.ts.key_encryption_key = None
+#
+# with self.assertRaises(ValueError):
+# self.ts.merge_entity(self.table_name, entity)
+#
+# with self.assertRaises(ValueError):
+# self.ts.insert_or_merge_entity(self.table_name, entity)
+#
+# # @record
+# @pytest.mark.skip("pending")
+# def test_invalid_encryption_operations_fail_batch(self):
+# # Arrange
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# batch = TableBatch(require_encryption=True, key_encryption_key=self.ts.key_encryption_key)
+#
+# # Assert
+# with self.assertRaises(ValueError):
+# batch.merge_entity(entity)
+#
+# with self.assertRaises(ValueError):
+# batch.insert_or_merge_entity(entity)
+#
+# # @record
+# def test_query_entities_all_properties(self):
+# # Arrange
+# self.ts.require_encryption = True
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# table_name = self._create_query_table_encrypted(5)
+# default_entity = self._create_random_entity_class()
+#
+# # Act
+# resp = self.ts.query_entities(table_name, num_results=5)
+#
+# # Assert
+# self.assertEqual(len(resp.items), 5)
+# for entity in resp.items:
+# self.assertEqual(default_entity['sex'], entity['sex'])
+#
+# # @record
+# def test_query_entities_projection(self):
+# # Arrange
+# self.ts.require_encryption = True
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# table_name = self._create_query_table_encrypted(5)
+# default_entity = self._create_random_entity_class()
+#
+# # Act
+# resp = self.ts.query_entities(table_name, num_results=5, select='PartitionKey,RowKey,sex')
+#
+# # Assert
+# for entity in resp.items:
+# self.assertEqual(default_entity['sex'], entity['sex'])
+# self.assertFalse(hasattr(entity, '_ClientEncryptionMetadata1'))
+# self.assertFalse(hasattr(entity, '_ClientEncryptionMetadata2'))
+#
+# # @record
+# def test_query_entities_mixed_mode(self):
+# # Arrange
+# entity = self._create_random_entity_class(rk='unencrypted')
+# entity['RowKey'] += 'unencrypted'
+# self.ts.insert_entity(self.table_name, entity)
+# entity = self._create_default_entity_for_encryption()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# self.ts.insert_entity(self.table_name, entity)
+#
+# # Act
+# # Pass with out encryption_required
+# self.ts.query_entities(self.table_name)
+#
+# # Assert
+# # Fail with encryption_required because not all returned entities
+# # will be encrypted.
+# self.ts.require_encryption = True
+# with self.assertRaises(AzureException):
+# self.ts.query_entities(self.table_name)
+#
+# # @record
+# def test_insert_entity_too_many_properties(self):
+# # Arrange
+# self.ts.require_encryption = True
+# entity = self._create_random_base_entity_dict()
+# self.ts.key_encryption_key = KeyWrapper('key1')
+# for i in range(251):
+# entity['key{0}'.format(i)] = 'value{0}'.format(i)
+#
+# # Act
+# with self.assertRaises(ValueError):
+# resp = self.ts.insert_entity(self.table_name, entity)
+#
+# # @record
+# def test_validate_swapping_properties_fails(self):
+# # Arrange
+# entity1 = self._create_random_entity_class(rk='entity1')
+# entity2 = self._create_random_entity_class(rk='entity2')
+# kek = KeyWrapper('key1')
+# self.ts.key_encryption_key = kek
+# self.ts.encryption_resolver_function = self._default_encryption_resolver
+# self.ts.insert_entity(self.table_name, entity1)
+# self.ts.insert_entity(self.table_name, entity2)
+#
+# # Act
+# self.ts.key_encryption_key = None
+# new_entity1 = self.ts.get_entity(self.table_name, entity1['PartitionKey'], entity1['RowKey'])
+# new_entity2 = deepcopy(new_entity1)
+# new_entity2['PartitionKey'] = entity2['PartitionKey']
+# new_entity2['RowKey'] = entity2['RowKey']
+# self.ts.update_entity(self.table_name, new_entity2)
+# self.ts.key_encryption_key = kek
+#
+# # Assert
+# with self.assertRaises(AzureException):
+# self.ts.get_entity(self.table_name, new_entity2['PartitionKey'], new_entity2['RowKey'])
+#
+# # @record
+# def test_table_ops_ignore_encryption(self):
+# table_name = self.get_resource_name('EncryptionTableOps')
+# try:
+# # Arrange
+# self.ts.require_encryption = True
+# self.ts.key_encryption_key = KeyWrapper('key1')
+#
+# # Act
+# self.assertTrue(self.ts.create_table(table_name))
+#
+# self.assertTrue(self.ts.exists(table_name))
+#
+# list_tables = self.ts.list_tables()
+# test_table_exists = False
+# for table in list_tables:
+# if table.name == table_name:
+# test_table_exists = True
+# self.assertTrue(test_table_exists)
+#
+# permissions = self.ts.get_table_acl(table_name)
+# new_policy = AccessPolicy(TableSasPermissions(_str='r'), expiry=datetime(2017, 9, 9))
+# permissions['samplePolicy'] = new_policy
+# self.ts.set_table_acl(table_name, permissions)
+# permissions = self.ts.get_table_acl(table_name)
+# permissions['samplePolicy']
+# self.ts.key_encryption_key = None
+# permissions = self.ts.get_table_acl(table_name)
+# permissions['samplePolicy']
+#
+# self.ts.delete_table(table_name)
+# self.assertFalse(self.ts.exists(table_name))
+# finally:
+# self.ts.delete_table(table_name)
+#
+#
+# # ------------------------------------------------------------------------------
+# if __name__ == '__main__':
+# unittest.main()
diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity.py b/sdk/tables/azure-data-tables/tests/test_table_entity.py
new file mode 100644
index 000000000000..c199a57d506f
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table_entity.py
@@ -0,0 +1,1714 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import unittest
+
+import pytest
+
+import uuid
+from base64 import b64encode
+from datetime import datetime, timedelta
+
+from azure.data.tables import TableServiceClient, TableClient, generate_table_sas
+from dateutil.tz import tzutc, tzoffset
+from math import isnan
+
+from azure.core import MatchConditions
+from azure.core.exceptions import (
+ HttpResponseError,
+ ResourceNotFoundError,
+ ResourceExistsError)
+
+from azure.data.tables._entity import TableEntity, EntityProperty, EdmType
+from azure.data.tables._models import TableSasPermissions, AccessPolicy, UpdateMode
+
+from _shared.testcase import GlobalStorageAccountPreparer, TableTestCase, LogCaptured
+
+
+# ------------------------------------------------------------------------------
+
+# ------------------------------------------------------------------------------
+
+class StorageTableEntityTest(TableTestCase):
+
+ def _set_up(self, storage_account, storage_account_key):
+ self.ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ self.table_name = self.get_resource_name('uttable')
+ self.table = self.ts.get_table_client(self.table_name)
+ if self.is_live:
+ try:
+ self.ts.create_table(self.table_name)
+ except ResourceExistsError:
+ pass
+
+ self.query_tables = []
+
+ def _tear_down(self):
+ if self.is_live:
+ try:
+ self.ts.delete_table(self.table_name)
+ except:
+ pass
+
+ for table_name in self.query_tables:
+ try:
+ self.ts.delete_table(table_name)
+ except:
+ pass
+
+ # --Helpers-----------------------------------------------------------------
+
+ def _create_query_table(self, entity_count):
+ """
+ Creates a table with the specified name and adds entities with the
+ default set of values. PartitionKey is set to 'MyPartition' and RowKey
+ is set to a unique counter value starting at 1 (as a string).
+ """
+ table_name = self.get_resource_name('querytable')
+ table = self.ts.create_table(table_name)
+ self.query_tables.append(table_name)
+ client = self.ts.get_table_client(table_name)
+ entity = self._create_random_entity_dict()
+ for i in range(1, entity_count + 1):
+ entity['RowKey'] = entity['RowKey'] + str(i)
+ client.create_entity(entity)
+ # with self.ts.batch(table_name) as batch:
+ # for i in range(1, entity_count + 1):
+ # entity['RowKey'] = entity['RowKey'] + str(i)
+ # batch.create_entity(entity)
+ return client
+
+ def _create_random_base_entity_dict(self):
+ """
+ Creates a dict-based entity with only pk and rk.
+ """
+ partition = self.get_resource_name('pk')
+ row = self.get_resource_name('rk')
+ return {
+ 'PartitionKey': partition,
+ 'RowKey': row,
+ }
+
+ def _create_random_entity_dict(self, pk=None, rk=None):
+ """
+ Creates a dictionary-based entity with fixed values, using all
+ of the supported data types.
+ """
+ partition = pk if pk is not None else self.get_resource_name('pk')
+ row = rk if rk is not None else self.get_resource_name('rk')
+ properties = {
+ 'PartitionKey': partition,
+ 'RowKey': row,
+ 'age': 39,
+ 'sex': 'male',
+ 'married': True,
+ 'deceased': False,
+ 'optional': None,
+ 'ratio': 3.1,
+ 'evenratio': 3.0,
+ 'large': 933311100,
+ 'Birthday': datetime(1973, 10, 4, tzinfo=tzutc()),
+ 'birthday': datetime(1970, 10, 4, tzinfo=tzutc()),
+ 'binary': b'binary',
+ 'other': EntityProperty(type=EdmType.INT32, value=20),
+ 'clsid': uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833')
+ }
+ return TableEntity(**properties)
+
+ def _insert_random_entity(self, pk=None, rk=None):
+ entity = self._create_random_entity_dict(pk, rk)
+ # etag = self.table.create_item(entity, response_hook=lambda e, h: h['etag'])
+ e = self.table.create_entity(entity)
+ metadata = e.metadata()
+ return entity, metadata['etag']
+
+ def _create_updated_entity_dict(self, partition, row):
+ """
+ Creates a dictionary-based entity with fixed values, with a
+ different set of values than the default entity. It
+ adds fields, changes field values, changes field types,
+ and removes fields when compared to the default entity.
+ """
+ return {
+ 'PartitionKey': partition,
+ 'RowKey': row,
+ 'age': 'abc',
+ 'sex': 'female',
+ 'sign': 'aquarius',
+ 'birthday': datetime(1991, 10, 4, tzinfo=tzutc())
+ }
+
+ def _assert_default_entity(self, entity, headers=None):
+ '''
+ Asserts that the entity passed in matches the default entity.
+ '''
+ self.assertEqual(entity['age'], 39)
+ self.assertEqual(entity['sex'], 'male')
+ self.assertEqual(entity['married'], True)
+ self.assertEqual(entity['deceased'], False)
+ self.assertFalse("optional" in entity)
+ self.assertFalse("aquarius" in entity)
+ self.assertEqual(entity['ratio'], 3.1)
+ self.assertEqual(entity['evenratio'], 3.0)
+ self.assertEqual(entity['large'], 933311100)
+ self.assertEqual(entity['Birthday'], datetime(1973, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['birthday'], datetime(1970, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['binary'].value, b'binary')
+ self.assertIsInstance(entity['other'], EntityProperty)
+ self.assertEqual(entity['other'].type, EdmType.INT32)
+ self.assertEqual(entity['other'].value, 20)
+ self.assertEqual(entity['clsid'], uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833'))
+ # self.assertTrue('metadata' in entity.odata)
+ # self.assertIsNotNone(entity.metadata['timestamp'])
+ # self.assertIsInstance(entity.metadata['timestamp'], datetime)
+ # if headers:
+ # self.assertTrue("etag" in headers)
+
+ # self.assertIsNotNone(headers['etag'])
+
+ def _assert_default_entity_json_full_metadata(self, entity, headers=None):
+ '''
+ Asserts that the entity passed in matches the default entity.
+ '''
+ self.assertEqual(entity['age'], 39)
+ self.assertEqual(entity['sex'], 'male')
+ self.assertEqual(entity['married'], True)
+ self.assertEqual(entity['deceased'], False)
+ self.assertFalse("optional" in entity)
+ self.assertFalse("aquarius" in entity)
+ self.assertEqual(entity['ratio'], 3.1)
+ self.assertEqual(entity['evenratio'], 3.0)
+ self.assertEqual(entity['large'], 933311100)
+ self.assertEqual(entity['Birthday'], datetime(1973, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['birthday'], datetime(1970, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['binary'].value, b'binary')
+ self.assertIsInstance(entity['other'], EntityProperty)
+ self.assertEqual(entity['other'].type, EdmType.INT32)
+ self.assertEqual(entity['other'].value, 20)
+ self.assertEqual(entity['clsid'], uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833'))
+ # self.assertTrue('metadata' in entity.odata)
+ # self.assertTrue('id' in entity.odata)
+ # self.assertTrue('type' in entity.odata)
+ # self.assertTrue('etag' in entity.odata)
+ # self.assertTrue('editLink' in entity.odata)
+
+ # self.assertIsNotNone(entity.Timestamp)
+ # self.assertIsInstance(entity.Timestamp, datetime)
+ # if headers:
+ # self.assertTrue("etag" in headers)
+ # self.assertIsNotNone(headers['etag'])
+
+ def _assert_default_entity_json_no_metadata(self, entity, headers=None):
+ '''
+ Asserts that the entity passed in matches the default entity.
+ '''
+ self.assertEqual(entity['age'], '39')
+ self.assertEqual(entity['sex'], 'male')
+ self.assertEqual(entity['married'], True)
+ self.assertEqual(entity['deceased'], False)
+ self.assertFalse("optional" in entity)
+ self.assertFalse("aquarius" in entity)
+ self.assertEqual(entity['ratio'], 3.1)
+ self.assertEqual(entity['evenratio'], 3.0)
+ self.assertEqual(entity['large'], '933311100')
+ self.assertTrue(entity['Birthday'].startswith('1973-10-04T00:00:00'))
+ self.assertTrue(entity['birthday'].startswith('1970-10-04T00:00:00'))
+ self.assertTrue(entity['Birthday'].endswith('00Z'))
+ self.assertTrue(entity['birthday'].endswith('00Z'))
+ self.assertEqual(entity['binary'], b64encode(b'binary').decode('utf-8'))
+ self.assertIsInstance(entity['other'], EntityProperty)
+ self.assertEqual(entity['other'].type, EdmType.INT32)
+ self.assertEqual(entity['other'].value, 20)
+ self.assertEqual(entity['clsid'], 'c9da6455-213d-42c9-9a79-3e9149a57833')
+ # self.assertIsNone(entity.odata)
+ # self.assertIsNotNone(entity.Timestamp)
+
+ # self.assertIsInstance(entity.Timestamp, datetime)
+ # if headers:
+ # self.assertTrue("etag" in headers)
+ # self.assertIsNotNone(headers['etag'])
+
+ def _assert_updated_entity(self, entity):
+ '''
+ Asserts that the entity passed in matches the updated entity.
+ '''
+ self.assertEqual(entity.age, 'abc')
+ self.assertEqual(entity.sex, 'female')
+ self.assertFalse(hasattr(entity, "married"))
+ self.assertFalse(hasattr(entity, "deceased"))
+ self.assertEqual(entity.sign, 'aquarius')
+ self.assertFalse(hasattr(entity, "optional"))
+ self.assertFalse(hasattr(entity, "ratio"))
+ self.assertFalse(hasattr(entity, "evenratio"))
+ self.assertFalse(hasattr(entity, "large"))
+ self.assertFalse(hasattr(entity, "Birthday"))
+ # self.assertEqual(entity.birthday, "1991-10-04 00:00:00+00:00")
+ self.assertEqual(entity.birthday, datetime(1991, 10, 4, tzinfo=tzutc()))
+ self.assertFalse(hasattr(entity, "other"))
+ self.assertFalse(hasattr(entity, "clsid"))
+ # self.assertIsNotNone(entity.odata.etag)
+
+ # self.assertIsNotNone(entity.Timestamp)
+ # self.assertIsInstance(entity.timestamp, datetime)
+
+ def _assert_merged_entity(self, entity):
+ '''
+ Asserts that the entity passed in matches the default entity
+ merged with the updated entity.
+ '''
+ self.assertEqual(entity.age, 'abc')
+ self.assertEqual(entity.sex, 'female')
+ self.assertEqual(entity.sign, 'aquarius')
+ self.assertEqual(entity.married, True)
+ self.assertEqual(entity.deceased, False)
+ self.assertEqual(entity.sign, 'aquarius')
+ self.assertEqual(entity.ratio, 3.1)
+ self.assertEqual(entity.evenratio, 3.0)
+ self.assertEqual(entity.large, 933311100)
+ self.assertEqual(entity.Birthday, datetime(1973, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity.birthday, datetime(1991, 10, 4, tzinfo=tzutc()))
+ self.assertIsInstance(entity.other, EntityProperty)
+ self.assertEqual(entity.other.type, EdmType.INT32)
+ self.assertEqual(entity.other.value, 20)
+ self.assertIsInstance(entity.clsid, uuid.UUID)
+ self.assertEqual(str(entity.clsid), 'c9da6455-213d-42c9-9a79-3e9149a57833')
+ # self.assertIsNotNone(entity.etag)
+ # self.assertIsNotNone(entity.odata['etag'])
+ # self.assertIsNotNone(entity.Timestamp)
+ # self.assertIsInstance(entity.Timestamp, datetime)
+
+ # --Test cases for entities ------------------------------------------
+ @GlobalStorageAccountPreparer()
+ def test_insert_etag(self, resource_group, location, storage_account, storage_account_key):
+ self._set_up(storage_account, storage_account_key)
+
+ entity, _ = self._insert_random_entity()
+
+ entity1 = self.table.get_entity(row_key=entity.RowKey, partition_key=entity.PartitionKey)
+
+ with self.assertRaises(AttributeError):
+ etag = entity1.etag
+
+
+ self.assertIsNotNone(entity1.metadata())
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_user_filter(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._insert_random_entity()
+
+ # Act
+ # resp = self.table.create_item(entity)
+ resp = self.table.query_entities(filter="married eq @my_param", parameters={'my_param': 'True'})
+
+ # Assert --- Does this mean insert returns nothing?
+ self.assertIsNotNone(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_dictionary(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ # resp = self.table.create_item(entity)
+ resp = self.table.create_entity(entity=entity)
+
+ # Assert --- Does this mean insert returns nothing?
+ self.assertIsNotNone(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_with_hook(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ # , response_hook=lambda e, h: (e, h)
+ resp = self.table.create_entity(entity=entity)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self._assert_default_entity(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_with_no_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ # response_hook=lambda e, h: (e, h)
+ resp = self.table.create_entity(
+ entity=entity,
+ headers={'Accept': 'application/json;odata=nometadata'},
+ )
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self._assert_default_entity_json_no_metadata(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_with_full_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ # response_hook=lambda e, h: (e, h)
+ resp = self.table.create_entity(
+ entity=entity,
+ headers={'Accept': 'application/json;odata=fullmetadata'},
+ )
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self._assert_default_entity_json_full_metadata(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_conflict(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ with self.assertRaises(ResourceExistsError):
+ # self.table.create_item(entity)
+ self.table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_with_large_int32_value_throws(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ dict32 = self._create_random_base_entity_dict()
+ dict32['large'] = EntityProperty(EdmType.INT32, 2 ** 31)
+
+ # Assert
+ with self.assertRaises(TypeError):
+ self.table.create_entity(entity=dict32)
+
+ dict32['large'] = EntityProperty(EdmType.INT32, -(2 ** 31 + 1))
+ with self.assertRaises(TypeError):
+ self.table.create_entity(entity=dict32)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_with_large_int64_value_throws(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ dict64 = self._create_random_base_entity_dict()
+ dict64['large'] = EntityProperty(EdmType.INT64, 2 ** 63)
+
+ # Assert
+ with self.assertRaises(TypeError):
+ self.table.create_entity(entity=dict64)
+
+ dict64['large'] = EntityProperty(EdmType.INT64, -(2 ** 63 + 1))
+ with self.assertRaises(TypeError):
+ self.table.create_entity(entity=dict64)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_missing_pk(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = {'RowKey': 'rk'}
+
+ # Act
+ with self.assertRaises(ValueError):
+ # resp = self.table.create_item(entity)
+ resp = self.table.create_entity(entity=entity)
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_empty_string_pk(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = {'RowKey': 'rk', 'PartitionKey': ''}
+
+ # Act
+ if 'cosmos' in self.table.url:
+ with self.assertRaises(HttpResponseError):
+ self.table.create_entity(entity=entity)
+ else:
+ resp = self.table.create_entity(entity=entity)
+
+ # Assert
+ # self.assertIsNone(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_missing_rk(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = {'PartitionKey': 'pk'}
+
+ # Act
+ with self.assertRaises(ValueError):
+ resp = self.table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_empty_string_rk(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = {'PartitionKey': 'pk', 'RowKey': ''}
+
+ # Act
+ if 'cosmos' in self.table.url:
+ with self.assertRaises(HttpResponseError):
+ self.table.create_entity(entity=entity)
+ else:
+ resp = self.table.create_entity(entity=entity)
+
+ # Assert
+ # self.assertIsNone(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_too_many_properties(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ if 'cosmos' in self.table.url:
+ pytest.skip("Cosmos supports large number of properties.")
+ try:
+ entity = self._create_random_base_entity_dict()
+ for i in range(255):
+ entity['key{0}'.format(i)] = 'value{0}'.format(i)
+
+ # Act
+ with self.assertRaises(HttpResponseError):
+ resp = self.table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_entity_property_name_too_long(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ if 'cosmos' in self.table.url:
+ pytest.skip("Cosmos supports large property names.")
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity['a' * 256] = 'badval'
+
+ # Act
+ with self.assertRaises(HttpResponseError):
+ resp = self.table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_get_entity(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ resp = self.table.get_entity(partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'])
+
+ # Assert
+ self.assertEqual(resp['PartitionKey'], entity['PartitionKey'])
+ self.assertEqual(resp['RowKey'], entity['RowKey'])
+ self._assert_default_entity(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_get_entity_with_hook(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ # resp, headers
+ # response_hook=lambda e, h: (e, h)
+ resp = self.table.get_entity(
+ partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'],
+ )
+
+ # Assert
+ self.assertEqual(resp['PartitionKey'], entity['PartitionKey'])
+ self.assertEqual(resp['RowKey'], entity['RowKey'])
+ self._assert_default_entity(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_get_entity_if_match(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, etag = self._insert_random_entity()
+
+ # Act
+ # Do a get and confirm the etag is parsed correctly by using it
+ # as a condition to delete.
+ resp = self.table.get_entity(partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'])
+
+ self.table.delete_entity(
+ partition_key=resp['PartitionKey'],
+ row_key=resp['RowKey'],
+ etag=etag,
+ match_condition=MatchConditions.IfNotModified
+ )
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_get_entity_full_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ resp = self.table.get_entity(
+ entity.PartitionKey,
+ entity.RowKey,
+ headers={'accept': 'application/json;odata=fullmetadata'})
+
+ # Assert
+ self.assertEqual(resp.PartitionKey, entity.PartitionKey)
+ self.assertEqual(resp.RowKey, entity.RowKey)
+ self._assert_default_entity_json_full_metadata(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_get_entity_no_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ resp = self.table.get_entity(
+ partition_key=entity.PartitionKey,
+ row_key=entity.RowKey,
+ headers={'accept': 'application/json;odata=nometadata'})
+
+ # Assert
+ self.assertEqual(resp.PartitionKey, entity.PartitionKey)
+ self.assertEqual(resp.RowKey, entity.RowKey)
+ self._assert_default_entity_json_no_metadata(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_get_entity_not_existing(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ with self.assertRaises(ResourceNotFoundError):
+ self.table.get_entity(partition_key=entity.PartitionKey,
+ row_key=entity.RowKey)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_get_entity_with_special_doubles(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity.update({
+ 'inf': float('inf'),
+ 'negativeinf': float('-inf'),
+ 'nan': float('nan')
+ })
+ self.table.create_entity(entity=entity)
+
+ # Act
+ resp = self.table.get_entity(partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'])
+
+ # Assert
+ self.assertEqual(resp.inf, float('inf'))
+ self.assertEqual(resp.negativeinf, float('-inf'))
+ self.assertTrue(isnan(resp.nan))
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_update_entity(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+
+ # resp = self.table.update_item(sent_entity, response_hook=lambda e, h: h)
+ resp = self.table.update_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ # self.assertTrue(resp)
+ received_entity = self.table.get_entity(partition_key=entity.PartitionKey,
+ row_key=entity.RowKey)
+
+ self._assert_updated_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_update_entity_not_existing(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ with self.assertRaises(ResourceNotFoundError):
+ self.table.update_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_update_entity_with_if_matches(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, etag = self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ # , response_hook=lambda e, h: h)
+ self.table.update_entity(
+ mode=UpdateMode.REPLACE, entity=sent_entity, etag=etag,
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ # self.assertTrue(resp)
+ received_entity = self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ self._assert_updated_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_update_entity_with_if_doesnt_match(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ with self.assertRaises(HttpResponseError):
+ self.table.update_entity(
+ mode=UpdateMode.MERGE,
+ entity=sent_entity,
+ etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"',
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_or_merge_entity_with_existing_entity(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = self.table.upsert_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ self._assert_merged_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_or_merge_entity_with_non_existing_entity(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ resp = self.table.upsert_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = self.table.get_entity(entity['PartitionKey'],
+ entity['RowKey'])
+ self._assert_updated_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_or_replace_entity_with_existing_entity(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = self.table.upsert_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ # self.assertIsNone(resp)
+ received_entity = self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ self._assert_updated_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_insert_or_replace_entity_with_non_existing_entity(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ resp = self.table.upsert_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = self.table.get_entity(entity['PartitionKey'],
+ entity['RowKey'])
+ self._assert_updated_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_merge_entity(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = self.table.update_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ self._assert_merged_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_merge_entity_not_existing(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ with self.assertRaises(ResourceNotFoundError):
+ self.table.update_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_merge_entity_with_if_matches(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, etag = self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = self.table.update_entity(
+ mode=UpdateMode.MERGE,
+ entity=sent_entity,
+ etag=etag,
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ self._assert_merged_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_merge_entity_with_if_doesnt_match(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ with self.assertRaises(HttpResponseError):
+ self.table.update_entity(mode=UpdateMode.MERGE,
+ entity=sent_entity,
+ etag='W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"',
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_delete_entity(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ resp = self.table.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey)
+
+ # Assert
+ self.assertIsNone(resp)
+ with self.assertRaises(ResourceNotFoundError):
+ self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_delete_entity_not_existing(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ with self.assertRaises(ResourceNotFoundError):
+ self.table.delete_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_delete_entity_with_if_matches(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, etag = self._insert_random_entity()
+
+ # Act
+ resp = self.table.delete_entity(entity.PartitionKey, entity.RowKey, etag=etag,
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ self.assertIsNone(resp)
+ with self.assertRaises(ResourceNotFoundError):
+ self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_delete_entity_with_if_doesnt_match(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ with self.assertRaises(HttpResponseError):
+ self.table.delete_entity(
+ entity.PartitionKey, entity.RowKey,
+ etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"',
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_unicode_property_value(self, resource_group, location, storage_account, storage_account_key):
+ ''' regression test for github issue #57'''
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity1 = entity.copy()
+ entity1.update({'Description': u'ꀕ'})
+ entity2 = entity.copy()
+ entity2.update({'RowKey': 'test2', 'Description': 'ꀕ'})
+
+ # Act
+ self.table.create_entity(entity=entity1)
+ self.table.create_entity(entity=entity2)
+ entities = list(self.table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity['PartitionKey'])))
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ self.assertEqual(entities[0].Description, u'ꀕ')
+ self.assertEqual(entities[1].Description, u'ꀕ')
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_unicode_property_name(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity1 = entity.copy()
+ entity1.update({u'啊齄丂狛狜': u'ꀕ'})
+ entity2 = entity.copy()
+ entity2.update({'RowKey': 'test2', u'啊齄丂狛狜': 'hello'})
+
+ # Act
+ self.table.create_entity(entity=entity1)
+ self.table.create_entity(entity=entity2)
+ entities = list(self.table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity['PartitionKey'])))
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ self.assertEqual(entities[0][u'啊齄丂狛狜'], u'ꀕ')
+ self.assertEqual(entities[1][u'啊齄丂狛狜'], u'hello')
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_operations_on_entity_with_partition_key_having_single_quote(self, resource_group, location,
+ storage_account, storage_account_key):
+
+ # Arrange
+ partition_key_with_single_quote = "a''''b"
+ row_key_with_single_quote = "a''''b"
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity(pk=partition_key_with_single_quote, rk=row_key_with_single_quote)
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = self.table.upsert_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ # row key here only has 2 quotes
+ received_entity = self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ self._assert_updated_entity(received_entity)
+
+ # Act
+ sent_entity['newField'] = 'newFieldValue'
+ resp = self.table.update_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ self._assert_updated_entity(received_entity)
+ self.assertEqual(received_entity['newField'], 'newFieldValue')
+
+ # Act
+ resp = self.table.delete_entity(entity.PartitionKey, entity.RowKey)
+
+ # Assert
+ self.assertIsNone(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_empty_and_spaces_property_value(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity.update({
+ 'EmptyByte': '',
+ 'EmptyUnicode': u'',
+ 'SpacesOnlyByte': ' ',
+ 'SpacesOnlyUnicode': u' ',
+ 'SpacesBeforeByte': ' Text',
+ 'SpacesBeforeUnicode': u' Text',
+ 'SpacesAfterByte': 'Text ',
+ 'SpacesAfterUnicode': u'Text ',
+ 'SpacesBeforeAndAfterByte': ' Text ',
+ 'SpacesBeforeAndAfterUnicode': u' Text ',
+ })
+
+ # Act
+ self.table.create_entity(entity=entity)
+ resp = self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self.assertEqual(resp.EmptyByte, '')
+ self.assertEqual(resp.EmptyUnicode, u'')
+ self.assertEqual(resp.SpacesOnlyByte, ' ')
+ self.assertEqual(resp.SpacesOnlyUnicode, u' ')
+ self.assertEqual(resp.SpacesBeforeByte, ' Text')
+ self.assertEqual(resp.SpacesBeforeUnicode, u' Text')
+ self.assertEqual(resp.SpacesAfterByte, 'Text ')
+ self.assertEqual(resp.SpacesAfterUnicode, u'Text ')
+ self.assertEqual(resp.SpacesBeforeAndAfterByte, ' Text ')
+ self.assertEqual(resp.SpacesBeforeAndAfterUnicode, u' Text ')
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_none_property_value(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity.update({'NoneValue': None})
+
+ # Act
+ self.table.create_entity(entity=entity)
+ resp = self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self.assertFalse(hasattr(resp, 'NoneValue'))
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_binary_property_value(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ binary_data = b'\x01\x02\x03\x04\x05\x06\x07\x08\t\n'
+ entity = self._create_random_base_entity_dict()
+ entity.update({'binary': b'\x01\x02\x03\x04\x05\x06\x07\x08\t\n'})
+
+ # Act
+ self.table.create_entity(entity=entity)
+ resp = self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self.assertEqual(resp.binary.value, binary_data)
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_timezone(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ local_tz = tzoffset('BRST', -10800)
+ local_date = datetime(2003, 9, 27, 9, 52, 43, tzinfo=local_tz)
+ entity = self._create_random_base_entity_dict()
+ entity.update({'date': local_date})
+
+ # Act
+ self.table.create_entity(entity=entity)
+ resp = self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ self.assertIsNotNone(resp)
+ # times are not equal because request is made after
+ self.assertEqual(resp.date.astimezone(tzutc()), local_date.astimezone(tzutc()))
+ self.assertEqual(resp.date.astimezone(local_tz), local_date)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ table = self._create_query_table(2)
+
+ # Act
+ entities = list(table.list_entities())
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ for entity in entities:
+ self._assert_default_entity(entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_zero_entities(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ table = self._create_query_table(0)
+
+ # Act
+ entities = list(table.list_entities())
+
+ # Assert
+ self.assertEqual(len(entities), 0)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities_full_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ table = self._create_query_table(2)
+
+ # Act
+ entities = list(table.list_entities(headers={'accept': 'application/json;odata=fullmetadata'}))
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ for entity in entities:
+ self._assert_default_entity_json_full_metadata(entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities_no_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ table = self._create_query_table(2)
+
+ # Act
+ entities = list(table.list_entities(headers={'accept': 'application/json;odata=nometadata'}))
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ for entity in entities:
+ self._assert_default_entity_json_no_metadata(entity)
+ finally:
+ self._tear_down()
+
+ @pytest.mark.skip("Batch not implemented")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities_large(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ table_name = self._create_query_table(0)
+ total_entities_count = 1000
+ entities_per_batch = 50
+
+ for j in range(total_entities_count // entities_per_batch):
+ batch = TableBatch()
+ for i in range(entities_per_batch):
+ entity = Entity()
+ entity.PartitionKey = 'large'
+ entity.RowKey = 'batch{0}-item{1}'.format(j, i)
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'hello world;' * 100
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime(2016, 12, 31, 11, 59, 59, 0)
+ batch.create_entity(entity)
+ self.ts.commit_batch(table_name, batch)
+
+ # Act
+ start_time = datetime.now()
+ entities = list(self.ts.query_entities(table_name))
+ elapsed_time = datetime.now() - start_time
+
+ # Assert
+ print('query_entities took {0} secs.'.format(elapsed_time.total_seconds()))
+ # azure allocates 5 seconds to execute a query
+ # if it runs slowly, it will return fewer results and make the test fail
+ self.assertEqual(len(entities), total_entities_count)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities_with_filter(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = self._insert_random_entity()
+
+ # Act
+ entities = list(self.table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity.PartitionKey)))
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ self.assertEqual(entity.PartitionKey, entities[0].PartitionKey)
+ self._assert_default_entity(entities[0])
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities_with_select(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ table = self._create_query_table(2)
+
+ # Act
+ entities = list(table.list_entities(select=['age', 'sex']))
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ self.assertEqual(entities[0].age, 39)
+ self.assertEqual(entities[0].sex, 'male')
+ self.assertFalse(hasattr(entities[0], "birthday"))
+ self.assertFalse(hasattr(entities[0], "married"))
+ self.assertFalse(hasattr(entities[0], "deceased"))
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities_with_top(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ table = self._create_query_table(3)
+ # circular dependencies made this return a list not an item paged - problem when calling by page
+ # Act
+ entities = list(next(table.list_entities(results_per_page=2).by_page()))
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities_with_top_and_next(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ self._set_up(storage_account, storage_account_key)
+ try:
+ table = self._create_query_table(5)
+
+ # Act
+ resp1 = table.list_entities(results_per_page=2).by_page()
+ next(resp1)
+ resp2 = table.list_entities(results_per_page=2).by_page(
+ continuation_token=resp1.continuation_token)
+ next(resp2)
+ resp3 = table.list_entities(results_per_page=2).by_page(
+ continuation_token=resp2.continuation_token)
+ next(resp3)
+
+ entities1 = resp1._current_page
+ entities2 = resp2._current_page
+ entities3 = resp3._current_page
+
+ # Assert
+ self.assertEqual(len(entities1), 2)
+ self.assertEqual(len(entities2), 2)
+ self.assertEqual(len(entities3), 1)
+ self._assert_default_entity(entities1[0])
+ self._assert_default_entity(entities1[1])
+ self._assert_default_entity(entities2[0])
+ self._assert_default_entity(entities2[1])
+ self._assert_default_entity(entities3[0])
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_sas_query(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = self._insert_random_entity()
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(read=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ entities = list(table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity['PartitionKey'])))
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ self._assert_default_entity(entities[0])
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_sas_add(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(add=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+
+ entity = self._create_random_entity_dict()
+ table.create_entity(entity=entity)
+
+ # Assert
+ resp = self.table.get_entity(partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'])
+ self._assert_default_entity(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_sas_add_inside_range(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(add=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start_pk='test', start_rk='test1',
+ end_pk='test', end_rk='test1',
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ entity = self._create_random_entity_dict('test', 'test1')
+ table.create_entity(entity=entity)
+
+ # Assert
+ resp = self.table.get_entity('test', 'test1')
+ self._assert_default_entity(resp)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_sas_add_outside_range(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(add=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start_pk='test', start_rk='test1',
+ end_pk='test', end_rk='test1',
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ with self.assertRaises(HttpResponseError):
+ entity = self._create_random_entity_dict()
+ table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_sas_update(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = self._insert_random_entity()
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(update=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ updated_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ table.update_entity(mode=UpdateMode.REPLACE, entity=updated_entity)
+
+ # Assert
+ received_entity = self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ self._assert_updated_entity(received_entity)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_sas_delete(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = self._insert_random_entity()
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(delete=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ table.delete_entity(entity.PartitionKey, entity.RowKey)
+
+ # Assert
+ with self.assertRaises(ResourceNotFoundError):
+ self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_sas_upper_case_table_name(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = self._insert_random_entity()
+
+ # Table names are case insensitive, so simply upper case our existing table name to test
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name.upper(),
+ permission=TableSasPermissions(read=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ entities = list(table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity['PartitionKey'])))
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ self._assert_default_entity(entities[0])
+ finally:
+ self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ def test_sas_signed_identifier(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = self._insert_random_entity()
+
+ access_policy = AccessPolicy()
+ access_policy.start = datetime(2011, 10, 11)
+ access_policy.expiry = datetime(2020, 10, 12)
+ access_policy.permission = TableSasPermissions(read=True)
+ identifiers = {'testid': access_policy}
+
+ self.table.set_table_access_policy(identifiers)
+
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ policy_id='testid',
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ entities = list(table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity.PartitionKey)))
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ self._assert_default_entity(entities[0])
+ finally:
+ self._tear_down()
+
+
+# ------------------------------------------------------------------------------
+if __name__ == '__main__':
+ unittest.main()
diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py
new file mode 100644
index 000000000000..e6b6272e7250
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py
@@ -0,0 +1,1731 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+
+import unittest
+
+import pytest
+
+import uuid
+from base64 import b64encode
+from datetime import datetime, timedelta
+
+from azure.data.tables import generate_table_sas
+from azure.data.tables._generated.models import QueryOptions
+from azure.data.tables.aio import TableServiceClient
+from dateutil.tz import tzutc, tzoffset
+from math import isnan
+
+from azure.core import MatchConditions
+from azure.core.exceptions import (
+ HttpResponseError,
+ ResourceNotFoundError,
+ ResourceExistsError)
+
+from azure.data.tables._entity import TableEntity, EntityProperty, EdmType
+from azure.data.tables import TableSasPermissions, AccessPolicy, UpdateMode
+
+from _shared.testcase import GlobalStorageAccountPreparer, TableTestCase, LogCaptured
+
+
+# ------------------------------------------------------------------------------
+
+# ------------------------------------------------------------------------------
+
+class StorageTableEntityTest(TableTestCase):
+
+ async def _set_up(self, storage_account, storage_account_key):
+ self.ts = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ self.table_name = self.get_resource_name('uttable')
+ self.table = self.ts.get_table_client(self.table_name)
+ if self.is_live:
+ try:
+ await self.ts.create_table(table_name=self.table_name)
+ except ResourceExistsError:
+ pass
+
+ self.query_tables = []
+
+ async def _tear_down(self):
+ if self.is_live:
+ try:
+ await self.ts.delete_table(self.table_name)
+ except:
+ pass
+
+ for table_name in self.query_tables:
+ try:
+ await self.ts.delete_table(table_name)
+ except:
+ pass
+
+ # --Helpers-----------------------------------------------------------------
+
+ async def _create_query_table(self, entity_count):
+ """
+ Creates a table with the specified name and adds entities with the
+ default set of values. PartitionKey is set to 'MyPartition' and RowKey
+ is set to a unique counter value starting at 1 (as a string).
+ """
+ table_name = self.get_resource_name('querytable')
+ table = await self.ts.create_table(table_name)
+ self.query_tables.append(table_name)
+ client = self.ts.get_table_client(table_name)
+ entity = self._create_random_entity_dict()
+ for i in range(1, entity_count + 1):
+ entity['RowKey'] = entity['RowKey'] + str(i)
+ await client.create_entity(entity=entity)
+ # with self.ts.batch(table_name) as batch:
+ # for i in range(1, entity_count + 1):
+ # entity['RowKey'] = entity['RowKey'] + str(i)
+ # batch.create_entity(entity)
+ return client
+
+ def _create_random_base_entity_dict(self):
+ """
+ Creates a dict-based entity with only pk and rk.
+ """
+ partition = self.get_resource_name('pk')
+ row = self.get_resource_name('rk')
+ return {
+ 'PartitionKey': partition,
+ 'RowKey': row,
+ }
+
+ def _create_random_entity_dict(self, pk=None, rk=None):
+ """
+ Creates a dictionary-based entity with fixed values, using all
+ of the supported data types.
+ """
+ partition = pk if pk is not None else self.get_resource_name('pk')
+ row = rk if rk is not None else self.get_resource_name('rk')
+ properties = {
+ 'PartitionKey': partition,
+ 'RowKey': row,
+ 'age': 39,
+ 'sex': 'male',
+ 'married': True,
+ 'deceased': False,
+ 'optional': None,
+ 'ratio': 3.1,
+ 'evenratio': 3.0,
+ 'large': 933311100,
+ 'Birthday': datetime(1973, 10, 4, tzinfo=tzutc()),
+ 'birthday': datetime(1970, 10, 4, tzinfo=tzutc()),
+ 'binary': b'binary',
+ 'other': EntityProperty(type=EdmType.INT32, value=20),
+ 'clsid': uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833')
+ }
+ return TableEntity(**properties)
+
+ async def _insert_random_entity(self, pk=None, rk=None):
+ entity = self._create_random_entity_dict(pk, rk)
+ # , response_hook=lambda e, h: h['etag']
+ e = await self.table.create_entity(entity=entity)
+ metadata = e.metadata()
+ # etag = e['etag']
+ return entity, metadata['etag']
+
+ def _create_updated_entity_dict(self, partition, row):
+ """
+ Creates a dictionary-based entity with fixed values, with a
+ different set of values than the default entity. It
+ adds fields, changes field values, changes field types,
+ and removes fields when compared to the default entity.
+ """
+ return {
+ 'PartitionKey': partition,
+ 'RowKey': row,
+ 'age': 'abc',
+ 'sex': 'female',
+ 'sign': 'aquarius',
+ 'birthday': datetime(1991, 10, 4, tzinfo=tzutc())
+ }
+
+ def _assert_default_entity(self, entity, headers=None):
+ '''
+ Asserts that the entity passed in matches the default entity.
+ '''
+ self.assertEqual(entity['age'], 39)
+ self.assertEqual(entity['sex'], 'male')
+ self.assertEqual(entity['married'], True)
+ self.assertEqual(entity['deceased'], False)
+ self.assertFalse("optional" in entity)
+ self.assertFalse("aquarius" in entity)
+ self.assertEqual(entity['ratio'], 3.1)
+ self.assertEqual(entity['evenratio'], 3.0)
+ self.assertEqual(entity['large'], 933311100)
+ self.assertEqual(entity['Birthday'], datetime(1973, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['birthday'], datetime(1970, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['binary'].value, b'binary') # TODO: added the ".value" portion, verify this is correct
+ self.assertIsInstance(entity['other'], EntityProperty)
+ self.assertEqual(entity['other'].type, EdmType.INT32)
+ self.assertEqual(entity['other'].value, 20)
+ self.assertEqual(entity['clsid'], uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833'))
+ # self.assertTrue('metadata' in entity.odata)
+
+ # TODO: these are commented out / nonexistent in sync code, should we have them?
+ # self.assertIsNotNone(entity.Timestamp)
+ # self.assertIsInstance(entity.Timestamp, datetime)
+ if headers:
+ self.assertTrue("etag" in headers)
+ self.assertIsNotNone(headers['etag'])
+
+ def _assert_default_entity_json_full_metadata(self, entity, headers=None):
+ '''
+ Asserts that the entity passed in matches the default entity.
+ '''
+ self.assertEqual(entity['age'], 39)
+ self.assertEqual(entity['sex'], 'male')
+ self.assertEqual(entity['married'], True)
+ self.assertEqual(entity['deceased'], False)
+ self.assertFalse("optional" in entity)
+ self.assertFalse("aquarius" in entity)
+ self.assertEqual(entity['ratio'], 3.1)
+ self.assertEqual(entity['evenratio'], 3.0)
+ self.assertEqual(entity['large'], 933311100)
+ self.assertEqual(entity['Birthday'], datetime(1973, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['birthday'], datetime(1970, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity['binary'].value, b'binary')
+ self.assertIsInstance(entity['other'], EntityProperty)
+ self.assertEqual(entity['other'].type, EdmType.INT32)
+ self.assertEqual(entity['other'].value, 20)
+ self.assertEqual(entity['clsid'], uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833'))
+ # self.assertTrue('metadata' in entity.odata)
+ # self.assertTrue('id' in entity.odata)
+ # self.assertTrue('type' in entity.odata)
+ # self.assertTrue('etag' in entity.odata)
+ # self.assertTrue('editLink' in entity.odata)
+
+ # TODO: commented out in sync, should we have these?
+ # self.assertIsNotNone(entity.Timestamp)
+ # self.assertIsInstance(entity.Timestamp, datetime)
+ # if headers:
+ # self.assertTrue("etag" in headers)
+ # self.assertIsNotNone(headers['etag'])
+
+ def _assert_default_entity_json_no_metadata(self, entity, headers=None):
+ '''
+ Asserts that the entity passed in matches the default entity.
+ '''
+ self.assertEqual(entity['age'], '39')
+ self.assertEqual(entity['sex'], 'male')
+ self.assertEqual(entity['married'], True)
+ self.assertEqual(entity['deceased'], False)
+ self.assertFalse("optional" in entity)
+ self.assertFalse("aquarius" in entity)
+ self.assertEqual(entity['ratio'], 3.1)
+ self.assertEqual(entity['evenratio'], 3.0)
+ self.assertEqual(entity['large'], '933311100')
+ self.assertTrue(entity['Birthday'].startswith('1973-10-04T00:00:00'))
+ self.assertTrue(entity['birthday'].startswith('1970-10-04T00:00:00'))
+ self.assertTrue(entity['Birthday'].endswith('00Z'))
+ self.assertTrue(entity['birthday'].endswith('00Z'))
+ self.assertEqual(entity['binary'], b64encode(b'binary').decode('utf-8'))
+ self.assertIsInstance(entity['other'], EntityProperty)
+ self.assertEqual(entity['other'].type, EdmType.INT32)
+ self.assertEqual(entity['other'].value, 20)
+ self.assertEqual(entity['clsid'], 'c9da6455-213d-42c9-9a79-3e9149a57833')
+ # self.assertIsNone(entity.odata)
+ # self.assertIsNotNone(entity.Timestamp)
+ # self.assertIsInstance(entity.Timestamp, datetime)
+ if headers:
+ self.assertTrue("etag" in headers)
+ self.assertIsNotNone(headers['etag'])
+
+ def _assert_updated_entity(self, entity):
+ '''
+ Asserts that the entity passed in matches the updated entity.
+ '''
+ self.assertEqual(entity.age, 'abc')
+ self.assertEqual(entity.sex, 'female')
+ self.assertFalse(hasattr(entity, "married"))
+ self.assertFalse(hasattr(entity, "deceased"))
+ self.assertEqual(entity.sign, 'aquarius')
+ self.assertFalse(hasattr(entity, "optional"))
+ self.assertFalse(hasattr(entity, "ratio"))
+ self.assertFalse(hasattr(entity, "evenratio"))
+ self.assertFalse(hasattr(entity, "large"))
+ self.assertFalse(hasattr(entity, "Birthday"))
+ # self.assertEqual(entity.birthday, "1991-10-04 00:00:00+00:00")
+ self.assertEqual(entity.birthday, datetime(1991, 10, 4, tzinfo=tzutc()))
+ self.assertFalse(hasattr(entity, "other"))
+ self.assertFalse(hasattr(entity, "clsid"))
+ # TODO: should these all be commented out?
+ # self.assertIsNotNone(entity.odata.etag)
+ # self.assertIsNotNone(entity.Timestamp)
+ # self.assertIsInstance(entity.timestamp, datetime)
+
+ def _assert_merged_entity(self, entity):
+ '''
+ Asserts that the entity passed in matches the default entity
+ merged with the updated entity.
+ '''
+ self.assertEqual(entity.age, 'abc')
+ self.assertEqual(entity.sex, 'female')
+ self.assertEqual(entity.sign, 'aquarius')
+ self.assertEqual(entity.married, True)
+ self.assertEqual(entity.deceased, False)
+ self.assertEqual(entity.sign, 'aquarius')
+ self.assertEqual(entity.ratio, 3.1)
+ self.assertEqual(entity.evenratio, 3.0)
+ self.assertEqual(entity.large, 933311100)
+ self.assertEqual(entity.Birthday, datetime(1973, 10, 4, tzinfo=tzutc()))
+ self.assertEqual(entity.birthday, datetime(1991, 10, 4, tzinfo=tzutc()))
+ self.assertIsInstance(entity.other, EntityProperty)
+ self.assertEqual(entity.other.type, EdmType.INT32)
+ self.assertEqual(entity.other.value, 20)
+ self.assertIsInstance(entity.clsid, uuid.UUID)
+ self.assertEqual(str(entity.clsid), 'c9da6455-213d-42c9-9a79-3e9149a57833')
+ # TODO: should these all be commented out?
+ # self.assertIsNotNone(entity.etag)
+ # self.assertIsNotNone(entity.odata['etag'])
+ # self.assertIsNotNone(entity.Timestamp)
+ # self.assertIsInstance(entity.Timestamp, datetime)
+
+ # --Test cases for entities ------------------------------------------
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_dictionary(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ # resp = self.table.create_item(entity)
+ resp = await self.table.create_entity(entity=entity)
+
+ # Assert --- Does this mean insert returns nothing?
+ self.assertIsNotNone(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_with_hook(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ # , response_hook = lambda e, h: (e, h)
+ resp = await self.table.create_entity(entity=entity)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self._assert_default_entity(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_with_no_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ # response_hook = lambda e, h: (e, h)
+ resp = await self.table.create_entity(
+ entity=entity,
+ headers={'Accept': 'application/json;odata=nometadata'},
+ )
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self._assert_default_entity_json_no_metadata(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_with_full_metadata(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ # response_hook=lambda e, h: (e, h)
+ resp = await self.table.create_entity(
+ entity=entity,
+ headers={'Accept': 'application/json;odata=fullmetadata'},)
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self._assert_default_entity_json_full_metadata(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_conflict(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ with self.assertRaises(ResourceExistsError):
+ # self.table.create_item(entity)
+ await self.table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_with_large_int32_value_throws(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ dict32 = self._create_random_base_entity_dict()
+ dict32['large'] = EntityProperty(EdmType.INT32, 2 ** 31)
+
+ # Assert
+ with self.assertRaises(TypeError):
+ await self.table.create_entity(entity=dict32)
+
+ dict32['large'] = EntityProperty(EdmType.INT32, -(2 ** 31 + 1))
+ with self.assertRaises(TypeError):
+ await self.table.create_entity(entity=dict32)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_with_large_int64_value_throws(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Act
+ dict64 = self._create_random_base_entity_dict()
+ dict64['large'] = EntityProperty(EdmType.INT64, 2 ** 63)
+
+ # Assert
+ with self.assertRaises(TypeError):
+ await self.table.create_entity(entity=dict64)
+
+ dict64['large'] = EntityProperty(EdmType.INT64, -(2 ** 63 + 1))
+ with self.assertRaises(TypeError):
+ await self.table.create_entity(entity=dict64)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_missing_pk(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = {'RowKey': 'rk'}
+
+ # Act
+ with self.assertRaises(ValueError):
+ # resp = self.table.create_item(entity)
+ resp = await self.table.create_entity(entity=entity)
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_empty_string_pk(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = {'RowKey': 'rk', 'PartitionKey': ''}
+
+ # Act
+ if 'cosmos' in self.table.url:
+ with self.assertRaises(HttpResponseError):
+ await self.table.create_entity(entity=entity)
+ else:
+ resp = await self.table.create_entity(entity=entity)
+
+ # Assert
+ # self.assertIsNone(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_missing_rk(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = {'PartitionKey': 'pk'}
+
+ # Act
+ with self.assertRaises(ValueError):
+ resp = await self.table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_empty_string_rk(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = {'PartitionKey': 'pk', 'RowKey': ''}
+
+ # Act
+ if 'cosmos' in self.table.url:
+ with self.assertRaises(HttpResponseError):
+ await self.table.create_entity(entity=entity)
+ else:
+ resp = await self.table.create_entity(entity=entity)
+
+ # Assert
+ # self.assertIsNone(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_too_many_properties(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ if 'cosmos' in self.table.url:
+ pytest.skip("Cosmos supports large number of properties.")
+ try:
+ entity = self._create_random_base_entity_dict()
+ for i in range(255):
+ entity['key{0}'.format(i)] = 'value{0}'.format(i)
+
+ # Act
+ with self.assertRaises(HttpResponseError):
+ resp = await self.table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_entity_property_name_too_long(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ if 'cosmos' in self.table.url:
+ pytest.skip("Cosmos supports large property names.")
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity['a' * 256] = 'badval'
+
+ # Act
+ with self.assertRaises(HttpResponseError):
+ resp = await self.table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_get_entity(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ resp = await self.table.get_entity(partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'])
+
+ # Assert
+ self.assertEqual(resp['PartitionKey'], entity['PartitionKey'])
+ self.assertEqual(resp['RowKey'], entity['RowKey'])
+ self._assert_default_entity(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_get_entity_with_hook(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ # resp, headers
+ # response_hook=lambda e, h: (e, h)
+ resp = await self.table.get_entity(
+ partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'],
+ )
+
+ # Assert
+ self.assertEqual(resp['PartitionKey'], entity['PartitionKey'])
+ self.assertEqual(resp['RowKey'], entity['RowKey'])
+ self._assert_default_entity(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_get_entity_if_match(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, etag = await self._insert_random_entity()
+
+ # Act
+ # Do a get and confirm the etag is parsed correctly by using it
+ # as a condition to delete.
+ resp = await self.table.get_entity(partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'])
+
+ await self.table.delete_entity(
+ partition_key=resp['PartitionKey'],
+ row_key=resp['RowKey'],
+ etag=etag,
+ match_condition=MatchConditions.IfNotModified
+ )
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_get_entity_full_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ resp = await self.table.get_entity(
+ entity.PartitionKey,
+ entity.RowKey,
+ headers={'accept': 'application/json;odata=fullmetadata'})
+
+ # Assert
+ self.assertEqual(resp.PartitionKey, entity.PartitionKey)
+ self.assertEqual(resp.RowKey, entity.RowKey)
+ self._assert_default_entity_json_full_metadata(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_get_entity_no_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ resp = await self.table.get_entity(
+ partition_key=entity.PartitionKey,
+ row_key=entity.RowKey,
+ headers={'accept': 'application/json;odata=nometadata'})
+
+ # Assert
+ self.assertEqual(resp.PartitionKey, entity.PartitionKey)
+ self.assertEqual(resp.RowKey, entity.RowKey)
+ self._assert_default_entity_json_no_metadata(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_get_entity_not_existing(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_entity_dict()
+
+ # Act
+ with self.assertRaises(ResourceNotFoundError):
+ await self.table.get_entity(partition_key=entity.PartitionKey,
+ row_key=entity.RowKey)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_get_entity_with_special_doubles(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity.update({
+ 'inf': float('inf'),
+ 'negativeinf': float('-inf'),
+ 'nan': float('nan')
+ })
+ await self.table.create_entity(entity=entity)
+
+ # Act
+ resp = await self.table.get_entity(partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'])
+
+ # Assert
+ self.assertEqual(resp.inf, float('inf'))
+ self.assertEqual(resp.negativeinf, float('-inf'))
+ self.assertTrue(isnan(resp.nan))
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_update_entity(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+
+ # resp = self.table.update_item(sent_entity, response_hook=lambda e, h: h)
+ resp = await self.table.update_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ # self.assertTrue(resp)
+ received_entity = await self.table.get_entity(
+ partition_key=entity.PartitionKey,
+ row_key=entity.RowKey)
+
+ self._assert_updated_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_update_entity_not_existing(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ with self.assertRaises(ResourceNotFoundError):
+ await self.table.update_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_update_entity_with_if_matches(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, etag = await self._insert_random_entity()
+
+ # Act
+ #, response_hook=lambda e, h: h)
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ await self.table.update_entity(
+ mode=UpdateMode.REPLACE,
+ entity=sent_entity, etag=etag,
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ # self.assertTrue(resp)
+ received_entity = await self.table.get_entity(entity.PartitionKey,
+ entity.RowKey)
+ self._assert_updated_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_update_entity_with_if_doesnt_match(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ with self.assertRaises(HttpResponseError):
+ await self.table.update_entity(
+ mode=UpdateMode.REPLACE,
+ entity=sent_entity,
+ etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"',
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_or_merge_entity_with_existing_entity(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = await self.table.upsert_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = await self.table.get_entity(entity.PartitionKey,
+ entity.RowKey)
+ self._assert_merged_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_or_merge_entity_with_non_existing_entity(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ resp = await self.table.upsert_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = await self.table.get_entity(entity['PartitionKey'],
+ entity['RowKey'])
+ self._assert_updated_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_or_replace_entity_with_existing_entity(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = await self.table.upsert_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ # self.assertIsNone(resp)
+ received_entity = await self.table.get_entity(entity.PartitionKey,
+ entity.RowKey)
+ self._assert_updated_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_insert_or_replace_entity_with_non_existing_entity(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ resp = await self.table.upsert_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = await self.table.get_entity(entity['PartitionKey'],
+ entity['RowKey'])
+ self._assert_updated_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_merge_entity(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = await self.table.update_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = await self.table.get_entity(entity.PartitionKey,
+ entity.RowKey)
+ self._assert_merged_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_merge_entity_not_existing(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity['PartitionKey'], entity['RowKey'])
+ with self.assertRaises(ResourceNotFoundError):
+ await self.table.update_entity(mode=UpdateMode.MERGE, entity=sent_entity)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_merge_entity_with_if_matches(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, etag = await self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = await self.table.update_entity(mode=UpdateMode.MERGE,
+ entity=sent_entity, etag=etag,
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = await self.table.get_entity(entity.PartitionKey,
+ entity.RowKey)
+ self._assert_merged_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_merge_entity_with_if_doesnt_match(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ with self.assertRaises(HttpResponseError):
+ await self.table.update_entity(mode=UpdateMode.MERGE,
+ entity=sent_entity,
+ etag='W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"',
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_delete_entity(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ resp = await self.table.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey)
+
+ # Assert
+ self.assertIsNone(resp)
+ with self.assertRaises(ResourceNotFoundError):
+ await self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_delete_entity_not_existing(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+
+ # Act
+ with self.assertRaises(ResourceNotFoundError):
+ await self.table.delete_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_delete_entity_with_if_matches(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, etag = await self._insert_random_entity()
+
+ # Act
+ resp = await self.table.delete_entity(entity.PartitionKey, entity.RowKey, etag=etag,
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ self.assertIsNone(resp)
+ with self.assertRaises(ResourceNotFoundError):
+ await self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_delete_entity_with_if_doesnt_match(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ with self.assertRaises(HttpResponseError):
+ await self.table.delete_entity(
+ entity.PartitionKey, entity.RowKey,
+ etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"',
+ match_condition=MatchConditions.IfNotModified)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_unicode_property_value(self, resource_group, location, storage_account, storage_account_key):
+ ''' regression test for github issue #57'''
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity1 = entity.copy()
+ entity1.update({'Description': u'ꀕ'})
+ entity2 = entity.copy()
+ entity2.update({'RowKey': 'test2', 'Description': 'ꀕ'})
+
+ # Act
+ await self.table.create_entity(entity=entity1)
+ await self.table.create_entity(entity=entity2)
+ entities = []
+ async for e in self.table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity['PartitionKey'])):
+ entities.append(e)
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ self.assertEqual(entities[0].Description, u'ꀕ')
+ self.assertEqual(entities[1].Description, u'ꀕ')
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_unicode_property_name(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity1 = entity.copy()
+ entity1.update({u'啊齄丂狛狜': u'ꀕ'})
+ entity2 = entity.copy()
+ entity2.update({'RowKey': 'test2', u'啊齄丂狛狜': 'hello'})
+
+ # Act
+ await self.table.create_entity(entity=entity1)
+ await self.table.create_entity(entity=entity2)
+ entities = []
+ async for e in self.table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity['PartitionKey'])):
+ entities.append(e)
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ self.assertEqual(entities[0][u'啊齄丂狛狜'], u'ꀕ')
+ self.assertEqual(entities[1][u'啊齄丂狛狜'], u'hello')
+ finally:
+ await self._tear_down()
+
+ @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_operations_on_entity_with_partition_key_having_single_quote(self, resource_group, location,
+ storage_account, storage_account_key):
+
+ # Arrange
+ partition_key_with_single_quote = "a''''b"
+ row_key_with_single_quote = "a''''b"
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity(pk=partition_key_with_single_quote,
+ rk=row_key_with_single_quote)
+
+ # Act
+ sent_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ resp = await self.table.upsert_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ # row key here only has 2 quotes
+ received_entity = await self.table.get_entity(
+ entity.PartitionKey, entity.RowKey)
+ self._assert_updated_entity(received_entity)
+
+ # Act
+ sent_entity['newField'] = 'newFieldValue'
+ resp = await self.table.update_entity(mode=UpdateMode.REPLACE, entity=sent_entity)
+
+ # Assert
+ self.assertIsNone(resp)
+ received_entity = await self.table.get_entity(
+ entity.PartitionKey, entity.RowKey)
+ self._assert_updated_entity(received_entity)
+ self.assertEqual(received_entity['newField'], 'newFieldValue')
+
+ # Act
+ resp = await self.table.delete_entity(entity.PartitionKey, entity.RowKey)
+
+ # Assert
+ self.assertIsNone(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_empty_and_spaces_property_value(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity.update({
+ 'EmptyByte': '',
+ 'EmptyUnicode': u'',
+ 'SpacesOnlyByte': ' ',
+ 'SpacesOnlyUnicode': u' ',
+ 'SpacesBeforeByte': ' Text',
+ 'SpacesBeforeUnicode': u' Text',
+ 'SpacesAfterByte': 'Text ',
+ 'SpacesAfterUnicode': u'Text ',
+ 'SpacesBeforeAndAfterByte': ' Text ',
+ 'SpacesBeforeAndAfterUnicode': u' Text ',
+ })
+
+ # Act
+ await self.table.create_entity(entity=entity)
+ resp = await self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self.assertEqual(resp.EmptyByte, '')
+ self.assertEqual(resp.EmptyUnicode, u'')
+ self.assertEqual(resp.SpacesOnlyByte, ' ')
+ self.assertEqual(resp.SpacesOnlyUnicode, u' ')
+ self.assertEqual(resp.SpacesBeforeByte, ' Text')
+ self.assertEqual(resp.SpacesBeforeUnicode, u' Text')
+ self.assertEqual(resp.SpacesAfterByte, 'Text ')
+ self.assertEqual(resp.SpacesAfterUnicode, u'Text ')
+ self.assertEqual(resp.SpacesBeforeAndAfterByte, ' Text ')
+ self.assertEqual(resp.SpacesBeforeAndAfterUnicode, u' Text ')
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_none_property_value(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity = self._create_random_base_entity_dict()
+ entity.update({'NoneValue': None})
+
+ # Act
+ await self.table.create_entity(entity=entity)
+ resp = await self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self.assertFalse(hasattr(resp, 'NoneValue'))
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_binary_property_value(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ binary_data = b'\x01\x02\x03\x04\x05\x06\x07\x08\t\n'
+ entity = self._create_random_base_entity_dict()
+ entity.update({'binary': b'\x01\x02\x03\x04\x05\x06\x07\x08\t\n'})
+
+ # Act
+ await self.table.create_entity(entity=entity)
+ resp = await self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ self.assertIsNotNone(resp)
+ self.assertEqual(resp.binary.value, binary_data)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_timezone(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ local_tz = tzoffset('BRST', -10800)
+ local_date = datetime(2003, 9, 27, 9, 52, 43, tzinfo=local_tz)
+ entity = self._create_random_base_entity_dict()
+ entity.update({'date': local_date})
+
+ # Act
+ await self.table.create_entity(entity=entity)
+ resp = await self.table.get_entity(entity['PartitionKey'], entity['RowKey'])
+
+ # Assert
+ self.assertIsNotNone(resp)
+ # times are not equal because request is made after
+ # self.assertEqual(resp.date.astimezone(tzutc()), local_date.astimezone(tzutc()))
+ # self.assertEqual(resp.date.astimezone(local_tz), local_date)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_entities(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ table = await self._create_query_table(2)
+
+ # Act
+ entities = []
+ async for t in table.list_entities():
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ for entity in entities:
+ self._assert_default_entity(entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_zero_entities(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ table = await self._create_query_table(0)
+
+ # Act
+ entities = []
+ async for t in table.list_entities():
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 0)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_entities_full_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ table = await self._create_query_table(2)
+
+ # Act
+ entities = []
+ async for t in table.list_entities(headers={'accept': 'application/json;odata=fullmetadata'}):
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ for entity in entities:
+ self._assert_default_entity_json_full_metadata(entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_entities_no_metadata(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ table = await self._create_query_table(2)
+
+ # Act
+ entities = []
+ async for t in table.list_entities(headers={'accept': 'application/json;odata=nometadata'}):
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ for entity in entities:
+ self._assert_default_entity_json_no_metadata(entity)
+ finally:
+ await self._tear_down()
+
+ @pytest.mark.skip("Batch not implemented")
+ @GlobalStorageAccountPreparer()
+ def test_query_entities_large(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ table_name = self._create_query_table(0)
+ total_entities_count = 1000
+ entities_per_batch = 50
+
+ for j in range(total_entities_count // entities_per_batch):
+ batch = TableBatch()
+ for i in range(entities_per_batch):
+ entity = TableEntity()
+ entity.PartitionKey = 'large'
+ entity.RowKey = 'batch{0}-item{1}'.format(j, i)
+ entity.test = EntityProperty(EdmType.BOOLEAN, 'true')
+ entity.test2 = 'hello world;' * 100
+ entity.test3 = 3
+ entity.test4 = EntityProperty(EdmType.INT64, '1234567890')
+ entity.test5 = datetime(2016, 12, 31, 11, 59, 59, 0)
+ batch.create_entity(entity)
+ self.ts.commit_batch(table_name, batch)
+
+ # Act
+ start_time = datetime.now()
+ entities = list(self.ts.query_entities(table_name))
+ elapsed_time = datetime.now() - start_time
+
+ # Assert
+ print('query_entities took {0} secs.'.format(elapsed_time.total_seconds()))
+ # azure allocates 5 seconds to execute a query
+ # if it runs slowly, it will return fewer results and make the test fail
+ self.assertEqual(len(entities), total_entities_count)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_entities_with_filter(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ entity, _ = await self._insert_random_entity()
+
+ # Act
+ entities = []
+ async for t in self.table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity.PartitionKey)):
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ self.assertEqual(entity.PartitionKey, entities[0].PartitionKey)
+ self._assert_default_entity(entities[0])
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_entities_with_select(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ table = await self._create_query_table(2)
+
+ # Act
+ entities = []
+ async for t in table.list_entities(select=["age, sex"]):
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ self.assertEqual(entities[0].age, 39)
+ self.assertEqual(entities[0].sex, 'male')
+ self.assertFalse(hasattr(entities[0], "birthday"))
+ self.assertFalse(hasattr(entities[0], "married"))
+ self.assertFalse(hasattr(entities[0], "deceased"))
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_entities_with_top(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ table = await self._create_query_table(3)
+ # circular dependencies made this return a list not an item paged - problem when calling by page
+ # Act
+ entities = []
+ async for t in table.list_entities(results_per_page=2).by_page():
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 2)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ async def test_query_entities_with_top_and_next(self, resource_group, location, storage_account,
+ storage_account_key):
+ # Arrange
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ table = await self._create_query_table(5)
+
+ # Act
+ resp1 = table.list_entities(results_per_page=2).by_page()
+ entities1 = []
+ async for el in await resp1.__anext__():
+ entities1.append(el)
+ resp2 = table.list_entities(results_per_page=2).by_page(
+ continuation_token=resp1.continuation_token)
+ entities2 = []
+ async for el in await resp2.__anext__():
+ entities2.append(el)
+ resp3 = table.list_entities(results_per_page=2).by_page(
+ continuation_token=resp2.continuation_token)
+ entities3 = []
+ async for el in await resp3.__anext__():
+ entities3.append(el)
+
+ # Assert
+ self.assertEqual(len(entities1), 2)
+ self.assertEqual(len(entities2), 2)
+ self.assertEqual(len(entities3), 1)
+ self._assert_default_entity(entities1[0])
+ self._assert_default_entity(entities1[1])
+ self._assert_default_entity(entities2[0])
+ self._assert_default_entity(entities2[1])
+ self._assert_default_entity(entities3[0])
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_sas_query(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = await self._insert_random_entity()
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(read=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ entities = []
+ async for t in table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity['PartitionKey'])):
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ self._assert_default_entity(entities[0])
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_sas_add(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(add=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+
+ entity = self._create_random_entity_dict()
+ await table.create_entity(entity=entity)
+
+ # Assert
+ resp = await self.table.get_entity(partition_key=entity['PartitionKey'],
+ row_key=entity['RowKey'])
+ self._assert_default_entity(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_sas_add_inside_range(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(add=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start_pk='test', start_rk='test1',
+ end_pk='test', end_rk='test1',
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ entity = self._create_random_entity_dict('test', 'test1')
+ await table.create_entity(entity=entity)
+
+ # Assert
+ resp = await self.table.get_entity('test', 'test1')
+ self._assert_default_entity(resp)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_sas_add_outside_range(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(add=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start_pk='test', start_rk='test1',
+ end_pk='test', end_rk='test1',
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ with self.assertRaises(HttpResponseError):
+ entity = self._create_random_entity_dict()
+ await table.create_entity(entity=entity)
+
+ # Assert
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_sas_update(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = await self._insert_random_entity()
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(update=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ updated_entity = self._create_updated_entity_dict(entity.PartitionKey, entity.RowKey)
+ await table.update_entity(mode=UpdateMode.REPLACE, entity=updated_entity)
+
+ # Assert
+ received_entity = await self.table.get_entity(entity.PartitionKey,
+ entity.RowKey)
+ self._assert_updated_entity(received_entity)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_sas_delete(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = await self._insert_random_entity()
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ permission=TableSasPermissions(delete=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ await table.delete_entity(entity.PartitionKey, entity.RowKey)
+
+ # Assert
+ with self.assertRaises(ResourceNotFoundError):
+ await self.table.get_entity(entity.PartitionKey, entity.RowKey)
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_sas_upper_case_table_name(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = await self._insert_random_entity()
+
+ # Table names are case insensitive, so simply upper case our existing table name to test
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name.upper(),
+ permission=TableSasPermissions(read=True),
+ expiry=datetime.utcnow() + timedelta(hours=1),
+ start=datetime.utcnow() - timedelta(minutes=1),
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(self.table_name)
+ entities = []
+ async for t in table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity['PartitionKey'])):
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ self._assert_default_entity(entities[0])
+ finally:
+ await self._tear_down()
+
+ # @pytest.mark.skip("pending")
+ @pytest.mark.live_test_only
+ @GlobalStorageAccountPreparer()
+ async def test_sas_signed_identifier(self, resource_group, location, storage_account, storage_account_key):
+ # SAS URL is calculated from storage key, so this test runs live only
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support sas")
+ await self._set_up(storage_account, storage_account_key)
+ try:
+ # Arrange
+ entity, _ = await self._insert_random_entity()
+
+ access_policy = AccessPolicy()
+ access_policy.start = datetime(2011, 10, 11)
+ access_policy.expiry = datetime(2020, 10, 12)
+ access_policy.permission = TableSasPermissions(read=True)
+ identifiers = {'testid': access_policy}
+
+ await self.table.set_table_access_policy(identifiers)
+
+ token = generate_table_sas(
+ storage_account.name,
+ storage_account_key,
+ self.table_name,
+ policy_id='testid',
+ )
+
+ # Act
+ service = TableServiceClient(
+ self.account_url(storage_account, "table"),
+ credential=token,
+ )
+ table = service.get_table_client(table=self.table_name)
+ entities = []
+ async for t in table.query_entities(
+ filter="PartitionKey eq '{}'".format(entity.PartitionKey)):
+ entities.append(t)
+
+ # Assert
+ self.assertEqual(len(entities), 1)
+ self._assert_default_entity(entities[0])
+ finally:
+ await self._tear_down()
+
+
+# ------------------------------------------------------------------------------
+if __name__ == '__main__':
+ unittest.main()
diff --git a/sdk/tables/azure-data-tables/tests/test_table_service_properties.py b/sdk/tables/azure-data-tables/tests/test_table_service_properties.py
new file mode 100644
index 000000000000..a65cbfd6d21e
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table_service_properties.py
@@ -0,0 +1,262 @@
+# coding: utf-8
+
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import unittest
+import time
+import pytest
+from azure.data.tables._models import TableAnalyticsLogging, Metrics, RetentionPolicy, CorsRule
+
+from msrest.exceptions import ValidationError # TODO This should be an azure-core error.
+from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer
+from azure.core.exceptions import HttpResponseError
+
+# from azure.data.tabless import (
+# TableServiceClient,
+# TableClient,
+# TableAnalyticsLogging,
+# Metrics,
+# CorsRule,
+# RetentionPolicy,
+# )
+
+from azure.data.tables import TableServiceClient
+
+from _shared.testcase import GlobalStorageAccountPreparer, TableTestCase
+
+# ------------------------------------------------------------------------------
+
+
+class TableServicePropertiesTest(TableTestCase):
+ # --Helpers-----------------------------------------------------------------
+ def _assert_properties_default(self, prop):
+ self.assertIsNotNone(prop)
+
+ self._assert_logging_equal(prop['analytics_logging'], TableAnalyticsLogging())
+ self._assert_metrics_equal(prop['hour_metrics'], Metrics())
+ self._assert_metrics_equal(prop['minute_metrics'], Metrics())
+ self._assert_cors_equal(prop['cors'], list())
+
+ def _assert_logging_equal(self, log1, log2):
+ if log1 is None or log2 is None:
+ self.assertEqual(log1, log2)
+ return
+
+ self.assertEqual(log1.version, log2.version)
+ self.assertEqual(log1.read, log2.read)
+ self.assertEqual(log1.write, log2.write)
+ self.assertEqual(log1.delete, log2.delete)
+ self._assert_retention_equal(log1.retention_policy, log2.retention_policy)
+
+ def _assert_delete_retention_policy_equal(self, policy1, policy2):
+ if policy1 is None or policy2 is None:
+ self.assertEqual(policy1, policy2)
+ return
+
+ self.assertEqual(policy1.enabled, policy2.enabled)
+ self.assertEqual(policy1.days, policy2.days)
+
+ def _assert_static_website_equal(self, prop1, prop2):
+ if prop1 is None or prop2 is None:
+ self.assertEqual(prop1, prop2)
+ return
+
+ self.assertEqual(prop1.enabled, prop2.enabled)
+ self.assertEqual(prop1.index_document, prop2.index_document)
+ self.assertEqual(prop1.error_document404_path, prop2.error_document404_path)
+
+ def _assert_delete_retention_policy_not_equal(self, policy1, policy2):
+ if policy1 is None or policy2 is None:
+ self.assertNotEqual(policy1, policy2)
+ return
+
+ self.assertFalse(policy1.enabled == policy2.enabled
+ and policy1.days == policy2.days)
+
+ def _assert_metrics_equal(self, metrics1, metrics2):
+ if metrics1 is None or metrics2 is None:
+ self.assertEqual(metrics1, metrics2)
+ return
+
+ self.assertEqual(metrics1.version, metrics2.version)
+ self.assertEqual(metrics1.enabled, metrics2.enabled)
+ self.assertEqual(metrics1.include_apis, metrics2.include_apis)
+ self._assert_retention_equal(metrics1.retention_policy, metrics2.retention_policy)
+
+ def _assert_cors_equal(self, cors1, cors2):
+ if cors1 is None or cors2 is None:
+ self.assertEqual(cors1, cors2)
+ return
+
+ self.assertEqual(len(cors1), len(cors2))
+
+ for i in range(0, len(cors1)):
+ rule1 = cors1[i]
+ rule2 = cors2[i]
+ self.assertEqual(len(rule1.allowed_origins), len(rule2.allowed_origins))
+ self.assertEqual(len(rule1.allowed_methods), len(rule2.allowed_methods))
+ self.assertEqual(rule1.max_age_in_seconds, rule2.max_age_in_seconds)
+ self.assertEqual(len(rule1.exposed_headers), len(rule2.exposed_headers))
+ self.assertEqual(len(rule1.allowed_headers), len(rule2.allowed_headers))
+
+ def _assert_retention_equal(self, ret1, ret2):
+ self.assertEqual(ret1.enabled, ret2.enabled)
+ self.assertEqual(ret1.days, ret2.days)
+
+ # --Test cases per service ---------------------------------------
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_table_service_properties(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support service properties")
+ tsc = TableServiceClient(url, storage_account_key)
+ # Act
+ resp = tsc.set_service_properties(
+ analytics_logging=TableAnalyticsLogging(),
+ hour_metrics=Metrics(),
+ minute_metrics=Metrics(),
+ cors=list())
+
+ # Assert
+ self.assertIsNone(resp)
+ if self.is_live:
+ time.sleep(30)
+ self._assert_properties_default(tsc.get_service_properties())
+
+
+ # --Test cases per feature ---------------------------------------
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_set_logging(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support service properties")
+ tsc = TableServiceClient(url, storage_account_key)
+ logging = TableAnalyticsLogging(read=True, write=True, delete=True, retention_policy=RetentionPolicy(enabled=True, days=5))
+
+ # Act
+ tsc.set_service_properties(analytics_logging=logging)
+
+ # Assert
+ if self.is_live:
+ time.sleep(30)
+ received_props = tsc.get_service_properties()
+ self._assert_logging_equal(received_props['analytics_logging'], logging)
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_set_hour_metrics(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support service properties")
+ tsc = TableServiceClient(url, storage_account_key)
+ hour_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True, days=5))
+
+ # Act
+ tsc.set_service_properties(hour_metrics=hour_metrics)
+
+ # Assert
+ if self.is_live:
+ time.sleep(30)
+ received_props = tsc.get_service_properties()
+ self._assert_metrics_equal(received_props['hour_metrics'], hour_metrics)
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_set_minute_metrics(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support service properties")
+ tsc = TableServiceClient(url, storage_account_key)
+ minute_metrics = Metrics(enabled=True, include_apis=True,
+ retention_policy=RetentionPolicy(enabled=True, days=5))
+
+ # Act
+ tsc.set_service_properties(minute_metrics=minute_metrics)
+
+ # Assert
+ if self.is_live:
+ time.sleep(30)
+ received_props = tsc.get_service_properties()
+ self._assert_metrics_equal(received_props['minute_metrics'], minute_metrics)
+
+ #@pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_set_cors(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ url = self.account_url(storage_account, "table")
+ if 'cosmos' in url:
+ pytest.skip("Cosmos Tables does not yet support service properties")
+ tsc = TableServiceClient(url, storage_account_key)
+ cors_rule1 = CorsRule(['www.xyz.com'], ['GET'])
+
+ allowed_origins = ['www.xyz.com', "www.ab.com", "www.bc.com"]
+ allowed_methods = ['GET', 'PUT']
+ max_age_in_seconds = 500
+ exposed_headers = ["x-ms-meta-data*", "x-ms-meta-source*", "x-ms-meta-abc", "x-ms-meta-bcd"]
+ allowed_headers = ["x-ms-meta-data*", "x-ms-meta-target*", "x-ms-meta-xyz", "x-ms-meta-foo"]
+ cors_rule2 = CorsRule(
+ allowed_origins,
+ allowed_methods,
+ max_age_in_seconds=max_age_in_seconds,
+ exposed_headers=exposed_headers,
+ allowed_headers=allowed_headers)
+
+ cors = [cors_rule1, cors_rule2]
+
+ # Act
+ tsc.set_service_properties(cors=cors)
+
+ # Assert
+ if self.is_live:
+ time.sleep(30)
+ received_props = tsc.get_service_properties()
+ self._assert_cors_equal(received_props['cors'], cors)
+
+ # --Test cases for errors ---------------------------------------
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_retention_no_days(self, resource_group, location, storage_account, storage_account_key):
+ # Assert
+ self.assertRaises(ValueError,
+ RetentionPolicy,
+ True, None)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_too_many_cors_rules(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ tsc = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ cors = []
+ for i in range(0, 6):
+ cors.append(CorsRule(['www.xyz.com'], ['GET']))
+
+ # Assert
+ self.assertRaises(HttpResponseError,
+ tsc.set_service_properties, None, None, None, cors)
+
+ # @pytest.mark.skip("pending")
+ @GlobalStorageAccountPreparer()
+ def test_retention_too_long(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ tsc = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+ minute_metrics = Metrics(enabled=True, include_apis=True,
+ retention_policy=RetentionPolicy(enabled=True, days=366))
+
+ # Assert
+ self.assertRaises(HttpResponseError,
+ tsc.set_service_properties,
+ None, None, minute_metrics)
+
+
+# ------------------------------------------------------------------------------
+if __name__ == '__main__':
+ unittest.main()
diff --git a/sdk/tables/azure-data-tables/tests/test_table_service_stats.py b/sdk/tables/azure-data-tables/tests/test_table_service_stats.py
new file mode 100644
index 000000000000..ab6d8e6ef77f
--- /dev/null
+++ b/sdk/tables/azure-data-tables/tests/test_table_service_stats.py
@@ -0,0 +1,81 @@
+# -------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+# --------------------------------------------------------------------------
+import unittest
+import pytest
+
+# from azure.data.tabless import TableServiceClient
+from azure.data.tables import TableServiceClient
+from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer
+from _shared.testcase import GlobalResourceGroupPreparer, TableTestCase, GlobalStorageAccountPreparer
+
+SERVICE_UNAVAILABLE_RESP_BODY = 'unavailable '
+
+SERVICE_LIVE_RESP_BODY = 'liveWed, 19 Jan 2021 22:28:43 GMT '
+
+
+# --Test Class -----------------------------------------------------------------
+class TableServiceStatsTest(TableTestCase):
+ # --Helpers-----------------------------------------------------------------
+ def _assert_stats_default(self, stats):
+ self.assertIsNotNone(stats)
+ self.assertIsNotNone(stats['geo_replication'])
+
+ self.assertEqual(stats['geo_replication']['status'], 'live')
+ self.assertIsNotNone(stats['geo_replication']['last_sync_time'])
+
+ def _assert_stats_unavailable(self, stats):
+ self.assertIsNotNone(stats)
+ self.assertIsNotNone(stats['geo_replication'])
+
+ self.assertEqual(stats['geo_replication']['status'], 'unavailable')
+ self.assertIsNone(stats['geo_replication']['last_sync_time'])
+
+ @staticmethod
+ def override_response_body_with_unavailable_status(response):
+ response.http_response.text = lambda _: SERVICE_UNAVAILABLE_RESP_BODY
+
+ @staticmethod
+ def override_response_body_with_live_status(response):
+ response.http_response.text = lambda _: SERVICE_LIVE_RESP_BODY
+ # response.http_response.text = lambda _: SERVICE_LIVE_RESP_BODY
+
+ # --Test cases per service ---------------------------------------
+
+ # @pytest.mark.skip("pending")
+ #@GlobalStorageAccountPreparer()
+ @GlobalResourceGroupPreparer()
+ @StorageAccountPreparer(name_prefix='pyacrstorage', sku='Standard_RAGRS', random_name_enabled=True)
+ def test_table_service_stats_f(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ tsc = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+
+ # Act
+ stats = tsc.get_service_stats(raw_response_hook=self.override_response_body_with_live_status)
+ # Assert
+ self._assert_stats_default(stats)
+
+ # @pytest.mark.skip("pending")
+ @GlobalResourceGroupPreparer()
+ @StorageAccountPreparer(name_prefix='pyacrstorage', sku='Standard_RAGRS', random_name_enabled=True)
+ def test_table_service_stats_when_unavailable(self, resource_group, location, storage_account, storage_account_key):
+ # Arrange
+ tsc = TableServiceClient(self.account_url(storage_account, "table"), storage_account_key)
+
+ # Act
+ stats = tsc.get_service_stats(
+ raw_response_hook=self.override_response_body_with_unavailable_status)
+
+ # Assert
+ self._assert_stats_unavailable(stats)
+
+
+# ------------------------------------------------------------------------------
+if __name__ == '__main__':
+ unittest.main()
diff --git a/sdk/tables/ci.yml b/sdk/tables/ci.yml
new file mode 100644
index 000000000000..c774c989e2f0
--- /dev/null
+++ b/sdk/tables/ci.yml
@@ -0,0 +1,41 @@
+# DO NOT EDIT THIS FILE
+# This file is generated automatically and any changes will be lost.
+
+trigger:
+ branches:
+ include:
+ - master
+ - hotfix/*
+ - release/*
+ - restapi*
+ paths:
+ include:
+ - sdk/tables/
+ - sdk/core/
+ - tools/
+ - eng/
+
+pr:
+ branches:
+ include:
+ - master
+ - feature/*
+ - hotfix/*
+ - release/*
+ - restapi*
+ paths:
+ include:
+ - sdk/tables/
+ - sdk/core/
+ - tools/
+ - eng/
+
+
+extends:
+ template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
+ parameters:
+ ServiceDirectory: tables
+ Artifacts:
+ - name: azure_data_tables
+ safeName: azuredatatables
+
diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml
new file mode 100644
index 000000000000..ab37d5ceaa85
--- /dev/null
+++ b/sdk/tables/tests.yml
@@ -0,0 +1,39 @@
+trigger: none
+
+resources:
+ repositories:
+ - repository: azure-sdk-tools
+ type: github
+ name: Azure/azure-sdk-tools
+ endpoint: azure
+
+jobs:
+ - template: ./tests_invoke.yml
+ parameters:
+ InjectedPackages: $(InjectedPackages)
+ EnvVars:
+ STORAGE_ACCOUNT_NAME: $(python-storage-storage-account-name)
+ STORAGE_ACCOUNT_KEY: $(python-storage-storage-account-key)
+ STORAGE_DATA_LAKE_ACCOUNT_NAME: $(python-storage-data-lake-account-name)
+ STORAGE_DATA_LAKE_ACCOUNT_KEY: $(python-storage-data-lake-account-key)
+ BLOB_STORAGE_ACCOUNT_NAME: $(python-storage-blob-storage-account-name)
+ BLOB_STORAGE_ACCOUNT_KEY: $(python-storage-blob-storage-account-key)
+ REMOTE_STORAGE_ACCOUNT_NAME: $(python-storage-remote-storage-account-name)
+ REMOTE_STORAGE_ACCOUNT_KEY: $(python-storage-remote-storage-account-key)
+ PREMIUM_STORAGE_ACCOUNT_NAME: $(python-storage-premium-storage-account-name)
+ PREMIUM_STORAGE_ACCOUNT_KEY: $(python-storage-premium-storage-account-key)
+ OAUTH_STORAGE_ACCOUNT_NAME: $(python-storage-oauth-storage-account-name)
+ OAUTH_STORAGE_ACCOUNT_KEY: $(python-storage-oauth-storage-account-key)
+ ACTIVE_DIRECTORY_APPLICATION_ID: $(aad-azure-sdk-test-client-id)
+ ACTIVE_DIRECTORY_APPLICATION_SECRET: $(aad-azure-sdk-test-client-secret)
+ ACTIVE_DIRECTORY_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
+ CONNECTION_STRING: $(python-storage-blob-connection-string)
+ BLOB_CONNECTION_STRING: $(python-storage-blob-connection-string)
+ PREMIUM_CONNECTION_STRING: $(python-storage-premium-connection-string)
+ TEST_MODE: 'RunLiveNoRecord'
+ AZURE_SKIP_LIVE_RECORDING: 'True'
+ AZURE_TEST_RUN_LIVE: 'true'
+ AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
+ AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
+ AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
+ AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
diff --git a/shared_requirements.txt b/shared_requirements.txt
index 16b56a8ce224..8621eed303e5 100644
--- a/shared_requirements.txt
+++ b/shared_requirements.txt
@@ -153,4 +153,5 @@ opentelemetry-api==0.10b0
#override azure-search-documents msrest>=0.6.10
#override azure-synapse-accesscontrol azure-core>=1.6.0,<2.0.0
#override azure-synapse-spark azure-core>=1.6.0,<2.0.0
-#override azure-synapse-artifacts azure-core>=1.6.0,<2.0.0
\ No newline at end of file
+#override azure-synapse-artifacts azure-core>=1.6.0,<2.0.0
+#override azure-data-tables msrest>=0.6.10
\ No newline at end of file
From d69e803137eadf63a4d9291322ace867941ea404 Mon Sep 17 00:00:00 2001
From: iscai-msft <43154838+iscai-msft@users.noreply.github.com>
Date: Thu, 30 Jul 2020 17:18:42 -0400
Subject: [PATCH 7/7] [key vault] Regenerate keys (#12101)
---
sdk/keyvault/azure-keyvault-keys/CHANGELOG.md | 2 +
.../azure/keyvault/keys/__init__.py | 2 +-
.../azure/keyvault/keys/_client.py | 41 +-
.../v7_0 => _generated}/__init__.py | 16 +-
.../_configuration.py | 36 +-
.../keys/_generated/_key_vault_client.py | 157 +
.../keys/_generated/_operations_mixin.py | 2903 +++++++++
.../version.py => _generated/_version.py} | 7 +-
.../v7_0 => _generated}/aio/__init__.py | 7 +-
.../aio/_configuration_async.py | 34 +-
.../_generated/aio/_key_vault_client_async.py | 157 +
.../_generated/aio/_operations_mixin_async.py | 2899 +++++++++
.../version.py => _generated/models.py} | 9 +-
.../azure/keyvault/keys/_generated/py.typed | 1 +
.../_generated/v2016_10_01/__init__.py | 16 +-
.../_generated/v2016_10_01/_configuration.py | 52 +
.../v2016_10_01}/_key_vault_client.py | 34 +-
.../_generated/v2016_10_01/_metadata.json | 837 +++
.../v2016_10_01}/aio/__init__.py | 7 +-
.../v2016_10_01}/aio/_configuration_async.py | 43 +-
.../aio/_key_vault_client_async.py | 32 +-
.../aio/operations_async/__init__.py | 7 +-
.../_key_vault_client_operations_async.py | 4512 ++++++++++++++
.../_generated/v2016_10_01/models/__init__.py | 190 +-
.../models/_key_vault_client_enums.py | 112 +
.../_generated/v2016_10_01/models/_models.py | 1358 +++--
.../v2016_10_01/models/_models_py3.py | 1585 +++--
.../v2016_10_01/operations/__init__.py | 7 +-
.../_key_vault_client_operations.py | 4583 ++++++++++++++
.../keys/_generated/v2016_10_01/py.typed | 1 +
.../v7_0}/__init__.py | 16 +-
.../_generated/v7_0/_configuration.py | 47 +-
.../_generated/v7_0/_key_vault_client.py | 36 +-
.../keys/_generated/v7_0/_metadata.json | 969 +++
.../v7_0}/aio/__init__.py | 7 +-
.../v7_0/aio/_configuration_async.py | 43 +-
.../v7_0}/aio/_key_vault_client_async.py | 32 +-
.../v7_0/aio/operations_async/__init__.py | 7 +-
.../_key_vault_client_operations_async.py | 5232 ++++++++++++++++
.../_generated/v7_0/models/__init__.py | 210 +-
.../v7_0/models/_key_vault_client_enums.py | 123 +
.../_generated/v7_0/models/_models.py | 1596 ++---
.../_generated/v7_0/models/_models_py3.py | 1833 +++---
.../_generated/v7_0/operations/__init__.py | 7 +-
.../_key_vault_client_operations.py | 5314 +++++++++++++++++
.../keyvault/keys/_generated/v7_0/py.typed | 1 +
.../keyvault/keys/_generated/v7_1/__init__.py | 16 +
.../v7_1}/_configuration.py | 47 +-
.../v7_1}/_key_vault_client.py | 36 +-
.../keys/_generated/v7_1/_metadata.json | 261 +
.../v7_1/aio/__init__.py} | 11 +-
.../v7_1/aio/_configuration_async.py | 46 +
.../v7_1}/aio/_key_vault_client_async.py | 32 +-
.../v7_1}/aio/operations_async/__init__.py | 7 +-
.../_key_vault_client_operations_async.py | 1361 +++++
.../keys/_generated/v7_1/models/__init__.py | 94 +
.../v7_1/models/_key_vault_client_enums.py | 98 +
.../keys/_generated/v7_1/models/_models.py | 837 +++
.../_generated/v7_1/models/_models_py3.py | 919 +++
.../v7_1}/operations/__init__.py | 7 +-
.../_key_vault_client_operations.py | 1384 +++++
.../keyvault/keys/_generated/v7_1/py.typed | 1 +
.../azure/keyvault/keys/_models.py | 4 +-
.../__init__.py => _sdk_moniker.py} | 3 +
.../azure/keyvault/keys/_shared/__init__.py | 1 +
.../_key_vault_client_operations_async.py | 4475 --------------
.../models/_key_vault_client_enums.py | 88 -
.../_key_vault_client_operations.py | 4475 --------------
.../_key_vault_client_operations_async.py | 5163 ----------------
.../v7_0/models/_key_vault_client_enums.py | 94 -
.../_key_vault_client_operations.py | 5163 ----------------
.../_key_vault_client_operations_async.py | 5224 ----------------
.../v7_1_preview/models/__init__.py | 303 -
.../models/_key_vault_client_enums.py | 98 -
.../_generated/v7_1_preview/models/_models.py | 3244 ----------
.../v7_1_preview/models/_models_py3.py | 3244 ----------
.../_key_vault_client_operations.py | 5224 ----------------
.../keys/_shared/async_client_base.py | 63 +-
.../keyvault/keys/_shared/client_base.py | 87 +-
.../azure/keyvault/keys/_shared/multi_api.py | 73 -
.../azure/keyvault/keys/_user_agent.py | 10 -
.../azure/keyvault/keys/aio/_client.py | 41 +-
.../azure/keyvault/keys/crypto/_client.py | 52 +-
.../azure/keyvault/keys/crypto/aio/_client.py | 50 +-
sdk/keyvault/azure-keyvault-keys/setup.py | 2 +-
...st_crypto_client.test_ec_verify_local.yaml | 150 +-
...rypto_client.test_encrypt_and_decrypt.yaml | 87 +-
...test_crypto_client.test_encrypt_local.yaml | 86 +-
...est_local_validity_period_enforcement.yaml | 122 +-
...t_crypto_client.test_rsa_verify_local.yaml | 356 +-
...st_crypto_client.test_sign_and_verify.yaml | 83 +-
...st_crypto_client.test_wrap_and_unwrap.yaml | 87 +-
.../test_crypto_client.test_wrap_local.yaml | 86 +-
...pto_client_async.test_ec_verify_local.yaml | 159 +-
...client_async.test_encrypt_and_decrypt.yaml | 92 +-
...rypto_client_async.test_encrypt_local.yaml | 91 +-
...est_local_validity_period_enforcement.yaml | 129 +-
...to_client_async.test_rsa_verify_local.yaml | 378 +-
...pto_client_async.test_sign_and_verify.yaml | 88 +-
...pto_client_async.test_wrap_and_unwrap.yaml | 53 +-
...t_crypto_client_async.test_wrap_local.yaml | 91 +-
..._examples_crypto.test_encrypt_decrypt.yaml | 50 +-
...test_examples_crypto.test_sign_verify.yaml | 48 +-
...test_examples_crypto.test_wrap_unwrap.yaml | 50 +-
...ypto_async.test_encrypt_decrypt_async.yaml | 53 +-
...s_crypto_async.test_sign_verify_async.yaml | 51 +-
...s_crypto_async.test_wrap_unwrap_async.yaml | 53 +-
.../test_key_client.test_backup_restore.yaml | 86 +-
...t_key_client.test_key_crud_operations.yaml | 716 ++-
.../test_key_client.test_key_list.yaml | 172 +-
...est_key_client.test_list_deleted_keys.yaml | 1588 +++--
.../test_key_client.test_list_versions.yaml | 172 +-
...test_key_client.test_logging_disabled.yaml | 32 +-
.../test_key_client.test_logging_enabled.yaml | 32 +-
.../test_key_client.test_purge.yaml | 1898 +++---
.../test_key_client.test_recover.yaml | 2000 +++----
.../test_keys_async.test_backup_restore.yaml | 91 +-
...t_keys_async.test_key_crud_operations.yaml | 543 +-
.../test_keys_async.test_key_list.yaml | 182 +-
...est_keys_async.test_list_deleted_keys.yaml | 444 +-
.../test_keys_async.test_list_versions.yaml | 182 +-
...test_keys_async.test_logging_disabled.yaml | 34 +-
.../test_keys_async.test_logging_enabled.yaml | 34 +-
.../test_keys_async.test_purge.yaml | 2038 +++----
.../test_keys_async.test_recover.yaml | 3957 ++++++------
...keys.test_example_key_crud_operations.yaml | 452 +-
...keys.test_example_key_list_operations.yaml | 198 +-
...keys.test_example_keys_backup_restore.yaml | 86 +-
...amples_keys.test_example_keys_recover.yaml | 600 +-
...sync.test_example_key_crud_operations.yaml | 439 +-
...sync.test_example_key_list_operations.yaml | 210 +-
...sync.test_example_keys_backup_restore.yaml | 91 +-
..._keys_async.test_example_keys_recover.yaml | 734 +--
.../tests/test_crypto_client.py | 9 +
.../tests/test_crypto_client_async.py | 9 +
.../tests/test_key_client.py | 22 +
.../tests/test_keys_async.py | 22 +
shared_requirements.txt | 2 +-
138 files changed, 46620 insertions(+), 50356 deletions(-)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_0 => _generated}/__init__.py (76%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview => _generated}/_configuration.py (70%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_key_vault_client.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_operations_mixin.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_0/version.py => _generated/_version.py} (66%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_0 => _generated}/aio/__init__.py (89%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v2016_10_01 => _generated}/aio/_configuration_async.py (70%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_key_vault_client_async.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_operations_mixin_async.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview/version.py => _generated/models.py} (65%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/py.typed
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v2016_10_01/__init__.py (76%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_configuration.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview => _generated/v2016_10_01}/_key_vault_client.py (69%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_metadata.json
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview => _generated/v2016_10_01}/aio/__init__.py (89%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview => _generated/v2016_10_01}/aio/_configuration_async.py (68%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview => _generated/v2016_10_01}/aio/_key_vault_client_async.py (70%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview => _generated/v2016_10_01}/aio/operations_async/__init__.py (90%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/operations_async/_key_vault_client_operations_async.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v2016_10_01/models/__init__.py (58%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_key_vault_client_enums.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v2016_10_01/models/_models.py (75%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v2016_10_01/models/_models_py3.py (68%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v2016_10_01/operations/__init__.py (90%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/operations/_key_vault_client_operations.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/py.typed
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview => _generated/v7_0}/__init__.py (76%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v7_0/_configuration.py (66%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v7_0/_key_vault_client.py (66%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_metadata.json
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v2016_10_01 => _generated/v7_0}/aio/__init__.py (89%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v7_0/aio/_configuration_async.py (68%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v2016_10_01 => _generated/v7_0}/aio/_key_vault_client_async.py (69%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v7_0/aio/operations_async/__init__.py (90%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/operations_async/_key_vault_client_operations_async.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v7_0/models/__init__.py (58%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_key_vault_client_enums.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v7_0/models/_models.py (75%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v7_0/models/_models_py3.py (69%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared => }/_generated/v7_0/operations/__init__.py (90%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/operations/_key_vault_client_operations.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/py.typed
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/__init__.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v2016_10_01 => _generated/v7_1}/_configuration.py (66%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v2016_10_01 => _generated/v7_1}/_key_vault_client.py (66%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_metadata.json
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v2016_10_01/version.py => _generated/v7_1/aio/__init__.py} (75%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/_configuration_async.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_0 => _generated/v7_1}/aio/_key_vault_client_async.py (69%)
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v2016_10_01 => _generated/v7_1}/aio/operations_async/__init__.py (90%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/operations_async/_key_vault_client_operations_async.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/__init__.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_key_vault_client_enums.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_models.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_models_py3.py
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/v7_1_preview => _generated/v7_1}/operations/__init__.py (90%)
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/operations/_key_vault_client_operations.py
create mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/py.typed
rename sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/{_shared/_generated/__init__.py => _sdk_moniker.py} (65%)
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/operations_async/_key_vault_client_operations_async.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_key_vault_client_enums.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/operations/_key_vault_client_operations.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/operations_async/_key_vault_client_operations_async.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_key_vault_client_enums.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/operations/_key_vault_client_operations.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/operations_async/_key_vault_client_operations_async.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/models/__init__.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/models/_key_vault_client_enums.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/models/_models.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/models/_models_py3.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/operations/_key_vault_client_operations.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/multi_api.py
delete mode 100644 sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_user_agent.py
diff --git a/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md b/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md
index 42e73b03c9e7..e12744d3ca62 100644
--- a/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md
+++ b/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md
@@ -6,6 +6,8 @@
- Updated minimum `azure-core` version to 1.4.0
- `CryptographyClient` will no longer perform encrypt or wrap operations when
its key has expired or is not yet valid.
+- Users can pass in CustomHookPolicy through the kwarg `custom_hook_policy` when initializing the client
+- RequestIdPolicy is now always set for all requests. This policy sets the id of the request in the header.
## 4.2.0b1 (2020-03-10)
- Support for Key Vault API version 7.1-preview
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/__init__.py
index 2b5ce7cb2a68..2d5049c88d23 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/__init__.py
@@ -3,7 +3,7 @@
# Licensed under the MIT License.
# -------------------------------------
from ._enums import KeyCurveName, KeyOperation, KeyType
-from ._shared.multi_api import ApiVersion
+from ._shared.client_base import ApiVersion
from ._models import DeletedKey, JsonWebKey, KeyProperties, KeyVaultKey
from ._client import KeyClient
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py
index 728a63a4ee39..2738528d1b88 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py
@@ -87,13 +87,19 @@ def create_key(self, name, key_type, **kwargs):
else:
attributes = None
- bundle = self._client.create_key(
- vault_base_url=self.vault_url,
- key_name=name,
+ parameters = self._models.KeyCreateParameters(
kty=key_type,
key_size=kwargs.pop("size", None),
key_attributes=attributes,
key_ops=kwargs.pop("key_operations", None),
+ tags=kwargs.pop("tags", None),
+ curve=kwargs.pop("curve", None)
+ )
+
+ bundle = self._client.create_key(
+ vault_base_url=self.vault_url,
+ key_name=name,
+ parameters=parameters,
error_map=_error_map,
**kwargs
)
@@ -439,12 +445,18 @@ def update_key_properties(self, name, version=None, **kwargs):
attributes = self._models.KeyAttributes(enabled=enabled, not_before=not_before, expires=expires_on)
else:
attributes = None
+
+ parameters = self._models.KeyUpdateParameters(
+ key_ops=kwargs.pop("key_operations", None),
+ key_attributes=attributes,
+ tags=kwargs.pop("tags", None)
+ )
+
bundle = self._client.update_key(
self.vault_url,
name,
key_version=version or "",
- key_ops=kwargs.pop("key_operations", None),
- key_attributes=attributes,
+ parameters=parameters,
error_map=_error_map,
**kwargs
)
@@ -500,7 +512,12 @@ def restore_key_backup(self, backup, **kwargs):
:caption: Restore a key backup
:dedent: 8
"""
- bundle = self._client.restore_key(self.vault_url, backup, error_map=_error_map, **kwargs)
+ bundle = self._client.restore_key(
+ self.vault_url,
+ parameters=self._models.KeyRestoreParameters(key_bundle_backup=backup),
+ error_map=_error_map,
+ **kwargs
+ )
return KeyVaultKey._from_key_bundle(bundle)
@distributed_trace
@@ -530,12 +547,18 @@ def import_key(self, name, key, **kwargs):
attributes = self._models.KeyAttributes(enabled=enabled, not_before=not_before, expires=expires_on)
else:
attributes = None
- bundle = self._client.import_key(
- self.vault_url,
- name,
+
+ parameters = self._models.KeyImportParameters(
key=key._to_generated_model(),
key_attributes=attributes,
hsm=kwargs.pop("hardware_protected", None),
+ tags=kwargs.pop("tags", None)
+ )
+
+ bundle = self._client.import_key(
+ self.vault_url,
+ name,
+ parameters=parameters,
error_map=_error_map,
**kwargs
)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/__init__.py
similarity index 76%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/__init__.py
index e913d4cf6c46..a6c1f9b7a792 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/__init__.py
@@ -1,18 +1,16 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client import KeyVaultClient
__all__ = ['KeyVaultClient']
-from .version import VERSION
-
-__version__ = VERSION
-
+try:
+ from ._patch import patch_sdk # type: ignore
+ patch_sdk()
+except ImportError:
+ pass
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/_configuration.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_configuration.py
similarity index 70%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/_configuration.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_configuration.py
index 68d6f5b6bd2c..fea6e56a754e 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/_configuration.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_configuration.py
@@ -8,40 +8,42 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
+from typing import Any
+
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
-from .version import VERSION
+from ._version import VERSION
class KeyVaultClientConfiguration(Configuration):
- """Configuration for KeyVaultClient
+ """Configuration for KeyVaultClient.
+
Note that all parameters used to create this instance are saved as instance
attributes.
-
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
"""
- def __init__(self, credentials, **kwargs):
-
- if credentials is None:
- raise ValueError("Parameter 'credentials' must not be None.")
-
+ def __init__(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
super(KeyVaultClientConfiguration, self).__init__(**kwargs)
- self._configure(**kwargs)
- self.user_agent_policy.add_user_agent('azsdk-python-azure-keyvault/{}'.format(VERSION))
- self.generate_client_request_id = True
-
- self.credentials = credentials
+ kwargs.setdefault('sdk_moniker', 'azure-keyvault/{}'.format(VERSION))
+ self._configure(**kwargs)
- def _configure(self, **kwargs):
+ def _configure(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_key_vault_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_key_vault_client.py
new file mode 100644
index 000000000000..e1fed606f0c2
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_key_vault_client.py
@@ -0,0 +1,157 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from azure.core import PipelineClient
+from msrest import Serializer, Deserializer
+
+from azure.profiles import KnownProfiles, ProfileDefinition
+from azure.profiles.multiapiclient import MultiApiClientMixin
+from ._configuration import KeyVaultClientConfiguration
+from ._operations_mixin import KeyVaultClientOperationsMixin
+class _SDKClient(object):
+ def __init__(self, *args, **kwargs):
+ """This is a fake class to support current implemetation of MultiApiClientMixin."
+ Will be removed in final version of multiapi azure-core based client
+ """
+ pass
+
+class KeyVaultClient(KeyVaultClientOperationsMixin, MultiApiClientMixin, _SDKClient):
+ """The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
+
+ This ready contains multiple API versions, to help you deal with all of the Azure clouds
+ (Azure Stack, Azure Government, Azure China, etc.).
+ By default, it uses the latest API version available on public Azure.
+ For production, you should stick to a particular api-version and/or profile.
+ The profile sets a mapping between an operation group and its API version.
+ The api-version parameter sets the default API version if the operation
+ group is not described in the profile.
+ :param str api_version: API version to use if no profile is provided, or if
+ 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'
+ _PROFILE_TAG = "azure.keyvault.KeyVaultClient"
+ LATEST_PROFILE = ProfileDefinition({
+ _PROFILE_TAG: {
+ None: DEFAULT_API_VERSION,
+ 'backup_certificate': '7.0',
+ 'backup_secret': '7.0',
+ 'backup_storage_account': '7.0',
+ 'create_certificate': '7.0',
+ 'delete_certificate': '7.0',
+ 'delete_certificate_contacts': '7.0',
+ 'delete_certificate_issuer': '7.0',
+ 'delete_certificate_operation': '7.0',
+ 'delete_sas_definition': '7.0',
+ 'delete_secret': '7.0',
+ 'delete_storage_account': '7.0',
+ 'get_certificate': '7.0',
+ 'get_certificate_contacts': '7.0',
+ 'get_certificate_issuer': '7.0',
+ 'get_certificate_issuers': '7.0',
+ 'get_certificate_operation': '7.0',
+ 'get_certificate_policy': '7.0',
+ 'get_certificate_versions': '7.0',
+ 'get_certificates': '7.0',
+ 'get_deleted_certificate': '7.0',
+ 'get_deleted_certificates': '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_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_certificate': '7.0',
+ 'merge_certificate': '7.0',
+ 'purge_deleted_certificate': '7.0',
+ 'purge_deleted_secret': '7.0',
+ 'purge_deleted_storage_account': '7.0',
+ 'recover_deleted_certificate': '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_certificate': '7.0',
+ 'restore_secret': '7.0',
+ 'restore_storage_account': '7.0',
+ 'set_certificate_contacts': '7.0',
+ 'set_certificate_issuer': '7.0',
+ 'set_sas_definition': '7.0',
+ 'set_secret': '7.0',
+ 'set_storage_account': '7.0',
+ 'update_certificate': '7.0',
+ 'update_certificate_issuer': '7.0',
+ 'update_certificate_operation': '7.0',
+ 'update_certificate_policy': '7.0',
+ 'update_sas_definition': '7.0',
+ 'update_secret': '7.0',
+ 'update_storage_account': '7.0',
+ }},
+ _PROFILE_TAG + " latest"
+ )
+
+ def __init__(
+ self,
+ api_version=None,
+ profile=KnownProfiles.default,
+ **kwargs # type: Any
+ ):
+ if api_version == '2016-10-01' or api_version == '7.0' or api_version == '7.1':
+ base_url = '{vaultBaseUrl}'
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ self._config = KeyVaultClientConfiguration(**kwargs)
+ self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
+ super(KeyVaultClient, self).__init__(
+ api_version=api_version,
+ profile=profile
+ )
+
+ @classmethod
+ def _models_dict(cls, api_version):
+ return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
+
+ @classmethod
+ def models(cls, api_version=DEFAULT_API_VERSION):
+ """Module depends on the API version:
+
+ * 2016-10-01: :mod:`v2016_10_01.models`
+ * 7.0: :mod:`v7_0.models`
+ * 7.1: :mod:`v7_1.models`
+ """
+ if api_version == '2016-10-01':
+ from .v2016_10_01 import models
+ return models
+ elif api_version == '7.0':
+ from .v7_0 import models
+ return models
+ elif api_version == '7.1':
+ from .v7_1 import models
+ return models
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+
+ def close(self):
+ self._client.close()
+ def __enter__(self):
+ self._client.__enter__()
+ return self
+ def __exit__(self, *exc_details):
+ self._client.__exit__(*exc_details)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_operations_mixin.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_operations_mixin.py
new file mode 100644
index 000000000000..2605be7e13de
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_operations_mixin.py
@@ -0,0 +1,2903 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+from msrest import Serializer, Deserializer
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
+
+
+class KeyVaultClientOperationsMixin(object):
+
+ def backup_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Backs up the specified certificate.
+
+ Requests that a backup of the specified certificate be downloaded to the client. All versions
+ of the certificate will be downloaded. This operation requires the certificates/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupCertificateResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupCertificateResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('backup_certificate')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.backup_certificate(vault_base_url, certificate_name, **kwargs)
+
+ def backup_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Requests that a backup of the specified key be downloaded to the client.
+
+ The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this
+ operation does NOT return key material in a form that can be used outside the Azure Key Vault
+ system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key
+ Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
+ Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.
+ The BACKUP operation may be used to export, in protected form, any key type from Azure Key
+ Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed
+ within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be
+ restored to another geographical area. For example, a backup from the US geographical area
+ cannot be restored in an EU geographical area. This operation requires the key/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupKeyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.BackupKeyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('backup_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.backup_key(vault_base_url, key_name, **kwargs)
+
+ def backup_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Backs up the specified secret.
+
+ Requests that a backup of the specified secret be downloaded to the client. All versions of the
+ secret will be downloaded. This operation requires the secrets/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupSecretResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupSecretResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('backup_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.backup_secret(vault_base_url, secret_name, **kwargs)
+
+ def backup_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Backs up the specified storage account.
+
+ Requests that a backup of the specified storage account be downloaded to the client. This
+ operation requires the storage/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupStorageResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupStorageResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('backup_storage_account')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.backup_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ def create_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateCreateParameters"
+ **kwargs # type: Any
+ ):
+ """Creates a new certificate.
+
+ If this is the first version, the certificate resource is created. This operation requires the
+ certificates/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to create a certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('create_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.create_certificate(vault_base_url, certificate_name, parameters, **kwargs)
+
+ def create_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ parameters, # type: "models.KeyCreateParameters"
+ **kwargs # type: Any
+ ):
+ """Creates a new key, stores it, then returns key parameters and attributes to the client.
+
+ The create key operation can be used to create any key type in Azure Key Vault. If the named
+ key already exists, Azure Key Vault creates a new version of the key. It requires the
+ keys/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name for the new key. The system will generate the version name for the
+ new key.
+ :type key_name: str
+ :param parameters: The parameters to create a key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('create_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.create_key(vault_base_url, key_name, parameters, **kwargs)
+
+ def decrypt(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ """Decrypts a single block of encrypted data.
+
+ The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption
+ key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a
+ single block of data may be decrypted, the size of this block is dependent on the target key
+ and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys
+ stored in Azure Key Vault since it uses the private portion of the key. This operation requires
+ the keys/decrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the decryption operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('decrypt')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.decrypt(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ def delete_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Deletes a certificate from a specified key vault.
+
+ Deletes all versions of a certificate object along with its associated policy. Delete
+ certificate cannot be used to remove individual versions of a certificate object. This
+ operation requires the certificates/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.delete_certificate(vault_base_url, certificate_name, **kwargs)
+
+ def delete_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ **kwargs # type: Any
+ ):
+ """Deletes the certificate contacts for a specified key vault.
+
+ Deletes the certificate contacts for a specified key vault certificate. This operation requires
+ the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_certificate_contacts')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.delete_certificate_contacts(vault_base_url, **kwargs)
+
+ def delete_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Deletes the specified certificate issuer.
+
+ The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from
+ the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_certificate_issuer')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.delete_certificate_issuer(vault_base_url, issuer_name, **kwargs)
+
+ def delete_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Deletes the creation operation for a specific certificate.
+
+ Deletes the creation operation for a specified certificate that is in the process of being
+ created. The certificate is no longer created. This operation requires the certificates/update
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_certificate_operation')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.delete_certificate_operation(vault_base_url, certificate_name, **kwargs)
+
+ def delete_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Deletes a key of any type from storage in Azure Key Vault.
+
+ The delete key operation cannot be used to remove individual versions of a key. This operation
+ removes the cryptographic material associated with the key, which means the key is not usable
+ for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
+ keys/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to delete.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.delete_key(vault_base_url, key_name, **kwargs)
+
+ def delete_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Deletes a SAS definition from a specified storage account. This operation requires the
+ storage/deletesas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_sas_definition')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.delete_sas_definition(vault_base_url, storage_account_name, sas_definition_name, **kwargs)
+
+ def delete_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Deletes a secret from a specified key vault.
+
+ The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied
+ to an individual version of a secret. This operation requires the secrets/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.delete_secret(vault_base_url, secret_name, **kwargs)
+
+ def delete_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Deletes a storage account. This operation requires the storage/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedStorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_storage_account')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.delete_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ def encrypt(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ """Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
+
+ The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
+ stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of
+ data, the size of which is dependent on the target key and the encryption algorithm to be used.
+ The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
+ since protection with an asymmetric key can be performed using public portion of the key. This
+ operation is supported for asymmetric keys as a convenience for callers that have a key-
+ reference but do not have access to the public key material. This operation requires the
+ keys/encrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the encryption operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('encrypt')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.encrypt(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ def get_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_version, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets information about a certificate.
+
+ Gets information about a specific certificate. This operation requires the certificates/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate. This URI fragment is optional. If
+ not specified, the latest version of the certificate is returned.
+ :type certificate_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate(vault_base_url, certificate_name, certificate_version, **kwargs)
+
+ def get_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ **kwargs # type: Any
+ ):
+ """Lists the certificate contacts for a specified key vault.
+
+ The GetCertificateContacts operation returns the set of certificate contact resources in the
+ specified key vault. This operation requires the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_contacts')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate_contacts(vault_base_url, **kwargs)
+
+ def get_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Lists the specified certificate issuer.
+
+ The GetCertificateIssuer operation returns the specified certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_issuer')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate_issuer(vault_base_url, issuer_name, **kwargs)
+
+ def get_certificate_issuers(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """List certificate issuers for a specified key vault.
+
+ The GetCertificateIssuers operation returns the set of certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateIssuerListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_issuers')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate_issuers(vault_base_url, maxresults, **kwargs)
+
+ def get_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets the creation operation of a certificate.
+
+ Gets the creation operation associated with a specified certificate. This operation requires
+ the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_operation')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate_operation(vault_base_url, certificate_name, **kwargs)
+
+ def get_certificate_policy(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Lists the policy for a certificate.
+
+ The GetCertificatePolicy operation returns the specified certificate policy resources in the
+ specified key vault. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in a given key vault.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_policy')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate_policy(vault_base_url, certificate_name, **kwargs)
+
+ def get_certificate_versions(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """List the versions of a certificate.
+
+ The GetCertificateVersions operation returns the versions of a certificate in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_versions')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate_versions(vault_base_url, certificate_name, maxresults, **kwargs)
+
+ def get_certificates(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ include_pending=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ """List certificates in a specified key vault.
+
+ The GetCertificates operation returns the set of certificates resources in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :param include_pending: Specifies whether to include certificates which are not completely
+ provisioned.
+ :type include_pending: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificates')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificates(vault_base_url, maxresults, include_pending, **kwargs)
+
+ def get_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Retrieves information about the specified deleted certificate.
+
+ The GetDeletedCertificate operation retrieves the deleted certificate information plus its
+ attributes, such as retention interval, scheduled permanent deletion and the current deletion
+ recovery level. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_certificate(vault_base_url, certificate_name, **kwargs)
+
+ def get_deleted_certificates(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ include_pending=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ """Lists the deleted certificates in the specified vault currently available for recovery.
+
+ The GetDeletedCertificates operation retrieves the certificates in the current vault which are
+ in a deleted state and ready for recovery or purging. This operation includes deletion-specific
+ information. This operation requires the certificates/get/list permission. This operation can
+ only be enabled on soft-delete enabled vaults.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :param include_pending: Specifies whether to include certificates which are not completely
+ provisioned.
+ :type include_pending: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedCertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_certificates')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_certificates(vault_base_url, maxresults, include_pending, **kwargs)
+
+ def get_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets the public part of a deleted key.
+
+ The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_key(vault_base_url, key_name, **kwargs)
+
+ def get_deleted_keys(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """Lists the deleted keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a deleted key. This operation includes deletion-specific information. The Get
+ Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.DeletedKeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_keys')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_keys(vault_base_url, maxresults, **kwargs)
+
+ def get_deleted_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets the specified deleted sas definition.
+
+ The Get Deleted SAS Definition operation returns the specified deleted SAS definition along
+ with its attributes. This operation requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_sas_definition')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_sas_definition(vault_base_url, storage_account_name, sas_definition_name, **kwargs)
+
+ def get_deleted_sas_definitions(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """Lists deleted SAS definitions for the specified vault and storage account.
+
+ The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted
+ for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedSasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_sas_definitions')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_sas_definitions(vault_base_url, storage_account_name, maxresults, **kwargs)
+
+ def get_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets the specified deleted secret.
+
+ The Get Deleted Secret operation returns the specified deleted secret along with its
+ attributes. This operation requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_secret(vault_base_url, secret_name, **kwargs)
+
+ def get_deleted_secrets(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """Lists deleted secrets for the specified vault.
+
+ The Get Deleted Secrets operation returns the secrets that have been deleted for a vault
+ enabled for soft-delete. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedSecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_secrets')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_secrets(vault_base_url, maxresults, **kwargs)
+
+ def get_deleted_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets the specified deleted storage account.
+
+ The Get Deleted Storage Account operation returns the specified deleted storage account along
+ with its attributes. This operation requires the storage/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedStorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_storage_account')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ def get_deleted_storage_accounts(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """Lists deleted storage accounts for the specified vault.
+
+ The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted
+ for a vault enabled for soft-delete. This operation requires the storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedStorageListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedStorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_storage_accounts')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_storage_accounts(vault_base_url, maxresults, **kwargs)
+
+ def get_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets the public part of a stored key.
+
+ The get key operation is applicable to all key types. If the requested key is symmetric, then
+ no key material is released in the response. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to get.
+ :type key_name: str
+ :param key_version: Adding the version parameter retrieves a specific version of a key. This
+ URI fragment is optional. If not specified, the latest version of the key is returned.
+ :type key_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_key(vault_base_url, key_name, key_version, **kwargs)
+
+ def get_key_versions(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """Retrieves a list of individual key versions with the same key name.
+
+ The full key identifier, attributes, and tags are provided in the response. This operation
+ requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_key_versions')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_key_versions(vault_base_url, key_name, maxresults, **kwargs)
+
+ def get_keys(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """List keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a stored key. The LIST operation is applicable to all key types, however only
+ the base key identifier, attributes, and tags are provided in the response. Individual versions
+ of a key are not listed in the response. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_keys')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_keys(vault_base_url, maxresults, **kwargs)
+
+ def get_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets information about a SAS definition for the specified storage account. This operation
+ requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_sas_definition')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_sas_definition(vault_base_url, storage_account_name, sas_definition_name, **kwargs)
+
+ def get_sas_definitions(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """List storage SAS definitions for the given storage account. This operation requires the
+ storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_sas_definitions')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_sas_definitions(vault_base_url, storage_account_name, maxresults, **kwargs)
+
+ def get_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ secret_version, # type: str
+ **kwargs # type: Any
+ ):
+ """Get a specified secret from a given key vault.
+
+ The GET operation is applicable to any secret stored in Azure Key Vault. This operation
+ requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret. This URI fragment is optional. If not
+ specified, the latest version of the secret is returned.
+ :type secret_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_secret(vault_base_url, secret_name, secret_version, **kwargs)
+
+ def get_secret_versions(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """List all versions of the specified secret.
+
+ The full secret identifier and attributes are provided in the response. No values are returned
+ for the secrets. This operations requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_secret_versions')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_secret_versions(vault_base_url, secret_name, maxresults, **kwargs)
+
+ def get_secrets(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """List secrets in a specified key vault.
+
+ The Get Secrets operation is applicable to the entire vault. However, only the base secret
+ identifier and its attributes are provided in the response. Individual secret versions are not
+ listed in the response. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_secrets')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_secrets(vault_base_url, maxresults, **kwargs)
+
+ def get_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Gets information about a specified storage account. This operation requires the storage/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_storage_account')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ def get_storage_accounts(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ """List storage accounts managed by the specified key vault. This operation requires the
+ storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either StorageListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.StorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_storage_accounts')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_storage_accounts(vault_base_url, maxresults, **kwargs)
+
+ def import_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateImportParameters"
+ **kwargs # type: Any
+ ):
+ """Imports a certificate into a specified key vault.
+
+ Imports an existing valid certificate, containing a private key, into Azure Key Vault. The
+ certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM
+ format the PEM file must contain the key as well as x509 certificates. This operation requires
+ the certificates/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to import the certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('import_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.import_certificate(vault_base_url, certificate_name, parameters, **kwargs)
+
+ def import_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ parameters, # type: "models.KeyImportParameters"
+ **kwargs # type: Any
+ ):
+ """Imports an externally created key, stores it, and returns key parameters and attributes to the client.
+
+ The import key operation may be used to import any key type into an Azure Key Vault. If the
+ named key already exists, Azure Key Vault creates a new version of the key. This operation
+ requires the keys/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: Name for the imported key.
+ :type key_name: str
+ :param parameters: The parameters to import a key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('import_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.import_key(vault_base_url, key_name, parameters, **kwargs)
+
+ def merge_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateMergeParameters"
+ **kwargs # type: Any
+ ):
+ """Merges a certificate or a certificate chain with a key pair existing on the server.
+
+ The MergeCertificate operation performs the merging of a certificate or certificate chain with
+ a key pair currently available in the service. This operation requires the certificates/create
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to merge certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateMergeParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('merge_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.merge_certificate(vault_base_url, certificate_name, parameters, **kwargs)
+
+ def purge_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Permanently deletes the specified deleted certificate.
+
+ The PurgeDeletedCertificate operation performs an irreversible deletion of the specified
+ certificate, without possibility for recovery. The operation is not available if the recovery
+ level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('purge_deleted_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.purge_deleted_certificate(vault_base_url, certificate_name, **kwargs)
+
+ def purge_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Permanently deletes the specified key.
+
+ The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the
+ operation can be invoked on any vault, it will return an error if invoked on a non soft-delete
+ enabled vault. This operation requires the keys/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('purge_deleted_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.purge_deleted_key(vault_base_url, key_name, **kwargs)
+
+ def purge_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Permanently deletes the specified secret.
+
+ The purge deleted secret operation removes the secret permanently, without the possibility of
+ recovery. This operation can only be enabled on a soft-delete enabled vault. This operation
+ requires the secrets/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('purge_deleted_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.purge_deleted_secret(vault_base_url, secret_name, **kwargs)
+
+ def purge_deleted_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Permanently deletes the specified storage account.
+
+ The purge deleted storage account operation removes the secret permanently, without the
+ possibility of recovery. This operation can only be performed on a soft-delete enabled vault.
+ This operation requires the storage/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('purge_deleted_storage_account')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.purge_deleted_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ def recover_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Recovers the deleted certificate back to its current version under /certificates.
+
+ The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The
+ operation is applicable in vaults enabled for soft-delete, and must be issued during the
+ retention interval (available in the deleted certificate's attributes). This operation requires
+ the certificates/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the deleted certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.recover_deleted_certificate(vault_base_url, certificate_name, **kwargs)
+
+ def recover_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Recovers the deleted key to its latest version.
+
+ The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.
+ It recovers the deleted key back to its latest version under /keys. An attempt to recover an
+ non-deleted key will return an error. Consider this the inverse of the delete operation on
+ soft-delete enabled vaults. This operation requires the keys/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the deleted key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.recover_deleted_key(vault_base_url, key_name, **kwargs)
+
+ def recover_deleted_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Recovers the deleted SAS definition.
+
+ Recovers the deleted SAS definition for the specified storage account. This operation can only
+ be performed on a soft-delete enabled vault. This operation requires the storage/recover
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_sas_definition')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.recover_deleted_sas_definition(vault_base_url, storage_account_name, sas_definition_name, **kwargs)
+
+ def recover_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Recovers the deleted secret to the latest version.
+
+ Recovers the deleted secret in the specified vault. This operation can only be performed on a
+ soft-delete enabled vault. This operation requires the secrets/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the deleted secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.recover_deleted_secret(vault_base_url, secret_name, **kwargs)
+
+ def recover_deleted_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ """Recovers the deleted storage account.
+
+ Recovers the deleted storage account in the specified vault. This operation can only be
+ performed on a soft-delete enabled vault. This operation requires the storage/recover
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_storage_account')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.recover_deleted_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ def regenerate_storage_account_key(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountRegenerteKeyParameters"
+ **kwargs # type: Any
+ ):
+ """Regenerates the specified key value for the given storage account. This operation requires the
+ storage/regeneratekey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to regenerate storage account key.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountRegenerteKeyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('regenerate_storage_account_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.regenerate_storage_account_key(vault_base_url, storage_account_name, parameters, **kwargs)
+
+ def restore_certificate(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.CertificateRestoreParameters"
+ **kwargs # type: Any
+ ):
+ """Restores a backed up certificate to a vault.
+
+ Restores a backed up certificate, and all its versions, to a vault. This operation requires the
+ certificates/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('restore_certificate')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.restore_certificate(vault_base_url, parameters, **kwargs)
+
+ def restore_key(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.KeyRestoreParameters"
+ **kwargs # type: Any
+ ):
+ """Restores a backed up key to a vault.
+
+ Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
+ attributes and access control policies. The RESTORE operation may be used to import a
+ previously backed up key. Individual versions of a key cannot be restored. The key is restored
+ in its entirety with the same key name as it had when it was backed up. If the key name is not
+ available in the target Key Vault, the RESTORE operation will be rejected. While the key name
+ is retained during restore, the final key identifier will change if the key is restored to a
+ different vault. Restore will restore all versions and preserve version identifiers. The
+ RESTORE operation is subject to security constraints: The target Key Vault must be owned by the
+ same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission
+ in the target Key Vault. This operation requires the keys/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('restore_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.restore_key(vault_base_url, parameters, **kwargs)
+
+ def restore_secret(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.SecretRestoreParameters"
+ **kwargs # type: Any
+ ):
+ """Restores a backed up secret to a vault.
+
+ Restores a backed up secret, and all its versions, to a vault. This operation requires the
+ secrets/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the secret.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('restore_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.restore_secret(vault_base_url, parameters, **kwargs)
+
+ def restore_storage_account(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.StorageRestoreParameters"
+ **kwargs # type: Any
+ ):
+ """Restores a backed up storage account to a vault.
+
+ Restores a backed up storage account to a vault. This operation requires the storage/restore
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('restore_storage_account')
+ if api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.restore_storage_account(vault_base_url, parameters, **kwargs)
+
+ def set_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ contacts, # type: "models.Contacts"
+ **kwargs # type: Any
+ ):
+ """Sets the certificate contacts for the specified key vault.
+
+ Sets the certificate contacts for the specified key vault. This operation requires the
+ certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param contacts: The contacts for the key vault certificate.
+ :type contacts: ~azure.keyvault.v7_0.models.Contacts
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_certificate_contacts')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.set_certificate_contacts(vault_base_url, contacts, **kwargs)
+
+ def set_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ parameter, # type: "models.CertificateIssuerSetParameters"
+ **kwargs # type: Any
+ ):
+ """Sets the specified certificate issuer.
+
+ The SetCertificateIssuer operation adds or updates the specified certificate issuer. This
+ operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer set parameter.
+ :type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_certificate_issuer')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.set_certificate_issuer(vault_base_url, issuer_name, parameter, **kwargs)
+
+ def set_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ parameters, # type: "models.SasDefinitionCreateParameters"
+ **kwargs # type: Any
+ ):
+ """Creates or updates a new SAS definition for the specified storage account. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to create a SAS definition.
+ :type parameters: ~azure.keyvault.v7_0.models.SasDefinitionCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_sas_definition')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.set_sas_definition(vault_base_url, storage_account_name, sas_definition_name, parameters, **kwargs)
+
+ def set_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ parameters, # type: "models.SecretSetParameters"
+ **kwargs # type: Any
+ ):
+ """Sets a secret in a specified key vault.
+
+ The SET operation adds a secret to the Azure Key Vault. If the named secret already exists,
+ Azure Key Vault creates a new version of that secret. This operation requires the secrets/set
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param parameters: The parameters for setting the secret.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.set_secret(vault_base_url, secret_name, parameters, **kwargs)
+
+ def set_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountCreateParameters"
+ **kwargs # type: Any
+ ):
+ """Creates or updates a new storage account. This operation requires the storage/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to create a storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_storage_account')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.set_storage_account(vault_base_url, storage_account_name, parameters, **kwargs)
+
+ def sign(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeySignParameters"
+ **kwargs # type: Any
+ ):
+ """Creates a signature from a digest using the specified key.
+
+ The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault
+ since this operation uses the private portion of the key. This operation requires the keys/sign
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the signing operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeySignParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('sign')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.sign(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ def unwrap_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ """Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
+
+ The UNWRAP operation supports decryption of a symmetric key using the target key encryption
+ key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to
+ asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of
+ the key. This operation requires the keys/unwrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the key operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('unwrap_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.unwrap_key(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ def update_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_version, # type: str
+ parameters, # type: "models.CertificateUpdateParameters"
+ **kwargs # type: Any
+ ):
+ """Updates the specified attributes associated with the given certificate.
+
+ The UpdateCertificate operation applies the specified update on the given certificate; the only
+ elements updated are the certificate's attributes. This operation requires the
+ certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given key vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate.
+ :type certificate_version: str
+ :param parameters: The parameters for certificate update.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_certificate')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.update_certificate(vault_base_url, certificate_name, certificate_version, parameters, **kwargs)
+
+ def update_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ parameter, # type: "models.CertificateIssuerUpdateParameters"
+ **kwargs # type: Any
+ ):
+ """Updates the specified certificate issuer.
+
+ The UpdateCertificateIssuer operation performs an update on the specified certificate issuer
+ entity. This operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer update parameter.
+ :type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_certificate_issuer')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.update_certificate_issuer(vault_base_url, issuer_name, parameter, **kwargs)
+
+ def update_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_operation, # type: "models.CertificateOperationUpdateParameter"
+ **kwargs # type: Any
+ ):
+ """Updates a certificate operation.
+
+ Updates a certificate creation operation that is already in progress. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param certificate_operation: The certificate operation response.
+ :type certificate_operation: ~azure.keyvault.v7_0.models.CertificateOperationUpdateParameter
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_certificate_operation')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.update_certificate_operation(vault_base_url, certificate_name, certificate_operation, **kwargs)
+
+ def update_certificate_policy(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_policy, # type: "models.CertificatePolicy"
+ **kwargs # type: Any
+ ):
+ """Updates the policy for a certificate.
+
+ Set specified members in the certificate policy. Leave others as null. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_policy: The policy for the certificate.
+ :type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_certificate_policy')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.update_certificate_policy(vault_base_url, certificate_name, certificate_policy, **kwargs)
+
+ def update_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyUpdateParameters"
+ **kwargs # type: Any
+ ):
+ """The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
+
+ In order to perform this operation, the key must already exist in the Key Vault. Note: The
+ cryptographic material of a key itself cannot be changed. This operation requires the
+ keys/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of key to update.
+ :type key_name: str
+ :param key_version: The version of the key to update.
+ :type key_version: str
+ :param parameters: The parameters of the key to update.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.update_key(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ def update_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ parameters, # type: "models.SasDefinitionUpdateParameters"
+ **kwargs # type: Any
+ ):
+ """Updates the specified attributes associated with the given SAS definition. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to update a SAS definition.
+ :type parameters: ~azure.keyvault.v7_0.models.SasDefinitionUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_sas_definition')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.update_sas_definition(vault_base_url, storage_account_name, sas_definition_name, parameters, **kwargs)
+
+ def update_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ secret_version, # type: str
+ parameters, # type: "models.SecretUpdateParameters"
+ **kwargs # type: Any
+ ):
+ """Updates the attributes associated with a specified secret in a given key vault.
+
+ The UPDATE operation changes specified attributes of an existing stored secret. Attributes that
+ are not specified in the request are left unchanged. The value of a secret itself cannot be
+ changed. This operation requires the secrets/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret.
+ :type secret_version: str
+ :param parameters: The parameters for update secret operation.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_secret')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.update_secret(vault_base_url, secret_name, secret_version, parameters, **kwargs)
+
+ def update_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountUpdateParameters"
+ **kwargs # type: Any
+ ):
+ """Updates the specified attributes associated with the given storage account. This operation
+ requires the storage/set/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to update a storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_storage_account')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.update_storage_account(vault_base_url, storage_account_name, parameters, **kwargs)
+
+ def verify(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyVerifyParameters"
+ **kwargs # type: Any
+ ):
+ """Verifies a signature using a specified key.
+
+ The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not
+ strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification
+ can be performed using the public portion of the key but this operation is supported as a
+ convenience for callers that only have a key-reference and not the public portion of the key.
+ This operation requires the keys/verify permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for verify operations.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyVerifyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyVerifyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyVerifyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('verify')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.verify(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ def wrap_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ """Wraps a symmetric key using a specified key.
+
+ The WRAP operation supports encryption of a symmetric key using a key encryption key that has
+ previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for
+ symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be
+ performed using the public portion of the key. This operation is supported for asymmetric keys
+ as a convenience for callers that have a key-reference but do not have access to the public key
+ material. This operation requires the keys/wrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for wrap operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('wrap_key')
+ if api_version == '2016-10-01':
+ from .v2016_10_01.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from .v7_0.operations import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from .v7_1.operations import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.wrap_key(vault_base_url, key_name, key_version, parameters, **kwargs)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/version.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_version.py
similarity index 66%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/version.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_version.py
index 3c10f7d869d7..a30a458f8b5b 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/version.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/_version.py
@@ -3,11 +3,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
# --------------------------------------------------------------------------
-VERSION = "7.0"
-
+VERSION = "0.1.0"
\ No newline at end of file
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/__init__.py
similarity index 89%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/__init__.py
index fb2e6c3866fd..71ceadebe430 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_async import KeyVaultClient
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/_configuration_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_configuration_async.py
similarity index 70%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/_configuration_async.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_configuration_async.py
index fb961bb4bd2d..6725478d133d 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/_configuration_async.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_configuration_async.py
@@ -8,40 +8,40 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
+from typing import Any
+
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
-from ..version import VERSION
+from .._version import VERSION
class KeyVaultClientConfiguration(Configuration):
- """Configuration for KeyVaultClient
+ """Configuration for KeyVaultClient.
+
Note that all parameters used to create this instance are saved as instance
attributes.
-
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
"""
- def __init__(self, credentials, **kwargs):
-
- if credentials is None:
- raise ValueError("Parameter 'credentials' must not be None.")
-
+ def __init__(
+ self,
+ **kwargs # type: Any
+ ) -> None:
super(KeyVaultClientConfiguration, self).__init__(**kwargs)
- self._configure(**kwargs)
- self.user_agent_policy.add_user_agent('azsdk-python-azure-keyvault/{}'.format(VERSION))
- self.generate_client_request_id = True
-
- self.credentials = credentials
+ kwargs.setdefault('sdk_moniker', 'azure-keyvault/{}'.format(VERSION))
+ self._configure(**kwargs)
- def _configure(self, **kwargs):
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_key_vault_client_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_key_vault_client_async.py
new file mode 100644
index 000000000000..c61be07bf347
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_key_vault_client_async.py
@@ -0,0 +1,157 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from azure.core import AsyncPipelineClient
+from msrest import Serializer, Deserializer
+
+from azure.profiles import KnownProfiles, ProfileDefinition
+from azure.profiles.multiapiclient import MultiApiClientMixin
+from ._configuration_async import KeyVaultClientConfiguration
+from ._operations_mixin_async import KeyVaultClientOperationsMixin
+class _SDKClient(object):
+ def __init__(self, *args, **kwargs):
+ """This is a fake class to support current implemetation of MultiApiClientMixin."
+ Will be removed in final version of multiapi azure-core based client
+ """
+ pass
+
+class KeyVaultClient(KeyVaultClientOperationsMixin, MultiApiClientMixin, _SDKClient):
+ """The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
+
+ This ready contains multiple API versions, to help you deal with all of the Azure clouds
+ (Azure Stack, Azure Government, Azure China, etc.).
+ By default, it uses the latest API version available on public Azure.
+ For production, you should stick to a particular api-version and/or profile.
+ The profile sets a mapping between an operation group and its API version.
+ The api-version parameter sets the default API version if the operation
+ group is not described in the profile.
+ :param str api_version: API version to use if no profile is provided, or if
+ 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'
+ _PROFILE_TAG = "azure.keyvault.KeyVaultClient"
+ LATEST_PROFILE = ProfileDefinition({
+ _PROFILE_TAG: {
+ None: DEFAULT_API_VERSION,
+ 'backup_certificate': '7.0',
+ 'backup_secret': '7.0',
+ 'backup_storage_account': '7.0',
+ 'create_certificate': '7.0',
+ 'delete_certificate': '7.0',
+ 'delete_certificate_contacts': '7.0',
+ 'delete_certificate_issuer': '7.0',
+ 'delete_certificate_operation': '7.0',
+ 'delete_sas_definition': '7.0',
+ 'delete_secret': '7.0',
+ 'delete_storage_account': '7.0',
+ 'get_certificate': '7.0',
+ 'get_certificate_contacts': '7.0',
+ 'get_certificate_issuer': '7.0',
+ 'get_certificate_issuers': '7.0',
+ 'get_certificate_operation': '7.0',
+ 'get_certificate_policy': '7.0',
+ 'get_certificate_versions': '7.0',
+ 'get_certificates': '7.0',
+ 'get_deleted_certificate': '7.0',
+ 'get_deleted_certificates': '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_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_certificate': '7.0',
+ 'merge_certificate': '7.0',
+ 'purge_deleted_certificate': '7.0',
+ 'purge_deleted_secret': '7.0',
+ 'purge_deleted_storage_account': '7.0',
+ 'recover_deleted_certificate': '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_certificate': '7.0',
+ 'restore_secret': '7.0',
+ 'restore_storage_account': '7.0',
+ 'set_certificate_contacts': '7.0',
+ 'set_certificate_issuer': '7.0',
+ 'set_sas_definition': '7.0',
+ 'set_secret': '7.0',
+ 'set_storage_account': '7.0',
+ 'update_certificate': '7.0',
+ 'update_certificate_issuer': '7.0',
+ 'update_certificate_operation': '7.0',
+ 'update_certificate_policy': '7.0',
+ 'update_sas_definition': '7.0',
+ 'update_secret': '7.0',
+ 'update_storage_account': '7.0',
+ }},
+ _PROFILE_TAG + " latest"
+ )
+
+ def __init__(
+ self,
+ api_version=None,
+ profile=KnownProfiles.default,
+ **kwargs # type: Any
+ ) -> None:
+ if api_version == '2016-10-01' or api_version == '7.0' or api_version == '7.1':
+ base_url = '{vaultBaseUrl}'
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ self._config = KeyVaultClientConfiguration(**kwargs)
+ self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)
+ super(KeyVaultClient, self).__init__(
+ api_version=api_version,
+ profile=profile
+ )
+
+ @classmethod
+ def _models_dict(cls, api_version):
+ return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
+
+ @classmethod
+ def models(cls, api_version=DEFAULT_API_VERSION):
+ """Module depends on the API version:
+
+ * 2016-10-01: :mod:`v2016_10_01.models`
+ * 7.0: :mod:`v7_0.models`
+ * 7.1: :mod:`v7_1.models`
+ """
+ if api_version == '2016-10-01':
+ from ..v2016_10_01 import models
+ return models
+ elif api_version == '7.0':
+ from ..v7_0 import models
+ return models
+ elif api_version == '7.1':
+ from ..v7_1 import models
+ return models
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+
+ async def close(self):
+ await self._client.close()
+ async def __aenter__(self):
+ await self._client.__aenter__()
+ return self
+ async def __aexit__(self, *exc_details):
+ await self._client.__aexit__(*exc_details)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_operations_mixin_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_operations_mixin_async.py
new file mode 100644
index 000000000000..577b28779e53
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/aio/_operations_mixin_async.py
@@ -0,0 +1,2899 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+from msrest import Serializer, Deserializer
+from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+
+
+class KeyVaultClientOperationsMixin(object):
+
+ async def backup_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.BackupCertificateResult":
+ """Backs up the specified certificate.
+
+ Requests that a backup of the specified certificate be downloaded to the client. All versions
+ of the certificate will be downloaded. This operation requires the certificates/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupCertificateResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupCertificateResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('backup_certificate')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.backup_certificate(vault_base_url, certificate_name, **kwargs)
+
+ async def backup_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.BackupKeyResult":
+ """Requests that a backup of the specified key be downloaded to the client.
+
+ The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this
+ operation does NOT return key material in a form that can be used outside the Azure Key Vault
+ system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key
+ Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
+ Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.
+ The BACKUP operation may be used to export, in protected form, any key type from Azure Key
+ Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed
+ within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be
+ restored to another geographical area. For example, a backup from the US geographical area
+ cannot be restored in an EU geographical area. This operation requires the key/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupKeyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.BackupKeyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('backup_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.backup_key(vault_base_url, key_name, **kwargs)
+
+ async def backup_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.BackupSecretResult":
+ """Backs up the specified secret.
+
+ Requests that a backup of the specified secret be downloaded to the client. All versions of the
+ secret will be downloaded. This operation requires the secrets/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupSecretResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupSecretResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('backup_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.backup_secret(vault_base_url, secret_name, **kwargs)
+
+ async def backup_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.BackupStorageResult":
+ """Backs up the specified storage account.
+
+ Requests that a backup of the specified storage account be downloaded to the client. This
+ operation requires the storage/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupStorageResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupStorageResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('backup_storage_account')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.backup_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ async def create_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateCreateParameters",
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Creates a new certificate.
+
+ If this is the first version, the certificate resource is created. This operation requires the
+ certificates/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to create a certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('create_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.create_certificate(vault_base_url, certificate_name, parameters, **kwargs)
+
+ async def create_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ parameters: "models.KeyCreateParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Creates a new key, stores it, then returns key parameters and attributes to the client.
+
+ The create key operation can be used to create any key type in Azure Key Vault. If the named
+ key already exists, Azure Key Vault creates a new version of the key. It requires the
+ keys/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name for the new key. The system will generate the version name for the
+ new key.
+ :type key_name: str
+ :param parameters: The parameters to create a key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('create_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.create_key(vault_base_url, key_name, parameters, **kwargs)
+
+ async def decrypt(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Decrypts a single block of encrypted data.
+
+ The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption
+ key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a
+ single block of data may be decrypted, the size of this block is dependent on the target key
+ and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys
+ stored in Azure Key Vault since it uses the private portion of the key. This operation requires
+ the keys/decrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the decryption operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('decrypt')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.decrypt(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ async def delete_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.DeletedCertificateBundle":
+ """Deletes a certificate from a specified key vault.
+
+ Deletes all versions of a certificate object along with its associated policy. Delete
+ certificate cannot be used to remove individual versions of a certificate object. This
+ operation requires the certificates/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.delete_certificate(vault_base_url, certificate_name, **kwargs)
+
+ async def delete_certificate_contacts(
+ self,
+ vault_base_url: str,
+ **kwargs
+ ) -> "models.Contacts":
+ """Deletes the certificate contacts for a specified key vault.
+
+ Deletes the certificate contacts for a specified key vault certificate. This operation requires
+ the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_certificate_contacts')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.delete_certificate_contacts(vault_base_url, **kwargs)
+
+ async def delete_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Deletes the specified certificate issuer.
+
+ The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from
+ the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_certificate_issuer')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.delete_certificate_issuer(vault_base_url, issuer_name, **kwargs)
+
+ async def delete_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Deletes the creation operation for a specific certificate.
+
+ Deletes the creation operation for a specified certificate that is in the process of being
+ created. The certificate is no longer created. This operation requires the certificates/update
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_certificate_operation')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.delete_certificate_operation(vault_base_url, certificate_name, **kwargs)
+
+ async def delete_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.DeletedKeyBundle":
+ """Deletes a key of any type from storage in Azure Key Vault.
+
+ The delete key operation cannot be used to remove individual versions of a key. This operation
+ removes the cryptographic material associated with the key, which means the key is not usable
+ for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
+ keys/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to delete.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.delete_key(vault_base_url, key_name, **kwargs)
+
+ async def delete_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.DeletedSasDefinitionBundle":
+ """Deletes a SAS definition from a specified storage account. This operation requires the
+ storage/deletesas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_sas_definition')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.delete_sas_definition(vault_base_url, storage_account_name, sas_definition_name, **kwargs)
+
+ async def delete_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.DeletedSecretBundle":
+ """Deletes a secret from a specified key vault.
+
+ The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied
+ to an individual version of a secret. This operation requires the secrets/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.delete_secret(vault_base_url, secret_name, **kwargs)
+
+ async def delete_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.DeletedStorageBundle":
+ """Deletes a storage account. This operation requires the storage/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedStorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('delete_storage_account')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.delete_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ async def encrypt(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
+
+ The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
+ stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of
+ data, the size of which is dependent on the target key and the encryption algorithm to be used.
+ The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
+ since protection with an asymmetric key can be performed using public portion of the key. This
+ operation is supported for asymmetric keys as a convenience for callers that have a key-
+ reference but do not have access to the public key material. This operation requires the
+ keys/encrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the encryption operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('encrypt')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.encrypt(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ async def get_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_version: str,
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Gets information about a certificate.
+
+ Gets information about a specific certificate. This operation requires the certificates/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate. This URI fragment is optional. If
+ not specified, the latest version of the certificate is returned.
+ :type certificate_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_certificate(vault_base_url, certificate_name, certificate_version, **kwargs)
+
+ async def get_certificate_contacts(
+ self,
+ vault_base_url: str,
+ **kwargs
+ ) -> "models.Contacts":
+ """Lists the certificate contacts for a specified key vault.
+
+ The GetCertificateContacts operation returns the set of certificate contact resources in the
+ specified key vault. This operation requires the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_contacts')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_certificate_contacts(vault_base_url, **kwargs)
+
+ async def get_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Lists the specified certificate issuer.
+
+ The GetCertificateIssuer operation returns the specified certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_issuer')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_certificate_issuer(vault_base_url, issuer_name, **kwargs)
+
+ def get_certificate_issuers(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.CertificateIssuerListResult"]:
+ """List certificate issuers for a specified key vault.
+
+ The GetCertificateIssuers operation returns the set of certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateIssuerListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_issuers')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate_issuers(vault_base_url, maxresults, **kwargs)
+
+ async def get_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Gets the creation operation of a certificate.
+
+ Gets the creation operation associated with a specified certificate. This operation requires
+ the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_operation')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_certificate_operation(vault_base_url, certificate_name, **kwargs)
+
+ async def get_certificate_policy(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificatePolicy":
+ """Lists the policy for a certificate.
+
+ The GetCertificatePolicy operation returns the specified certificate policy resources in the
+ specified key vault. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in a given key vault.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_policy')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_certificate_policy(vault_base_url, certificate_name, **kwargs)
+
+ def get_certificate_versions(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.CertificateListResult"]:
+ """List the versions of a certificate.
+
+ The GetCertificateVersions operation returns the versions of a certificate in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificate_versions')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificate_versions(vault_base_url, certificate_name, maxresults, **kwargs)
+
+ def get_certificates(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ include_pending: Optional[bool] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.CertificateListResult"]:
+ """List certificates in a specified key vault.
+
+ The GetCertificates operation returns the set of certificates resources in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :param include_pending: Specifies whether to include certificates which are not completely
+ provisioned.
+ :type include_pending: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_certificates')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_certificates(vault_base_url, maxresults, include_pending, **kwargs)
+
+ async def get_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.DeletedCertificateBundle":
+ """Retrieves information about the specified deleted certificate.
+
+ The GetDeletedCertificate operation retrieves the deleted certificate information plus its
+ attributes, such as retention interval, scheduled permanent deletion and the current deletion
+ recovery level. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_deleted_certificate(vault_base_url, certificate_name, **kwargs)
+
+ def get_deleted_certificates(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ include_pending: Optional[bool] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.DeletedCertificateListResult"]:
+ """Lists the deleted certificates in the specified vault currently available for recovery.
+
+ The GetDeletedCertificates operation retrieves the certificates in the current vault which are
+ in a deleted state and ready for recovery or purging. This operation includes deletion-specific
+ information. This operation requires the certificates/get/list permission. This operation can
+ only be enabled on soft-delete enabled vaults.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :param include_pending: Specifies whether to include certificates which are not completely
+ provisioned.
+ :type include_pending: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedCertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_certificates')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_certificates(vault_base_url, maxresults, include_pending, **kwargs)
+
+ async def get_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.DeletedKeyBundle":
+ """Gets the public part of a deleted key.
+
+ The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_deleted_key(vault_base_url, key_name, **kwargs)
+
+ def get_deleted_keys(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.DeletedKeyListResult"]:
+ """Lists the deleted keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a deleted key. This operation includes deletion-specific information. The Get
+ Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.DeletedKeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_keys')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_keys(vault_base_url, maxresults, **kwargs)
+
+ async def get_deleted_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.DeletedSasDefinitionBundle":
+ """Gets the specified deleted sas definition.
+
+ The Get Deleted SAS Definition operation returns the specified deleted SAS definition along
+ with its attributes. This operation requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_sas_definition')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_deleted_sas_definition(vault_base_url, storage_account_name, sas_definition_name, **kwargs)
+
+ def get_deleted_sas_definitions(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.DeletedSasDefinitionListResult"]:
+ """Lists deleted SAS definitions for the specified vault and storage account.
+
+ The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted
+ for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedSasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_sas_definitions')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_sas_definitions(vault_base_url, storage_account_name, maxresults, **kwargs)
+
+ async def get_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.DeletedSecretBundle":
+ """Gets the specified deleted secret.
+
+ The Get Deleted Secret operation returns the specified deleted secret along with its
+ attributes. This operation requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_deleted_secret(vault_base_url, secret_name, **kwargs)
+
+ def get_deleted_secrets(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.DeletedSecretListResult"]:
+ """Lists deleted secrets for the specified vault.
+
+ The Get Deleted Secrets operation returns the secrets that have been deleted for a vault
+ enabled for soft-delete. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedSecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_secrets')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_secrets(vault_base_url, maxresults, **kwargs)
+
+ async def get_deleted_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.DeletedStorageBundle":
+ """Gets the specified deleted storage account.
+
+ The Get Deleted Storage Account operation returns the specified deleted storage account along
+ with its attributes. This operation requires the storage/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedStorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_storage_account')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_deleted_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ def get_deleted_storage_accounts(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.DeletedStorageListResult"]:
+ """Lists deleted storage accounts for the specified vault.
+
+ The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted
+ for a vault enabled for soft-delete. This operation requires the storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedStorageListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedStorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_deleted_storage_accounts')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_deleted_storage_accounts(vault_base_url, maxresults, **kwargs)
+
+ async def get_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Gets the public part of a stored key.
+
+ The get key operation is applicable to all key types. If the requested key is symmetric, then
+ no key material is released in the response. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to get.
+ :type key_name: str
+ :param key_version: Adding the version parameter retrieves a specific version of a key. This
+ URI fragment is optional. If not specified, the latest version of the key is returned.
+ :type key_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_key(vault_base_url, key_name, key_version, **kwargs)
+
+ def get_key_versions(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.KeyListResult"]:
+ """Retrieves a list of individual key versions with the same key name.
+
+ The full key identifier, attributes, and tags are provided in the response. This operation
+ requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_key_versions')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_key_versions(vault_base_url, key_name, maxresults, **kwargs)
+
+ def get_keys(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.KeyListResult"]:
+ """List keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a stored key. The LIST operation is applicable to all key types, however only
+ the base key identifier, attributes, and tags are provided in the response. Individual versions
+ of a key are not listed in the response. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_keys')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_keys(vault_base_url, maxresults, **kwargs)
+
+ async def get_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Gets information about a SAS definition for the specified storage account. This operation
+ requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_sas_definition')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_sas_definition(vault_base_url, storage_account_name, sas_definition_name, **kwargs)
+
+ def get_sas_definitions(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.SasDefinitionListResult"]:
+ """List storage SAS definitions for the given storage account. This operation requires the
+ storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_sas_definitions')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_sas_definitions(vault_base_url, storage_account_name, maxresults, **kwargs)
+
+ async def get_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ secret_version: str,
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Get a specified secret from a given key vault.
+
+ The GET operation is applicable to any secret stored in Azure Key Vault. This operation
+ requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret. This URI fragment is optional. If not
+ specified, the latest version of the secret is returned.
+ :type secret_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_secret(vault_base_url, secret_name, secret_version, **kwargs)
+
+ def get_secret_versions(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.SecretListResult"]:
+ """List all versions of the specified secret.
+
+ The full secret identifier and attributes are provided in the response. No values are returned
+ for the secrets. This operations requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_secret_versions')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_secret_versions(vault_base_url, secret_name, maxresults, **kwargs)
+
+ def get_secrets(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.SecretListResult"]:
+ """List secrets in a specified key vault.
+
+ The Get Secrets operation is applicable to the entire vault. However, only the base secret
+ identifier and its attributes are provided in the response. Individual secret versions are not
+ listed in the response. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_secrets')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_secrets(vault_base_url, maxresults, **kwargs)
+
+ async def get_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Gets information about a specified storage account. This operation requires the storage/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_storage_account')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.get_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ def get_storage_accounts(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncItemPaged["models.StorageListResult"]:
+ """List storage accounts managed by the specified key vault. This operation requires the
+ storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either StorageListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.StorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('get_storage_accounts')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return mixin_instance.get_storage_accounts(vault_base_url, maxresults, **kwargs)
+
+ async def import_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateImportParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Imports a certificate into a specified key vault.
+
+ Imports an existing valid certificate, containing a private key, into Azure Key Vault. The
+ certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM
+ format the PEM file must contain the key as well as x509 certificates. This operation requires
+ the certificates/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to import the certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('import_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.import_certificate(vault_base_url, certificate_name, parameters, **kwargs)
+
+ async def import_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ parameters: "models.KeyImportParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Imports an externally created key, stores it, and returns key parameters and attributes to the client.
+
+ The import key operation may be used to import any key type into an Azure Key Vault. If the
+ named key already exists, Azure Key Vault creates a new version of the key. This operation
+ requires the keys/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: Name for the imported key.
+ :type key_name: str
+ :param parameters: The parameters to import a key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('import_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.import_key(vault_base_url, key_name, parameters, **kwargs)
+
+ async def merge_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateMergeParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Merges a certificate or a certificate chain with a key pair existing on the server.
+
+ The MergeCertificate operation performs the merging of a certificate or certificate chain with
+ a key pair currently available in the service. This operation requires the certificates/create
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to merge certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateMergeParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('merge_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.merge_certificate(vault_base_url, certificate_name, parameters, **kwargs)
+
+ async def purge_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified deleted certificate.
+
+ The PurgeDeletedCertificate operation performs an irreversible deletion of the specified
+ certificate, without possibility for recovery. The operation is not available if the recovery
+ level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('purge_deleted_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.purge_deleted_certificate(vault_base_url, certificate_name, **kwargs)
+
+ async def purge_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified key.
+
+ The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the
+ operation can be invoked on any vault, it will return an error if invoked on a non soft-delete
+ enabled vault. This operation requires the keys/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('purge_deleted_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.purge_deleted_key(vault_base_url, key_name, **kwargs)
+
+ async def purge_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified secret.
+
+ The purge deleted secret operation removes the secret permanently, without the possibility of
+ recovery. This operation can only be enabled on a soft-delete enabled vault. This operation
+ requires the secrets/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('purge_deleted_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.purge_deleted_secret(vault_base_url, secret_name, **kwargs)
+
+ async def purge_deleted_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified storage account.
+
+ The purge deleted storage account operation removes the secret permanently, without the
+ possibility of recovery. This operation can only be performed on a soft-delete enabled vault.
+ This operation requires the storage/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('purge_deleted_storage_account')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.purge_deleted_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ async def recover_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Recovers the deleted certificate back to its current version under /certificates.
+
+ The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The
+ operation is applicable in vaults enabled for soft-delete, and must be issued during the
+ retention interval (available in the deleted certificate's attributes). This operation requires
+ the certificates/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the deleted certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.recover_deleted_certificate(vault_base_url, certificate_name, **kwargs)
+
+ async def recover_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Recovers the deleted key to its latest version.
+
+ The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.
+ It recovers the deleted key back to its latest version under /keys. An attempt to recover an
+ non-deleted key will return an error. Consider this the inverse of the delete operation on
+ soft-delete enabled vaults. This operation requires the keys/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the deleted key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.recover_deleted_key(vault_base_url, key_name, **kwargs)
+
+ async def recover_deleted_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Recovers the deleted SAS definition.
+
+ Recovers the deleted SAS definition for the specified storage account. This operation can only
+ be performed on a soft-delete enabled vault. This operation requires the storage/recover
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_sas_definition')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.recover_deleted_sas_definition(vault_base_url, storage_account_name, sas_definition_name, **kwargs)
+
+ async def recover_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Recovers the deleted secret to the latest version.
+
+ Recovers the deleted secret in the specified vault. This operation can only be performed on a
+ soft-delete enabled vault. This operation requires the secrets/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the deleted secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.recover_deleted_secret(vault_base_url, secret_name, **kwargs)
+
+ async def recover_deleted_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Recovers the deleted storage account.
+
+ Recovers the deleted storage account in the specified vault. This operation can only be
+ performed on a soft-delete enabled vault. This operation requires the storage/recover
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('recover_deleted_storage_account')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.recover_deleted_storage_account(vault_base_url, storage_account_name, **kwargs)
+
+ async def regenerate_storage_account_key(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountRegenerteKeyParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Regenerates the specified key value for the given storage account. This operation requires the
+ storage/regeneratekey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to regenerate storage account key.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountRegenerteKeyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('regenerate_storage_account_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.regenerate_storage_account_key(vault_base_url, storage_account_name, parameters, **kwargs)
+
+ async def restore_certificate(
+ self,
+ vault_base_url: str,
+ parameters: "models.CertificateRestoreParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Restores a backed up certificate to a vault.
+
+ Restores a backed up certificate, and all its versions, to a vault. This operation requires the
+ certificates/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('restore_certificate')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.restore_certificate(vault_base_url, parameters, **kwargs)
+
+ async def restore_key(
+ self,
+ vault_base_url: str,
+ parameters: "models.KeyRestoreParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Restores a backed up key to a vault.
+
+ Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
+ attributes and access control policies. The RESTORE operation may be used to import a
+ previously backed up key. Individual versions of a key cannot be restored. The key is restored
+ in its entirety with the same key name as it had when it was backed up. If the key name is not
+ available in the target Key Vault, the RESTORE operation will be rejected. While the key name
+ is retained during restore, the final key identifier will change if the key is restored to a
+ different vault. Restore will restore all versions and preserve version identifiers. The
+ RESTORE operation is subject to security constraints: The target Key Vault must be owned by the
+ same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission
+ in the target Key Vault. This operation requires the keys/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('restore_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.restore_key(vault_base_url, parameters, **kwargs)
+
+ async def restore_secret(
+ self,
+ vault_base_url: str,
+ parameters: "models.SecretRestoreParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Restores a backed up secret to a vault.
+
+ Restores a backed up secret, and all its versions, to a vault. This operation requires the
+ secrets/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the secret.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('restore_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.restore_secret(vault_base_url, parameters, **kwargs)
+
+ async def restore_storage_account(
+ self,
+ vault_base_url: str,
+ parameters: "models.StorageRestoreParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Restores a backed up storage account to a vault.
+
+ Restores a backed up storage account to a vault. This operation requires the storage/restore
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('restore_storage_account')
+ if api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.restore_storage_account(vault_base_url, parameters, **kwargs)
+
+ async def set_certificate_contacts(
+ self,
+ vault_base_url: str,
+ contacts: "models.Contacts",
+ **kwargs
+ ) -> "models.Contacts":
+ """Sets the certificate contacts for the specified key vault.
+
+ Sets the certificate contacts for the specified key vault. This operation requires the
+ certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param contacts: The contacts for the key vault certificate.
+ :type contacts: ~azure.keyvault.v7_0.models.Contacts
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_certificate_contacts')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.set_certificate_contacts(vault_base_url, contacts, **kwargs)
+
+ async def set_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ parameter: "models.CertificateIssuerSetParameters",
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Sets the specified certificate issuer.
+
+ The SetCertificateIssuer operation adds or updates the specified certificate issuer. This
+ operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer set parameter.
+ :type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_certificate_issuer')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.set_certificate_issuer(vault_base_url, issuer_name, parameter, **kwargs)
+
+ async def set_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ parameters: "models.SasDefinitionCreateParameters",
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Creates or updates a new SAS definition for the specified storage account. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to create a SAS definition.
+ :type parameters: ~azure.keyvault.v7_0.models.SasDefinitionCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_sas_definition')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.set_sas_definition(vault_base_url, storage_account_name, sas_definition_name, parameters, **kwargs)
+
+ async def set_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ parameters: "models.SecretSetParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Sets a secret in a specified key vault.
+
+ The SET operation adds a secret to the Azure Key Vault. If the named secret already exists,
+ Azure Key Vault creates a new version of that secret. This operation requires the secrets/set
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param parameters: The parameters for setting the secret.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.set_secret(vault_base_url, secret_name, parameters, **kwargs)
+
+ async def set_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountCreateParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Creates or updates a new storage account. This operation requires the storage/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to create a storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('set_storage_account')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.set_storage_account(vault_base_url, storage_account_name, parameters, **kwargs)
+
+ async def sign(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeySignParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Creates a signature from a digest using the specified key.
+
+ The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault
+ since this operation uses the private portion of the key. This operation requires the keys/sign
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the signing operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeySignParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('sign')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.sign(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ async def unwrap_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
+
+ The UNWRAP operation supports decryption of a symmetric key using the target key encryption
+ key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to
+ asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of
+ the key. This operation requires the keys/unwrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the key operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('unwrap_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.unwrap_key(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ async def update_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_version: str,
+ parameters: "models.CertificateUpdateParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Updates the specified attributes associated with the given certificate.
+
+ The UpdateCertificate operation applies the specified update on the given certificate; the only
+ elements updated are the certificate's attributes. This operation requires the
+ certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given key vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate.
+ :type certificate_version: str
+ :param parameters: The parameters for certificate update.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_certificate')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.update_certificate(vault_base_url, certificate_name, certificate_version, parameters, **kwargs)
+
+ async def update_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ parameter: "models.CertificateIssuerUpdateParameters",
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Updates the specified certificate issuer.
+
+ The UpdateCertificateIssuer operation performs an update on the specified certificate issuer
+ entity. This operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer update parameter.
+ :type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_certificate_issuer')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.update_certificate_issuer(vault_base_url, issuer_name, parameter, **kwargs)
+
+ async def update_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_operation: "models.CertificateOperationUpdateParameter",
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Updates a certificate operation.
+
+ Updates a certificate creation operation that is already in progress. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param certificate_operation: The certificate operation response.
+ :type certificate_operation: ~azure.keyvault.v7_0.models.CertificateOperationUpdateParameter
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_certificate_operation')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.update_certificate_operation(vault_base_url, certificate_name, certificate_operation, **kwargs)
+
+ async def update_certificate_policy(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_policy: "models.CertificatePolicy",
+ **kwargs
+ ) -> "models.CertificatePolicy":
+ """Updates the policy for a certificate.
+
+ Set specified members in the certificate policy. Leave others as null. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_policy: The policy for the certificate.
+ :type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_certificate_policy')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.update_certificate_policy(vault_base_url, certificate_name, certificate_policy, **kwargs)
+
+ async def update_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyUpdateParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
+
+ In order to perform this operation, the key must already exist in the Key Vault. Note: The
+ cryptographic material of a key itself cannot be changed. This operation requires the
+ keys/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of key to update.
+ :type key_name: str
+ :param key_version: The version of the key to update.
+ :type key_version: str
+ :param parameters: The parameters of the key to update.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.update_key(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ async def update_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ parameters: "models.SasDefinitionUpdateParameters",
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Updates the specified attributes associated with the given SAS definition. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to update a SAS definition.
+ :type parameters: ~azure.keyvault.v7_0.models.SasDefinitionUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_sas_definition')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.update_sas_definition(vault_base_url, storage_account_name, sas_definition_name, parameters, **kwargs)
+
+ async def update_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ secret_version: str,
+ parameters: "models.SecretUpdateParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Updates the attributes associated with a specified secret in a given key vault.
+
+ The UPDATE operation changes specified attributes of an existing stored secret. Attributes that
+ are not specified in the request are left unchanged. The value of a secret itself cannot be
+ changed. This operation requires the secrets/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret.
+ :type secret_version: str
+ :param parameters: The parameters for update secret operation.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_secret')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.update_secret(vault_base_url, secret_name, secret_version, parameters, **kwargs)
+
+ async def update_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountUpdateParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Updates the specified attributes associated with the given storage account. This operation
+ requires the storage/set/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to update a storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('update_storage_account')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.update_storage_account(vault_base_url, storage_account_name, parameters, **kwargs)
+
+ async def verify(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyVerifyParameters",
+ **kwargs
+ ) -> "models.KeyVerifyResult":
+ """Verifies a signature using a specified key.
+
+ The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not
+ strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification
+ can be performed using the public portion of the key but this operation is supported as a
+ convenience for callers that only have a key-reference and not the public portion of the key.
+ This operation requires the keys/verify permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for verify operations.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyVerifyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyVerifyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyVerifyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('verify')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.verify(vault_base_url, key_name, key_version, parameters, **kwargs)
+
+ async def wrap_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Wraps a symmetric key using a specified key.
+
+ The WRAP operation supports encryption of a symmetric key using a key encryption key that has
+ previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for
+ symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be
+ performed using the public portion of the key. This operation is supported for asymmetric keys
+ as a convenience for callers that have a key-reference but do not have access to the public key
+ material. This operation requires the keys/wrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for wrap operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ api_version = self._get_api_version('wrap_key')
+ if api_version == '2016-10-01':
+ from ..v2016_10_01.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.0':
+ from ..v7_0.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ elif api_version == '7.1':
+ from ..v7_1.aio.operations_async import KeyVaultClientOperationsMixin as OperationClass
+ else:
+ raise NotImplementedError("APIVersion {} is not available".format(api_version))
+ mixin_instance = OperationClass()
+ mixin_instance._client = self._client
+ mixin_instance._config = self._config
+ mixin_instance._serialize = Serializer(self._models_dict(api_version))
+ mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
+ return await mixin_instance.wrap_key(vault_base_url, key_name, key_version, parameters, **kwargs)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/version.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/models.py
similarity index 65%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/version.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/models.py
index d92d63667368..d80a03e1dcdd 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/version.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/models.py
@@ -3,11 +3,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
# --------------------------------------------------------------------------
-
-VERSION = "7.1-preview"
-
+from .v7_0.models import *
+from .v7_1.models import *
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/py.typed b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/py.typed
new file mode 100644
index 000000000000..e5aff4f83af8
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/__init__.py
similarity index 76%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/__init__.py
index e913d4cf6c46..a6c1f9b7a792 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/__init__.py
@@ -1,18 +1,16 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client import KeyVaultClient
__all__ = ['KeyVaultClient']
-from .version import VERSION
-
-__version__ = VERSION
-
+try:
+ from ._patch import patch_sdk # type: ignore
+ patch_sdk()
+except ImportError:
+ pass
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_configuration.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_configuration.py
new file mode 100644
index 000000000000..7854732a1c08
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_configuration.py
@@ -0,0 +1,52 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import TYPE_CHECKING
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
+
+VERSION = "unknown"
+
+class KeyVaultClientConfiguration(Configuration):
+ """Configuration for KeyVaultClient.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ """
+
+ def __init__(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ super(KeyVaultClientConfiguration, self).__init__(**kwargs)
+
+ self.api_version = "2016-10-01"
+ kwargs.setdefault('sdk_moniker', 'keyvault/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/_key_vault_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_key_vault_client.py
similarity index 69%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/_key_vault_client.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_key_vault_client.py
index f380f67e0a87..d9db79ab8785 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/_key_vault_client.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_key_vault_client.py
@@ -1,16 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+
from azure.core import PipelineClient
-from msrest import Serializer, Deserializer
+from msrest import Deserializer, Serializer
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
from ._configuration import KeyVaultClientConfiguration
from .operations import KeyVaultClientOperationsMixin
@@ -20,29 +23,32 @@
class KeyVaultClient(KeyVaultClientOperationsMixin):
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
-
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
def __init__(
- self, credentials, **kwargs):
-
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
base_url = '{vaultBaseUrl}'
- self._config = KeyVaultClientConfiguration(credentials, **kwargs)
+ self._config = KeyVaultClientConfiguration(**kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
- self.api_version = '7.1-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
def close(self):
+ # type: () -> None
self._client.close()
+
def __enter__(self):
+ # type: () -> KeyVaultClient
self._client.__enter__()
return self
+
def __exit__(self, *exc_details):
+ # type: (Any) -> None
self._client.__exit__(*exc_details)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_metadata.json b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_metadata.json
new file mode 100644
index 000000000000..ec6b44c0477e
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/_metadata.json
@@ -0,0 +1,837 @@
+{
+ "chosen_version": "2016-10-01",
+ "total_api_version_list": ["2016-10-01"],
+ "client": {
+ "name": "KeyVaultClient",
+ "filename": "_key_vault_client",
+ "description": "The key vault client performs cryptographic key operations and vault operations against the Key Vault service.",
+ "base_url": null,
+ "custom_base_url": "\u0027{vaultBaseUrl}\u0027",
+ "azure_arm": false
+ },
+ "global_parameters": {
+ "sync_method": {
+ },
+ "async_method": {
+ },
+ "constant": {
+ },
+ "call": ""
+ },
+ "config": {
+ "credential": false,
+ "credential_scopes": null,
+ "credential_default_policy_type": "BearerTokenCredentialPolicy",
+ "credential_default_policy_type_has_async_version": true
+ },
+ "operation_groups": {
+ },
+ "operation_mixins": {
+ "create_key" : {
+ "sync": {
+ "signature": "def create_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n parameters, # type: \"models.KeyCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates a new key, stores it, then returns key parameters and attributes to the client.\n\nThe create key operation can be used to create any key type in Azure Key Vault. If the named\nkey already exists, Azure Key Vault creates a new version of the key. It requires the\nkeys/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name for the new key. The system will generate the version name for the\n new key.\n:type key_name: str\n:param parameters: The parameters to create a key.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def create_key(\n self,\n vault_base_url: str,\n key_name: str,\n parameters: \"models.KeyCreateParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Creates a new key, stores it, then returns key parameters and attributes to the client.\n\nThe create key operation can be used to create any key type in Azure Key Vault. If the named\nkey already exists, Azure Key Vault creates a new version of the key. It requires the\nkeys/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name for the new key. The system will generate the version name for the\n new key.\n:type key_name: str\n:param parameters: The parameters to create a key.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, parameters"
+ },
+ "import_key" : {
+ "sync": {
+ "signature": "def import_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n parameters, # type: \"models.KeyImportParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Imports an externally created key, stores it, and returns key parameters and attributes to the client.\n\nThe import key operation may be used to import any key type into an Azure Key Vault. If the\nnamed key already exists, Azure Key Vault creates a new version of the key. This operation\nrequires the keys/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: Name for the imported key.\n:type key_name: str\n:param parameters: The parameters to import a key.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def import_key(\n self,\n vault_base_url: str,\n key_name: str,\n parameters: \"models.KeyImportParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Imports an externally created key, stores it, and returns key parameters and attributes to the client.\n\nThe import key operation may be used to import any key type into an Azure Key Vault. If the\nnamed key already exists, Azure Key Vault creates a new version of the key. This operation\nrequires the keys/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: Name for the imported key.\n:type key_name: str\n:param parameters: The parameters to import a key.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, parameters"
+ },
+ "delete_key" : {
+ "sync": {
+ "signature": "def delete_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a key of any type from storage in Azure Key Vault.\n\nThe delete key operation cannot be used to remove individual versions of a key. This operation\nremoves the cryptographic material associated with the key, which means the key is not usable\nfor Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the\nkeys/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to delete.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.DeletedKeyBundle\":\n",
+ "doc": "\"\"\"Deletes a key of any type from storage in Azure Key Vault.\n\nThe delete key operation cannot be used to remove individual versions of a key. This operation\nremoves the cryptographic material associated with the key, which means the key is not usable\nfor Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the\nkeys/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to delete.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "update_key" : {
+ "sync": {
+ "signature": "def update_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.\n\nIn order to perform this operation, the key must already exist in the Key Vault. Note: The\ncryptographic material of a key itself cannot be changed. This operation requires the\nkeys/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of key to update.\n:type key_name: str\n:param key_version: The version of the key to update.\n:type key_version: str\n:param parameters: The parameters of the key to update.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyUpdateParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.\n\nIn order to perform this operation, the key must already exist in the Key Vault. Note: The\ncryptographic material of a key itself cannot be changed. This operation requires the\nkeys/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of key to update.\n:type key_name: str\n:param key_version: The version of the key to update.\n:type key_version: str\n:param parameters: The parameters of the key to update.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "get_key" : {
+ "sync": {
+ "signature": "def get_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the public part of a stored key.\n\nThe get key operation is applicable to all key types. If the requested key is symmetric, then\nno key material is released in the response. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to get.\n:type key_name: str\n:param key_version: Adding the version parameter retrieves a specific version of a key.\n:type key_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Gets the public part of a stored key.\n\nThe get key operation is applicable to all key types. If the requested key is symmetric, then\nno key material is released in the response. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to get.\n:type key_name: str\n:param key_version: Adding the version parameter retrieves a specific version of a key.\n:type key_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version"
+ },
+ "get_key_versions" : {
+ "sync": {
+ "signature": "def get_key_versions(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Retrieves a list of individual key versions with the same key name.\n\nThe full key identifier, attributes, and tags are provided in the response. This operation\nrequires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_key_versions(\n self,\n vault_base_url: str,\n key_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.KeyListResult\"]:\n",
+ "doc": "\"\"\"Retrieves a list of individual key versions with the same key name.\n\nThe full key identifier, attributes, and tags are provided in the response. This operation\nrequires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, maxresults"
+ },
+ "get_keys" : {
+ "sync": {
+ "signature": "def get_keys(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a stored key. The LIST operation is applicable to all key types, however only\nthe base key identifier, attributes, and tags are provided in the response. Individual versions\nof a key are not listed in the response. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_keys(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.KeyListResult\"]:\n",
+ "doc": "\"\"\"List keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a stored key. The LIST operation is applicable to all key types, however only\nthe base key identifier, attributes, and tags are provided in the response. Individual versions\nof a key are not listed in the response. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "backup_key" : {
+ "sync": {
+ "signature": "def backup_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Requests that a backup of the specified key be downloaded to the client.\n\nThe Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this\noperation does NOT return key material in a form that can be used outside the Azure Key Vault\nsystem, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key\nVault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure\nKey Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.\nThe BACKUP operation may be used to export, in protected form, any key type from Azure Key\nVault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed\nwithin geographical boundaries only; meaning that a BACKUP from one geographical area cannot be\nrestored to another geographical area. For example, a backup from the US geographical area\ncannot be restored in an EU geographical area. This operation requires the key/backup\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupKeyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.BackupKeyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def backup_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.BackupKeyResult\":\n",
+ "doc": "\"\"\"Requests that a backup of the specified key be downloaded to the client.\n\nThe Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this\noperation does NOT return key material in a form that can be used outside the Azure Key Vault\nsystem, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key\nVault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure\nKey Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.\nThe BACKUP operation may be used to export, in protected form, any key type from Azure Key\nVault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed\nwithin geographical boundaries only; meaning that a BACKUP from one geographical area cannot be\nrestored to another geographical area. For example, a backup from the US geographical area\ncannot be restored in an EU geographical area. This operation requires the key/backup\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupKeyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.BackupKeyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "restore_key" : {
+ "sync": {
+ "signature": "def restore_key(\n self,\n vault_base_url, # type: str\n parameters, # type: \"models.KeyRestoreParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Restores a backed up key to a vault.\n\nImports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,\nattributes and access control policies. The RESTORE operation may be used to import a\npreviously backed up key. Individual versions of a key cannot be restored. The key is restored\nin its entirety with the same key name as it had when it was backed up. If the key name is not\navailable in the target Key Vault, the RESTORE operation will be rejected. While the key name\nis retained during restore, the final key identifier will change if the key is restored to a\ndifferent vault. Restore will restore all versions and preserve version identifiers. The\nRESTORE operation is subject to security constraints: The target Key Vault must be owned by the\nsame Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission\nin the target Key Vault. This operation requires the keys/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the key.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def restore_key(\n self,\n vault_base_url: str,\n parameters: \"models.KeyRestoreParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Restores a backed up key to a vault.\n\nImports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,\nattributes and access control policies. The RESTORE operation may be used to import a\npreviously backed up key. Individual versions of a key cannot be restored. The key is restored\nin its entirety with the same key name as it had when it was backed up. If the key name is not\navailable in the target Key Vault, the RESTORE operation will be rejected. While the key name\nis retained during restore, the final key identifier will change if the key is restored to a\ndifferent vault. Restore will restore all versions and preserve version identifiers. The\nRESTORE operation is subject to security constraints: The target Key Vault must be owned by the\nsame Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission\nin the target Key Vault. This operation requires the keys/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the key.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, parameters"
+ },
+ "encrypt" : {
+ "sync": {
+ "signature": "def encrypt(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.\n\nThe ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is\nstored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of\ndata, the size of which is dependent on the target key and the encryption algorithm to be used.\nThe ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault\nsince protection with an asymmetric key can be performed using public portion of the key. This\noperation is supported for asymmetric keys as a convenience for callers that have a key-\nreference but do not have access to the public key material. This operation requires the\nkeys/encrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the encryption operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def encrypt(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.\n\nThe ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is\nstored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of\ndata, the size of which is dependent on the target key and the encryption algorithm to be used.\nThe ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault\nsince protection with an asymmetric key can be performed using public portion of the key. This\noperation is supported for asymmetric keys as a convenience for callers that have a key-\nreference but do not have access to the public key material. This operation requires the\nkeys/encrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the encryption operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "decrypt" : {
+ "sync": {
+ "signature": "def decrypt(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Decrypts a single block of encrypted data.\n\nThe DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption\nkey and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a\nsingle block of data may be decrypted, the size of this block is dependent on the target key\nand the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys\nstored in Azure Key Vault since it uses the private portion of the key. This operation requires\nthe keys/decrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the decryption operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def decrypt(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Decrypts a single block of encrypted data.\n\nThe DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption\nkey and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a\nsingle block of data may be decrypted, the size of this block is dependent on the target key\nand the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys\nstored in Azure Key Vault since it uses the private portion of the key. This operation requires\nthe keys/decrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the decryption operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "sign" : {
+ "sync": {
+ "signature": "def sign(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeySignParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates a signature from a digest using the specified key.\n\nThe SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault\nsince this operation uses the private portion of the key. This operation requires the keys/sign\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the signing operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeySignParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def sign(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeySignParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Creates a signature from a digest using the specified key.\n\nThe SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault\nsince this operation uses the private portion of the key. This operation requires the keys/sign\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the signing operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeySignParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "verify" : {
+ "sync": {
+ "signature": "def verify(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyVerifyParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Verifies a signature using a specified key.\n\nThe VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not\nstrictly necessary for asymmetric keys stored in Azure Key Vault since signature verification\ncan be performed using the public portion of the key but this operation is supported as a\nconvenience for callers that only have a key-reference and not the public portion of the key.\nThis operation requires the keys/verify permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for verify operations.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyVerifyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyVerifyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyVerifyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def verify(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyVerifyParameters\",\n **kwargs\n) -\u003e \"models.KeyVerifyResult\":\n",
+ "doc": "\"\"\"Verifies a signature using a specified key.\n\nThe VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not\nstrictly necessary for asymmetric keys stored in Azure Key Vault since signature verification\ncan be performed using the public portion of the key but this operation is supported as a\nconvenience for callers that only have a key-reference and not the public portion of the key.\nThis operation requires the keys/verify permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for verify operations.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyVerifyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyVerifyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyVerifyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "wrap_key" : {
+ "sync": {
+ "signature": "def wrap_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Wraps a symmetric key using a specified key.\n\nThe WRAP operation supports encryption of a symmetric key using a key encryption key that has\npreviously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for\nsymmetric keys stored in Azure Key Vault since protection with an asymmetric key can be\nperformed using the public portion of the key. This operation is supported for asymmetric keys\nas a convenience for callers that have a key-reference but do not have access to the public key\nmaterial. This operation requires the keys/wrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for wrap operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def wrap_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Wraps a symmetric key using a specified key.\n\nThe WRAP operation supports encryption of a symmetric key using a key encryption key that has\npreviously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for\nsymmetric keys stored in Azure Key Vault since protection with an asymmetric key can be\nperformed using the public portion of the key. This operation is supported for asymmetric keys\nas a convenience for callers that have a key-reference but do not have access to the public key\nmaterial. This operation requires the keys/wrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for wrap operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "unwrap_key" : {
+ "sync": {
+ "signature": "def unwrap_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Unwraps a symmetric key using the specified key that was initially used for wrapping that key.\n\nThe UNWRAP operation supports decryption of a symmetric key using the target key encryption\nkey. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to\nasymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of\nthe key. This operation requires the keys/unwrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the key operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def unwrap_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Unwraps a symmetric key using the specified key that was initially used for wrapping that key.\n\nThe UNWRAP operation supports decryption of a symmetric key using the target key encryption\nkey. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to\nasymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of\nthe key. This operation requires the keys/unwrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the key operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "get_deleted_keys" : {
+ "sync": {
+ "signature": "def get_deleted_keys(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the deleted keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a deleted key. This operation includes deletion-specific information. The Get\nDeleted Keys operation is applicable for vaults enabled for soft-delete. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedKeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_keys(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedKeyListResult\"]:\n",
+ "doc": "\"\"\"Lists the deleted keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a deleted key. This operation includes deletion-specific information. The Get\nDeleted Keys operation is applicable for vaults enabled for soft-delete. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedKeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_deleted_key" : {
+ "sync": {
+ "signature": "def get_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the public part of a deleted key.\n\nThe Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.DeletedKeyBundle\":\n",
+ "doc": "\"\"\"Gets the public part of a deleted key.\n\nThe Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "purge_deleted_key" : {
+ "sync": {
+ "signature": "def purge_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Permanently deletes the specified key.\n\nThe Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the\noperation can be invoked on any vault, it will return an error if invoked on a non soft-delete\nenabled vault. This operation requires the keys/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def purge_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e None:\n",
+ "doc": "\"\"\"Permanently deletes the specified key.\n\nThe Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the\noperation can be invoked on any vault, it will return an error if invoked on a non soft-delete\nenabled vault. This operation requires the keys/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "recover_deleted_key" : {
+ "sync": {
+ "signature": "def recover_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted key to its latest version.\n\nThe Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.\nIt recovers the deleted key back to its latest version under /keys. An attempt to recover an\nnon-deleted key will return an error. Consider this the inverse of the delete operation on\nsoft-delete enabled vaults. This operation requires the keys/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the deleted key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted key to its latest version.\n\nThe Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.\nIt recovers the deleted key back to its latest version under /keys. An attempt to recover an\nnon-deleted key will return an error. Consider this the inverse of the delete operation on\nsoft-delete enabled vaults. This operation requires the keys/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the deleted key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "set_secret" : {
+ "sync": {
+ "signature": "def set_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n parameters, # type: \"models.SecretSetParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Sets a secret in a specified key vault.\n\nThe SET operation adds a secret to the Azure Key Vault. If the named secret already exists,\nAzure Key Vault creates a new version of that secret. This operation requires the secrets/set\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param parameters: The parameters for setting the secret.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SecretSetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n parameters: \"models.SecretSetParameters\",\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Sets a secret in a specified key vault.\n\nThe SET operation adds a secret to the Azure Key Vault. If the named secret already exists,\nAzure Key Vault creates a new version of that secret. This operation requires the secrets/set\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param parameters: The parameters for setting the secret.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SecretSetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name, parameters"
+ },
+ "delete_secret" : {
+ "sync": {
+ "signature": "def delete_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a secret from a specified key vault.\n\nThe DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied\nto an individual version of a secret. This operation requires the secrets/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e \"models.DeletedSecretBundle\":\n",
+ "doc": "\"\"\"Deletes a secret from a specified key vault.\n\nThe DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied\nto an individual version of a secret. This operation requires the secrets/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "update_secret" : {
+ "sync": {
+ "signature": "def update_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n secret_version, # type: str\n parameters, # type: \"models.SecretUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the attributes associated with a specified secret in a given key vault.\n\nThe UPDATE operation changes specified attributes of an existing stored secret. Attributes that\nare not specified in the request are left unchanged. The value of a secret itself cannot be\nchanged. This operation requires the secrets/set permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param secret_version: The version of the secret.\n:type secret_version: str\n:param parameters: The parameters for update secret operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SecretUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n secret_version: str,\n parameters: \"models.SecretUpdateParameters\",\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Updates the attributes associated with a specified secret in a given key vault.\n\nThe UPDATE operation changes specified attributes of an existing stored secret. Attributes that\nare not specified in the request are left unchanged. The value of a secret itself cannot be\nchanged. This operation requires the secrets/set permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param secret_version: The version of the secret.\n:type secret_version: str\n:param parameters: The parameters for update secret operation.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SecretUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name, secret_version, parameters"
+ },
+ "get_secret" : {
+ "sync": {
+ "signature": "def get_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n secret_version, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Get a specified secret from a given key vault.\n\nThe GET operation is applicable to any secret stored in Azure Key Vault. This operation\nrequires the secrets/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param secret_version: The version of the secret.\n:type secret_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n secret_version: str,\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Get a specified secret from a given key vault.\n\nThe GET operation is applicable to any secret stored in Azure Key Vault. This operation\nrequires the secrets/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param secret_version: The version of the secret.\n:type secret_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name, secret_version"
+ },
+ "get_secrets" : {
+ "sync": {
+ "signature": "def get_secrets(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List secrets in a specified key vault.\n\nThe Get Secrets operation is applicable to the entire vault. However, only the base secret\nidentifier and its attributes are provided in the response. Individual secret versions are not\nlisted in the response. This operation requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified, the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SecretListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_secrets(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.SecretListResult\"]:\n",
+ "doc": "\"\"\"List secrets in a specified key vault.\n\nThe Get Secrets operation is applicable to the entire vault. However, only the base secret\nidentifier and its attributes are provided in the response. Individual secret versions are not\nlisted in the response. This operation requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified, the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SecretListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_secret_versions" : {
+ "sync": {
+ "signature": "def get_secret_versions(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List all versions of the specified secret.\n\nThe full secret identifier and attributes are provided in the response. No values are returned\nfor the secrets. This operations requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified, the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SecretListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_secret_versions(\n self,\n vault_base_url: str,\n secret_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.SecretListResult\"]:\n",
+ "doc": "\"\"\"List all versions of the specified secret.\n\nThe full secret identifier and attributes are provided in the response. No values are returned\nfor the secrets. This operations requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified, the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SecretListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name, maxresults"
+ },
+ "get_deleted_secrets" : {
+ "sync": {
+ "signature": "def get_deleted_secrets(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists deleted secrets for the specified vault.\n\nThe Get Deleted Secrets operation returns the secrets that have been deleted for a vault\nenabled for soft-delete. This operation requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedSecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_secrets(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedSecretListResult\"]:\n",
+ "doc": "\"\"\"Lists deleted secrets for the specified vault.\n\nThe Get Deleted Secrets operation returns the secrets that have been deleted for a vault\nenabled for soft-delete. This operation requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedSecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_deleted_secret" : {
+ "sync": {
+ "signature": "def get_deleted_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the specified deleted secret.\n\nThe Get Deleted Secret operation returns the specified deleted secret along with its\nattributes. This operation requires the secrets/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e \"models.DeletedSecretBundle\":\n",
+ "doc": "\"\"\"Gets the specified deleted secret.\n\nThe Get Deleted Secret operation returns the specified deleted secret along with its\nattributes. This operation requires the secrets/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "purge_deleted_secret" : {
+ "sync": {
+ "signature": "def purge_deleted_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Permanently deletes the specified secret.\n\nThe purge deleted secret operation removes the secret permanently, without the possibility of\nrecovery. This operation can only be enabled on a soft-delete enabled vault. This operation\nrequires the secrets/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def purge_deleted_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e None:\n",
+ "doc": "\"\"\"Permanently deletes the specified secret.\n\nThe purge deleted secret operation removes the secret permanently, without the possibility of\nrecovery. This operation can only be enabled on a soft-delete enabled vault. This operation\nrequires the secrets/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "recover_deleted_secret" : {
+ "sync": {
+ "signature": "def recover_deleted_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted secret to the latest version.\n\nRecovers the deleted secret in the specified vault. This operation can only be performed on a\nsoft-delete enabled vault. This operation requires the secrets/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the deleted secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted secret to the latest version.\n\nRecovers the deleted secret in the specified vault. This operation can only be performed on a\nsoft-delete enabled vault. This operation requires the secrets/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the deleted secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "backup_secret" : {
+ "sync": {
+ "signature": "def backup_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Backs up the specified secret.\n\nRequests that a backup of the specified secret be downloaded to the client. All versions of the\nsecret will be downloaded. This operation requires the secrets/backup permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupSecretResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.BackupSecretResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def backup_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e \"models.BackupSecretResult\":\n",
+ "doc": "\"\"\"Backs up the specified secret.\n\nRequests that a backup of the specified secret be downloaded to the client. All versions of the\nsecret will be downloaded. This operation requires the secrets/backup permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupSecretResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.BackupSecretResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "restore_secret" : {
+ "sync": {
+ "signature": "def restore_secret(\n self,\n vault_base_url, # type: str\n parameters, # type: \"models.SecretRestoreParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Restores a backed up secret to a vault.\n\nRestores a backed up secret, and all its versions, to a vault. This operation requires the\nsecrets/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the secret.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SecretRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def restore_secret(\n self,\n vault_base_url: str,\n parameters: \"models.SecretRestoreParameters\",\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Restores a backed up secret to a vault.\n\nRestores a backed up secret, and all its versions, to a vault. This operation requires the\nsecrets/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the secret.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SecretRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, parameters"
+ },
+ "get_certificates" : {
+ "sync": {
+ "signature": "def get_certificates(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List certificates in a specified key vault.\n\nThe GetCertificates operation returns the set of certificates resources in the specified key\nvault. This operation requires the certificates/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_certificates(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.CertificateListResult\"]:\n",
+ "doc": "\"\"\"List certificates in a specified key vault.\n\nThe GetCertificates operation returns the set of certificates resources in the specified key\nvault. This operation requires the certificates/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "delete_certificate" : {
+ "sync": {
+ "signature": "def delete_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a certificate from a specified key vault.\n\nDeletes all versions of a certificate object along with its associated policy. Delete\ncertificate cannot be used to remove individual versions of a certificate object. This\noperation requires the certificates/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedCertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.DeletedCertificateBundle\":\n",
+ "doc": "\"\"\"Deletes a certificate from a specified key vault.\n\nDeletes all versions of a certificate object along with its associated policy. Delete\ncertificate cannot be used to remove individual versions of a certificate object. This\noperation requires the certificates/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedCertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "set_certificate_contacts" : {
+ "sync": {
+ "signature": "def set_certificate_contacts(\n self,\n vault_base_url, # type: str\n contacts, # type: \"models.Contacts\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Sets the certificate contacts for the specified key vault.\n\nSets the certificate contacts for the specified key vault. This operation requires the\ncertificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param contacts: The contacts for the key vault certificate.\n:type contacts: ~azure.keyvault.v2016_10_01.models.Contacts\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_certificate_contacts(\n self,\n vault_base_url: str,\n contacts: \"models.Contacts\",\n **kwargs\n) -\u003e \"models.Contacts\":\n",
+ "doc": "\"\"\"Sets the certificate contacts for the specified key vault.\n\nSets the certificate contacts for the specified key vault. This operation requires the\ncertificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param contacts: The contacts for the key vault certificate.\n:type contacts: ~azure.keyvault.v2016_10_01.models.Contacts\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, contacts"
+ },
+ "get_certificate_contacts" : {
+ "sync": {
+ "signature": "def get_certificate_contacts(\n self,\n vault_base_url, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the certificate contacts for a specified key vault.\n\nThe GetCertificateContacts operation returns the set of certificate contact resources in the\nspecified key vault. This operation requires the certificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate_contacts(\n self,\n vault_base_url: str,\n **kwargs\n) -\u003e \"models.Contacts\":\n",
+ "doc": "\"\"\"Lists the certificate contacts for a specified key vault.\n\nThe GetCertificateContacts operation returns the set of certificate contact resources in the\nspecified key vault. This operation requires the certificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url"
+ },
+ "delete_certificate_contacts" : {
+ "sync": {
+ "signature": "def delete_certificate_contacts(\n self,\n vault_base_url, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes the certificate contacts for a specified key vault.\n\nDeletes the certificate contacts for a specified key vault certificate. This operation requires\nthe certificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_certificate_contacts(\n self,\n vault_base_url: str,\n **kwargs\n) -\u003e \"models.Contacts\":\n",
+ "doc": "\"\"\"Deletes the certificate contacts for a specified key vault.\n\nDeletes the certificate contacts for a specified key vault certificate. This operation requires\nthe certificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url"
+ },
+ "get_certificate_issuers" : {
+ "sync": {
+ "signature": "def get_certificate_issuers(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List certificate issuers for a specified key vault.\n\nThe GetCertificateIssuers operation returns the set of certificate issuer resources in the\nspecified key vault. This operation requires the certificates/manageissuers/getissuers\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateIssuerListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_certificate_issuers(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.CertificateIssuerListResult\"]:\n",
+ "doc": "\"\"\"List certificate issuers for a specified key vault.\n\nThe GetCertificateIssuers operation returns the set of certificate issuer resources in the\nspecified key vault. This operation requires the certificates/manageissuers/getissuers\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateIssuerListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "set_certificate_issuer" : {
+ "sync": {
+ "signature": "def set_certificate_issuer(\n self,\n vault_base_url, # type: str\n issuer_name, # type: str\n parameter, # type: \"models.CertificateIssuerSetParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Sets the specified certificate issuer.\n\nThe SetCertificateIssuer operation adds or updates the specified certificate issuer. This\noperation requires the certificates/setissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:param parameter: Certificate issuer set parameter.\n:type parameter: ~azure.keyvault.v2016_10_01.models.CertificateIssuerSetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_certificate_issuer(\n self,\n vault_base_url: str,\n issuer_name: str,\n parameter: \"models.CertificateIssuerSetParameters\",\n **kwargs\n) -\u003e \"models.IssuerBundle\":\n",
+ "doc": "\"\"\"Sets the specified certificate issuer.\n\nThe SetCertificateIssuer operation adds or updates the specified certificate issuer. This\noperation requires the certificates/setissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:param parameter: Certificate issuer set parameter.\n:type parameter: ~azure.keyvault.v2016_10_01.models.CertificateIssuerSetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, issuer_name, parameter"
+ },
+ "update_certificate_issuer" : {
+ "sync": {
+ "signature": "def update_certificate_issuer(\n self,\n vault_base_url, # type: str\n issuer_name, # type: str\n parameter, # type: \"models.CertificateIssuerUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the specified certificate issuer.\n\nThe UpdateCertificateIssuer operation performs an update on the specified certificate issuer\nentity. This operation requires the certificates/setissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:param parameter: Certificate issuer update parameter.\n:type parameter: ~azure.keyvault.v2016_10_01.models.CertificateIssuerUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_certificate_issuer(\n self,\n vault_base_url: str,\n issuer_name: str,\n parameter: \"models.CertificateIssuerUpdateParameters\",\n **kwargs\n) -\u003e \"models.IssuerBundle\":\n",
+ "doc": "\"\"\"Updates the specified certificate issuer.\n\nThe UpdateCertificateIssuer operation performs an update on the specified certificate issuer\nentity. This operation requires the certificates/setissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:param parameter: Certificate issuer update parameter.\n:type parameter: ~azure.keyvault.v2016_10_01.models.CertificateIssuerUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, issuer_name, parameter"
+ },
+ "get_certificate_issuer" : {
+ "sync": {
+ "signature": "def get_certificate_issuer(\n self,\n vault_base_url, # type: str\n issuer_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the specified certificate issuer.\n\nThe GetCertificateIssuer operation returns the specified certificate issuer resources in the\nspecified key vault. This operation requires the certificates/manageissuers/getissuers\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate_issuer(\n self,\n vault_base_url: str,\n issuer_name: str,\n **kwargs\n) -\u003e \"models.IssuerBundle\":\n",
+ "doc": "\"\"\"Lists the specified certificate issuer.\n\nThe GetCertificateIssuer operation returns the specified certificate issuer resources in the\nspecified key vault. This operation requires the certificates/manageissuers/getissuers\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, issuer_name"
+ },
+ "delete_certificate_issuer" : {
+ "sync": {
+ "signature": "def delete_certificate_issuer(\n self,\n vault_base_url, # type: str\n issuer_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes the specified certificate issuer.\n\nThe DeleteCertificateIssuer operation permanently removes the specified certificate issuer from\nthe vault. This operation requires the certificates/manageissuers/deleteissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_certificate_issuer(\n self,\n vault_base_url: str,\n issuer_name: str,\n **kwargs\n) -\u003e \"models.IssuerBundle\":\n",
+ "doc": "\"\"\"Deletes the specified certificate issuer.\n\nThe DeleteCertificateIssuer operation permanently removes the specified certificate issuer from\nthe vault. This operation requires the certificates/manageissuers/deleteissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, issuer_name"
+ },
+ "create_certificate" : {
+ "sync": {
+ "signature": "def create_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n parameters, # type: \"models.CertificateCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates a new certificate.\n\nIf this is the first version, the certificate resource is created. This operation requires the\ncertificates/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to create a certificate.\n:type parameters: ~azure.keyvault.v2016_10_01.models.CertificateCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def create_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n parameters: \"models.CertificateCreateParameters\",\n **kwargs\n) -\u003e \"models.CertificateOperation\":\n",
+ "doc": "\"\"\"Creates a new certificate.\n\nIf this is the first version, the certificate resource is created. This operation requires the\ncertificates/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to create a certificate.\n:type parameters: ~azure.keyvault.v2016_10_01.models.CertificateCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, parameters"
+ },
+ "import_certificate" : {
+ "sync": {
+ "signature": "def import_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n parameters, # type: \"models.CertificateImportParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Imports a certificate into a specified key vault.\n\nImports an existing valid certificate, containing a private key, into Azure Key Vault. The\ncertificate to be imported can be in either PFX or PEM format. If the certificate is in PEM\nformat the PEM file must contain the key as well as x509 certificates. This operation requires\nthe certificates/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to import the certificate.\n:type parameters: ~azure.keyvault.v2016_10_01.models.CertificateImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def import_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n parameters: \"models.CertificateImportParameters\",\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Imports a certificate into a specified key vault.\n\nImports an existing valid certificate, containing a private key, into Azure Key Vault. The\ncertificate to be imported can be in either PFX or PEM format. If the certificate is in PEM\nformat the PEM file must contain the key as well as x509 certificates. This operation requires\nthe certificates/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to import the certificate.\n:type parameters: ~azure.keyvault.v2016_10_01.models.CertificateImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, parameters"
+ },
+ "get_certificate_versions" : {
+ "sync": {
+ "signature": "def get_certificate_versions(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List the versions of a certificate.\n\nThe GetCertificateVersions operation returns the versions of a certificate in the specified key\nvault. This operation requires the certificates/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_certificate_versions(\n self,\n vault_base_url: str,\n certificate_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.CertificateListResult\"]:\n",
+ "doc": "\"\"\"List the versions of a certificate.\n\nThe GetCertificateVersions operation returns the versions of a certificate in the specified key\nvault. This operation requires the certificates/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, maxresults"
+ },
+ "get_certificate_policy" : {
+ "sync": {
+ "signature": "def get_certificate_policy(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the policy for a certificate.\n\nThe GetCertificatePolicy operation returns the specified certificate policy resources in the\nspecified key vault. This operation requires the certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in a given key vault.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificatePolicy, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate_policy(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.CertificatePolicy\":\n",
+ "doc": "\"\"\"Lists the policy for a certificate.\n\nThe GetCertificatePolicy operation returns the specified certificate policy resources in the\nspecified key vault. This operation requires the certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in a given key vault.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificatePolicy, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "update_certificate_policy" : {
+ "sync": {
+ "signature": "def update_certificate_policy(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n certificate_policy, # type: \"models.CertificatePolicy\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the policy for a certificate.\n\nSet specified members in the certificate policy. Leave others as null. This operation requires\nthe certificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given vault.\n:type certificate_name: str\n:param certificate_policy: The policy for the certificate.\n:type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificatePolicy, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_certificate_policy(\n self,\n vault_base_url: str,\n certificate_name: str,\n certificate_policy: \"models.CertificatePolicy\",\n **kwargs\n) -\u003e \"models.CertificatePolicy\":\n",
+ "doc": "\"\"\"Updates the policy for a certificate.\n\nSet specified members in the certificate policy. Leave others as null. This operation requires\nthe certificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given vault.\n:type certificate_name: str\n:param certificate_policy: The policy for the certificate.\n:type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificatePolicy, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, certificate_policy"
+ },
+ "update_certificate" : {
+ "sync": {
+ "signature": "def update_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n certificate_version, # type: str\n parameters, # type: \"models.CertificateUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given certificate.\n\nThe UpdateCertificate operation applies the specified update on the given certificate; the only\nelements updated are the certificate\u0027s attributes. This operation requires the\ncertificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given key vault.\n:type certificate_name: str\n:param certificate_version: The version of the certificate.\n:type certificate_version: str\n:param parameters: The parameters for certificate update.\n:type parameters: ~azure.keyvault.v2016_10_01.models.CertificateUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n certificate_version: str,\n parameters: \"models.CertificateUpdateParameters\",\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given certificate.\n\nThe UpdateCertificate operation applies the specified update on the given certificate; the only\nelements updated are the certificate\u0027s attributes. This operation requires the\ncertificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given key vault.\n:type certificate_name: str\n:param certificate_version: The version of the certificate.\n:type certificate_version: str\n:param parameters: The parameters for certificate update.\n:type parameters: ~azure.keyvault.v2016_10_01.models.CertificateUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, certificate_version, parameters"
+ },
+ "get_certificate" : {
+ "sync": {
+ "signature": "def get_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n certificate_version, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets information about a certificate.\n\nGets information about a specific certificate. This operation requires the certificates/get\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given vault.\n:type certificate_name: str\n:param certificate_version: The version of the certificate.\n:type certificate_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n certificate_version: str,\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Gets information about a certificate.\n\nGets information about a specific certificate. This operation requires the certificates/get\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given vault.\n:type certificate_name: str\n:param certificate_version: The version of the certificate.\n:type certificate_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, certificate_version"
+ },
+ "update_certificate_operation" : {
+ "sync": {
+ "signature": "def update_certificate_operation(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n certificate_operation, # type: \"models.CertificateOperationUpdateParameter\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates a certificate operation.\n\nUpdates a certificate creation operation that is already in progress. This operation requires\nthe certificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param certificate_operation: The certificate operation response.\n:type certificate_operation: ~azure.keyvault.v2016_10_01.models.CertificateOperationUpdateParameter\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_certificate_operation(\n self,\n vault_base_url: str,\n certificate_name: str,\n certificate_operation: \"models.CertificateOperationUpdateParameter\",\n **kwargs\n) -\u003e \"models.CertificateOperation\":\n",
+ "doc": "\"\"\"Updates a certificate operation.\n\nUpdates a certificate creation operation that is already in progress. This operation requires\nthe certificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param certificate_operation: The certificate operation response.\n:type certificate_operation: ~azure.keyvault.v2016_10_01.models.CertificateOperationUpdateParameter\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, certificate_operation"
+ },
+ "get_certificate_operation" : {
+ "sync": {
+ "signature": "def get_certificate_operation(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the creation operation of a certificate.\n\nGets the creation operation associated with a specified certificate. This operation requires\nthe certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate_operation(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.CertificateOperation\":\n",
+ "doc": "\"\"\"Gets the creation operation of a certificate.\n\nGets the creation operation associated with a specified certificate. This operation requires\nthe certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "delete_certificate_operation" : {
+ "sync": {
+ "signature": "def delete_certificate_operation(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes the creation operation for a specific certificate.\n\nDeletes the creation operation for a specified certificate that is in the process of being\ncreated. The certificate is no longer created. This operation requires the certificates/update\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_certificate_operation(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.CertificateOperation\":\n",
+ "doc": "\"\"\"Deletes the creation operation for a specific certificate.\n\nDeletes the creation operation for a specified certificate that is in the process of being\ncreated. The certificate is no longer created. This operation requires the certificates/update\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "merge_certificate" : {
+ "sync": {
+ "signature": "def merge_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n parameters, # type: \"models.CertificateMergeParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Merges a certificate or a certificate chain with a key pair existing on the server.\n\nThe MergeCertificate operation performs the merging of a certificate or certificate chain with\na key pair currently available in the service. This operation requires the certificates/create\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to merge certificate.\n:type parameters: ~azure.keyvault.v2016_10_01.models.CertificateMergeParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def merge_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n parameters: \"models.CertificateMergeParameters\",\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Merges a certificate or a certificate chain with a key pair existing on the server.\n\nThe MergeCertificate operation performs the merging of a certificate or certificate chain with\na key pair currently available in the service. This operation requires the certificates/create\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to merge certificate.\n:type parameters: ~azure.keyvault.v2016_10_01.models.CertificateMergeParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, parameters"
+ },
+ "get_deleted_certificates" : {
+ "sync": {
+ "signature": "def get_deleted_certificates(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the deleted certificates in the specified vault currently available for recovery.\n\nThe GetDeletedCertificates operation retrieves the certificates in the current vault which are\nin a deleted state and ready for recovery or purging. This operation includes deletion-specific\ninformation. This operation requires the certificates/get/list permission. This operation can\nonly be enabled on soft-delete enabled vaults.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedCertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_certificates(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedCertificateListResult\"]:\n",
+ "doc": "\"\"\"Lists the deleted certificates in the specified vault currently available for recovery.\n\nThe GetDeletedCertificates operation retrieves the certificates in the current vault which are\nin a deleted state and ready for recovery or purging. This operation includes deletion-specific\ninformation. This operation requires the certificates/get/list permission. This operation can\nonly be enabled on soft-delete enabled vaults.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedCertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_deleted_certificate" : {
+ "sync": {
+ "signature": "def get_deleted_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Retrieves information about the specified deleted certificate.\n\nThe GetDeletedCertificate operation retrieves the deleted certificate information plus its\nattributes, such as retention interval, scheduled permanent deletion and the current deletion\nrecovery level. This operation requires the certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedCertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.DeletedCertificateBundle\":\n",
+ "doc": "\"\"\"Retrieves information about the specified deleted certificate.\n\nThe GetDeletedCertificate operation retrieves the deleted certificate information plus its\nattributes, such as retention interval, scheduled permanent deletion and the current deletion\nrecovery level. This operation requires the certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedCertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "purge_deleted_certificate" : {
+ "sync": {
+ "signature": "def purge_deleted_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Permanently deletes the specified deleted certificate.\n\nThe PurgeDeletedCertificate operation performs an irreversible deletion of the specified\ncertificate, without possibility for recovery. The operation is not available if the recovery\nlevel does not specify \u0027Purgeable\u0027. This operation requires the certificate/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def purge_deleted_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e None:\n",
+ "doc": "\"\"\"Permanently deletes the specified deleted certificate.\n\nThe PurgeDeletedCertificate operation performs an irreversible deletion of the specified\ncertificate, without possibility for recovery. The operation is not available if the recovery\nlevel does not specify \u0027Purgeable\u0027. This operation requires the certificate/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "recover_deleted_certificate" : {
+ "sync": {
+ "signature": "def recover_deleted_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted certificate back to its current version under /certificates.\n\nThe RecoverDeletedCertificate operation performs the reversal of the Delete operation. The\noperation is applicable in vaults enabled for soft-delete, and must be issued during the\nretention interval (available in the deleted certificate\u0027s attributes). This operation requires\nthe certificates/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the deleted certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted certificate back to its current version under /certificates.\n\nThe RecoverDeletedCertificate operation performs the reversal of the Delete operation. The\noperation is applicable in vaults enabled for soft-delete, and must be issued during the\nretention interval (available in the deleted certificate\u0027s attributes). This operation requires\nthe certificates/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the deleted certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "get_storage_accounts" : {
+ "sync": {
+ "signature": "def get_storage_accounts(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List storage accounts managed by the specified key vault. This operation requires the\nstorage/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either StorageListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.StorageListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_storage_accounts(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.StorageListResult\"]:\n",
+ "doc": "\"\"\"List storage accounts managed by the specified key vault. This operation requires the\nstorage/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either StorageListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.StorageListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "delete_storage_account" : {
+ "sync": {
+ "signature": "def delete_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a storage account. This operation requires the storage/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Deletes a storage account. This operation requires the storage/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name"
+ },
+ "get_storage_account" : {
+ "sync": {
+ "signature": "def get_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets information about a specified storage account. This operation requires the storage/get\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Gets information about a specified storage account. This operation requires the storage/get\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name"
+ },
+ "set_storage_account" : {
+ "sync": {
+ "signature": "def set_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n parameters, # type: \"models.StorageAccountCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates or updates a new storage account. This operation requires the storage/set permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to create a storage account.\n:type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n parameters: \"models.StorageAccountCreateParameters\",\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Creates or updates a new storage account. This operation requires the storage/set permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to create a storage account.\n:type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, parameters"
+ },
+ "update_storage_account" : {
+ "sync": {
+ "signature": "def update_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n parameters, # type: \"models.StorageAccountUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given storage account. This operation\nrequires the storage/set/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to update a storage account.\n:type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n parameters: \"models.StorageAccountUpdateParameters\",\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given storage account. This operation\nrequires the storage/set/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to update a storage account.\n:type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, parameters"
+ },
+ "regenerate_storage_account_key" : {
+ "sync": {
+ "signature": "def regenerate_storage_account_key(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n parameters, # type: \"models.StorageAccountRegenerteKeyParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Regenerates the specified key value for the given storage account. This operation requires the\nstorage/regeneratekey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to regenerate storage account key.\n:type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountRegenerteKeyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def regenerate_storage_account_key(\n self,\n vault_base_url: str,\n storage_account_name: str,\n parameters: \"models.StorageAccountRegenerteKeyParameters\",\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Regenerates the specified key value for the given storage account. This operation requires the\nstorage/regeneratekey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to regenerate storage account key.\n:type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountRegenerteKeyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, parameters"
+ },
+ "get_sas_definitions" : {
+ "sync": {
+ "signature": "def get_sas_definitions(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List storage SAS definitions for the given storage account. This operation requires the\nstorage/listsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SasDefinitionListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_sas_definitions(\n self,\n vault_base_url: str,\n storage_account_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.SasDefinitionListResult\"]:\n",
+ "doc": "\"\"\"List storage SAS definitions for the given storage account. This operation requires the\nstorage/listsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SasDefinitionListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, maxresults"
+ },
+ "delete_sas_definition" : {
+ "sync": {
+ "signature": "def delete_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a SAS definition from a specified storage account. This operation requires the\nstorage/deletesas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n **kwargs\n) -\u003e \"models.SasDefinitionBundle\":\n",
+ "doc": "\"\"\"Deletes a SAS definition from a specified storage account. This operation requires the\nstorage/deletesas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name"
+ },
+ "get_sas_definition" : {
+ "sync": {
+ "signature": "def get_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets information about a SAS definition for the specified storage account. This operation\nrequires the storage/getsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n **kwargs\n) -\u003e \"models.SasDefinitionBundle\":\n",
+ "doc": "\"\"\"Gets information about a SAS definition for the specified storage account. This operation\nrequires the storage/getsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name"
+ },
+ "set_sas_definition" : {
+ "sync": {
+ "signature": "def set_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n parameters, # type: \"models.SasDefinitionCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates or updates a new SAS definition for the specified storage account. This operation\nrequires the storage/setsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:param parameters: The parameters to create a SAS definition.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SasDefinitionCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n parameters: \"models.SasDefinitionCreateParameters\",\n **kwargs\n) -\u003e \"models.SasDefinitionBundle\":\n",
+ "doc": "\"\"\"Creates or updates a new SAS definition for the specified storage account. This operation\nrequires the storage/setsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:param parameters: The parameters to create a SAS definition.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SasDefinitionCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name, parameters"
+ },
+ "update_sas_definition" : {
+ "sync": {
+ "signature": "def update_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n parameters, # type: \"models.SasDefinitionUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given SAS definition. This operation\nrequires the storage/setsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:param parameters: The parameters to update a SAS definition.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SasDefinitionUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n parameters: \"models.SasDefinitionUpdateParameters\",\n **kwargs\n) -\u003e \"models.SasDefinitionBundle\":\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given SAS definition. This operation\nrequires the storage/setsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:param parameters: The parameters to update a SAS definition.\n:type parameters: ~azure.keyvault.v2016_10_01.models.SasDefinitionUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name, parameters"
+ }
+ },
+ "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\"]}}}",
+ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}"
+}
\ No newline at end of file
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/__init__.py
similarity index 89%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/__init__.py
index fb2e6c3866fd..71ceadebe430 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_async import KeyVaultClient
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/_configuration_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/_configuration_async.py
similarity index 68%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/_configuration_async.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/_configuration_async.py
index fb961bb4bd2d..554e96bd7030 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/_configuration_async.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/_configuration_async.py
@@ -1,47 +1,46 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+
+from typing import Any
+
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
-from ..version import VERSION
-
+VERSION = "unknown"
class KeyVaultClientConfiguration(Configuration):
- """Configuration for KeyVaultClient
+ """Configuration for KeyVaultClient.
+
Note that all parameters used to create this instance are saved as instance
attributes.
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
"""
- def __init__(self, credentials, **kwargs):
-
- if credentials is None:
- raise ValueError("Parameter 'credentials' must not be None.")
-
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
super(KeyVaultClientConfiguration, self).__init__(**kwargs)
- self._configure(**kwargs)
- self.user_agent_policy.add_user_agent('azsdk-python-azure-keyvault/{}'.format(VERSION))
- self.generate_client_request_id = True
-
- self.credentials = credentials
+ self.api_version = "2016-10-01"
+ kwargs.setdefault('sdk_moniker', 'keyvault/{}'.format(VERSION))
+ self._configure(**kwargs)
- def _configure(self, **kwargs):
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/_key_vault_client_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/_key_vault_client_async.py
similarity index 70%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/_key_vault_client_async.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/_key_vault_client_async.py
index b2b908c4a757..2d273c4e45f8 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/_key_vault_client_async.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/_key_vault_client_async.py
@@ -1,16 +1,15 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from typing import Any
+
from azure.core import AsyncPipelineClient
-from msrest import Serializer, Deserializer
+from msrest import Deserializer, Serializer
from ._configuration_async import KeyVaultClientConfiguration
from .operations_async import KeyVaultClientOperationsMixin
@@ -20,29 +19,28 @@
class KeyVaultClient(KeyVaultClientOperationsMixin):
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
-
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
def __init__(
- self, credentials, **kwargs):
-
+ self,
+ **kwargs: Any
+ ) -> None:
base_url = '{vaultBaseUrl}'
- self._config = KeyVaultClientConfiguration(credentials, **kwargs)
+ self._config = KeyVaultClientConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
- self.api_version = '7.1-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
- async def close(self):
+ async def close(self) -> None:
await self._client.close()
- async def __aenter__(self):
+
+ async def __aenter__(self) -> "KeyVaultClient":
await self._client.__aenter__()
return self
- async def __aexit__(self, *exc_details):
+
+ async def __aexit__(self, *exc_details) -> None:
await self._client.__aexit__(*exc_details)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/operations_async/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/operations_async/__init__.py
similarity index 90%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/operations_async/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/operations_async/__init__.py
index 771a17ceb80d..b887c97a4206 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/aio/operations_async/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/operations_async/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_operations_async import KeyVaultClientOperationsMixin
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/operations_async/_key_vault_client_operations_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/operations_async/_key_vault_client_operations_async.py
new file mode 100644
index 000000000000..53a7cb4a4642
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/operations_async/_key_vault_client_operations_async.py
@@ -0,0 +1,4512 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class KeyVaultClientOperationsMixin:
+
+ async def create_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ parameters: "models.KeyCreateParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Creates a new key, stores it, then returns key parameters and attributes to the client.
+
+ The create key operation can be used to create any key type in Azure Key Vault. If the named
+ key already exists, Azure Key Vault creates a new version of the key. It requires the
+ keys/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name for the new key. The system will generate the version name for the
+ new key.
+ :type key_name: str
+ :param parameters: The parameters to create a key.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_key.metadata = {'url': '/keys/{key-name}/create'} # type: ignore
+
+ async def import_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ parameters: "models.KeyImportParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Imports an externally created key, stores it, and returns key parameters and attributes to the client.
+
+ The import key operation may be used to import any key type into an Azure Key Vault. If the
+ named key already exists, Azure Key Vault creates a new version of the key. This operation
+ requires the keys/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: Name for the imported key.
+ :type key_name: str
+ :param parameters: The parameters to import a key.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ async def delete_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.DeletedKeyBundle":
+ """Deletes a key of any type from storage in Azure Key Vault.
+
+ The delete key operation cannot be used to remove individual versions of a key. This operation
+ removes the cryptographic material associated with the key, which means the key is not usable
+ for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
+ keys/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to delete.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ async def update_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyUpdateParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
+
+ In order to perform this operation, the key must already exist in the Key Vault. Note: The
+ cryptographic material of a key itself cannot be changed. This operation requires the
+ keys/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of key to update.
+ :type key_name: str
+ :param key_version: The version of the key to update.
+ :type key_version: str
+ :param parameters: The parameters of the key to update.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ async def get_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Gets the public part of a stored key.
+
+ The get key operation is applicable to all key types. If the requested key is symmetric, then
+ no key material is released in the response. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to get.
+ :type key_name: str
+ :param key_version: Adding the version parameter retrieves a specific version of a key.
+ :type key_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key_versions(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.KeyListResult"]:
+ """Retrieves a list of individual key versions with the same key name.
+
+ The full key identifier, attributes, and tags are provided in the response. This operation
+ requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_key_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_key_versions.metadata = {'url': '/keys/{key-name}/versions'} # type: ignore
+
+ def get_keys(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.KeyListResult"]:
+ """List keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a stored key. The LIST operation is applicable to all key types, however only
+ the base key identifier, attributes, and tags are provided in the response. Individual versions
+ of a key are not listed in the response. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_keys.metadata = {'url': '/keys'} # type: ignore
+
+ async def backup_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.BackupKeyResult":
+ """Requests that a backup of the specified key be downloaded to the client.
+
+ The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this
+ operation does NOT return key material in a form that can be used outside the Azure Key Vault
+ system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key
+ Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
+ Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.
+ The BACKUP operation may be used to export, in protected form, any key type from Azure Key
+ Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed
+ within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be
+ restored to another geographical area. For example, a backup from the US geographical area
+ cannot be restored in an EU geographical area. This operation requires the key/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupKeyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.BackupKeyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupKeyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.backup_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupKeyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_key.metadata = {'url': '/keys/{key-name}/backup'} # type: ignore
+
+ async def restore_key(
+ self,
+ vault_base_url: str,
+ parameters: "models.KeyRestoreParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Restores a backed up key to a vault.
+
+ Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
+ attributes and access control policies. The RESTORE operation may be used to import a
+ previously backed up key. Individual versions of a key cannot be restored. The key is restored
+ in its entirety with the same key name as it had when it was backed up. If the key name is not
+ available in the target Key Vault, the RESTORE operation will be rejected. While the key name
+ is retained during restore, the final key identifier will change if the key is restored to a
+ different vault. Restore will restore all versions and preserve version identifiers. The
+ RESTORE operation is subject to security constraints: The target Key Vault must be owned by the
+ same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission
+ in the target Key Vault. This operation requires the keys/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the key.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_key.metadata = {'url': '/keys/restore'} # type: ignore
+
+ async def encrypt(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
+
+ The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
+ stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of
+ data, the size of which is dependent on the target key and the encryption algorithm to be used.
+ The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
+ since protection with an asymmetric key can be performed using public portion of the key. This
+ operation is supported for asymmetric keys as a convenience for callers that have a key-
+ reference but do not have access to the public key material. This operation requires the
+ keys/encrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the encryption operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.encrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'} # type: ignore
+
+ async def decrypt(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Decrypts a single block of encrypted data.
+
+ The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption
+ key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a
+ single block of data may be decrypted, the size of this block is dependent on the target key
+ and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys
+ stored in Azure Key Vault since it uses the private portion of the key. This operation requires
+ the keys/decrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the decryption operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.decrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'} # type: ignore
+
+ async def sign(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeySignParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Creates a signature from a digest using the specified key.
+
+ The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault
+ since this operation uses the private portion of the key. This operation requires the keys/sign
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the signing operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeySignParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.sign.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeySignParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'} # type: ignore
+
+ async def verify(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyVerifyParameters",
+ **kwargs
+ ) -> "models.KeyVerifyResult":
+ """Verifies a signature using a specified key.
+
+ The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not
+ strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification
+ can be performed using the public portion of the key but this operation is supported as a
+ convenience for callers that only have a key-reference and not the public portion of the key.
+ This operation requires the keys/verify permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for verify operations.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyVerifyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyVerifyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyVerifyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyVerifyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.verify.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyVerifyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'} # type: ignore
+
+ async def wrap_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Wraps a symmetric key using a specified key.
+
+ The WRAP operation supports encryption of a symmetric key using a key encryption key that has
+ previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for
+ symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be
+ performed using the public portion of the key. This operation is supported for asymmetric keys
+ as a convenience for callers that have a key-reference but do not have access to the public key
+ material. This operation requires the keys/wrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for wrap operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.wrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'} # type: ignore
+
+ async def unwrap_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
+
+ The UNWRAP operation supports decryption of a symmetric key using the target key encryption
+ key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to
+ asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of
+ the key. This operation requires the keys/unwrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the key operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.unwrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'} # type: ignore
+
+ def get_deleted_keys(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedKeyListResult"]:
+ """Lists the deleted keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a deleted key. This operation includes deletion-specific information. The Get
+ Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedKeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedKeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_keys.metadata = {'url': '/deletedkeys'} # type: ignore
+
+ async def get_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.DeletedKeyBundle":
+ """Gets the public part of a deleted key.
+
+ The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ async def purge_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified key.
+
+ The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the
+ operation can be invoked on any vault, it will return an error if invoked on a non soft-delete
+ enabled vault. This operation requires the keys/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.purge_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ async def recover_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Recovers the deleted key to its latest version.
+
+ The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.
+ It recovers the deleted key back to its latest version under /keys. An attempt to recover an
+ non-deleted key will return an error. Consider this the inverse of the delete operation on
+ soft-delete enabled vaults. This operation requires the keys/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the deleted key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.recover_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'} # type: ignore
+
+ async def set_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ parameters: "models.SecretSetParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Sets a secret in a specified key vault.
+
+ The SET operation adds a secret to the Azure Key Vault. If the named secret already exists,
+ Azure Key Vault creates a new version of that secret. This operation requires the secrets/set
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param parameters: The parameters for setting the secret.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SecretSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretSetParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_secret.metadata = {'url': '/secrets/{secret-name}'} # type: ignore
+
+ async def delete_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.DeletedSecretBundle":
+ """Deletes a secret from a specified key vault.
+
+ The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied
+ to an individual version of a secret. This operation requires the secrets/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_secret.metadata = {'url': '/secrets/{secret-name}'} # type: ignore
+
+ async def update_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ secret_version: str,
+ parameters: "models.SecretUpdateParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Updates the attributes associated with a specified secret in a given key vault.
+
+ The UPDATE operation changes specified attributes of an existing stored secret. Attributes that
+ are not specified in the request are left unchanged. The value of a secret itself cannot be
+ changed. This operation requires the secrets/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret.
+ :type secret_version: str
+ :param parameters: The parameters for update secret operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SecretUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ 'secret-version': self._serialize.url("secret_version", secret_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} # type: ignore
+
+ async def get_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ secret_version: str,
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Get a specified secret from a given key vault.
+
+ The GET operation is applicable to any secret stored in Azure Key Vault. This operation
+ requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret.
+ :type secret_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ 'secret-version': self._serialize.url("secret_version", secret_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} # type: ignore
+
+ def get_secrets(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.SecretListResult"]:
+ """List secrets in a specified key vault.
+
+ The Get Secrets operation is applicable to the entire vault. However, only the base secret
+ identifier and its attributes are provided in the response. Individual secret versions are not
+ listed in the response. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_secrets.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('SecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_secrets.metadata = {'url': '/secrets'} # type: ignore
+
+ def get_secret_versions(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.SecretListResult"]:
+ """List all versions of the specified secret.
+
+ The full secret identifier and attributes are provided in the response. No values are returned
+ for the secrets. This operations requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_secret_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('SecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_secret_versions.metadata = {'url': '/secrets/{secret-name}/versions'} # type: ignore
+
+ def get_deleted_secrets(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedSecretListResult"]:
+ """Lists deleted secrets for the specified vault.
+
+ The Get Deleted Secrets operation returns the secrets that have been deleted for a vault
+ enabled for soft-delete. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedSecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_secrets.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedSecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_secrets.metadata = {'url': '/deletedsecrets'} # type: ignore
+
+ async def get_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.DeletedSecretBundle":
+ """Gets the specified deleted secret.
+
+ The Get Deleted Secret operation returns the specified deleted secret along with its
+ attributes. This operation requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} # type: ignore
+
+ async def purge_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified secret.
+
+ The purge deleted secret operation removes the secret permanently, without the possibility of
+ recovery. This operation can only be enabled on a soft-delete enabled vault. This operation
+ requires the secrets/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.purge_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} # type: ignore
+
+ async def recover_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Recovers the deleted secret to the latest version.
+
+ Recovers the deleted secret in the specified vault. This operation can only be performed on a
+ soft-delete enabled vault. This operation requires the secrets/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the deleted secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.recover_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}/recover'} # type: ignore
+
+ async def backup_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.BackupSecretResult":
+ """Backs up the specified secret.
+
+ Requests that a backup of the specified secret be downloaded to the client. All versions of the
+ secret will be downloaded. This operation requires the secrets/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupSecretResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.BackupSecretResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupSecretResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.backup_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupSecretResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_secret.metadata = {'url': '/secrets/{secret-name}/backup'} # type: ignore
+
+ async def restore_secret(
+ self,
+ vault_base_url: str,
+ parameters: "models.SecretRestoreParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Restores a backed up secret to a vault.
+
+ Restores a backed up secret, and all its versions, to a vault. This operation requires the
+ secrets/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the secret.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SecretRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_secret.metadata = {'url': '/secrets/restore'} # type: ignore
+
+ def get_certificates(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.CertificateListResult"]:
+ """List certificates in a specified key vault.
+
+ The GetCertificates operation returns the set of certificates resources in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificates.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_certificates.metadata = {'url': '/certificates'} # type: ignore
+
+ async def delete_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.DeletedCertificateBundle":
+ """Deletes a certificate from a specified key vault.
+
+ Deletes all versions of a certificate object along with its associated policy. Delete
+ certificate cannot be used to remove individual versions of a certificate object. This
+ operation requires the certificates/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedCertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate.metadata = {'url': '/certificates/{certificate-name}'} # type: ignore
+
+ async def set_certificate_contacts(
+ self,
+ vault_base_url: str,
+ contacts: "models.Contacts",
+ **kwargs
+ ) -> "models.Contacts":
+ """Sets the certificate contacts for the specified key vault.
+
+ Sets the certificate contacts for the specified key vault. This operation requires the
+ certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param contacts: The contacts for the key vault certificate.
+ :type contacts: ~azure.keyvault.v2016_10_01.models.Contacts
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(contacts, 'Contacts')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ async def get_certificate_contacts(
+ self,
+ vault_base_url: str,
+ **kwargs
+ ) -> "models.Contacts":
+ """Lists the certificate contacts for a specified key vault.
+
+ The GetCertificateContacts operation returns the set of certificate contact resources in the
+ specified key vault. This operation requires the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ async def delete_certificate_contacts(
+ self,
+ vault_base_url: str,
+ **kwargs
+ ) -> "models.Contacts":
+ """Deletes the certificate contacts for a specified key vault.
+
+ Deletes the certificate contacts for a specified key vault certificate. This operation requires
+ the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ def get_certificate_issuers(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.CertificateIssuerListResult"]:
+ """List certificate issuers for a specified key vault.
+
+ The GetCertificateIssuers operation returns the set of certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateIssuerListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateIssuerListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificate_issuers.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateIssuerListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_certificate_issuers.metadata = {'url': '/certificates/issuers'} # type: ignore
+
+ async def set_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ parameter: "models.CertificateIssuerSetParameters",
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Sets the specified certificate issuer.
+
+ The SetCertificateIssuer operation adds or updates the specified certificate issuer. This
+ operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer set parameter.
+ :type parameter: ~azure.keyvault.v2016_10_01.models.CertificateIssuerSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameter, 'CertificateIssuerSetParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ async def update_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ parameter: "models.CertificateIssuerUpdateParameters",
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Updates the specified certificate issuer.
+
+ The UpdateCertificateIssuer operation performs an update on the specified certificate issuer
+ entity. This operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer update parameter.
+ :type parameter: ~azure.keyvault.v2016_10_01.models.CertificateIssuerUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameter, 'CertificateIssuerUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ async def get_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Lists the specified certificate issuer.
+
+ The GetCertificateIssuer operation returns the specified certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ async def delete_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Deletes the specified certificate issuer.
+
+ The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from
+ the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ async def create_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateCreateParameters",
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Creates a new certificate.
+
+ If this is the first version, the certificate resource is created. This operation requires the
+ certificates/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to create a certificate.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.CertificateCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_certificate.metadata = {'url': '/certificates/{certificate-name}/create'} # type: ignore
+
+ async def import_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateImportParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Imports a certificate into a specified key vault.
+
+ Imports an existing valid certificate, containing a private key, into Azure Key Vault. The
+ certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM
+ format the PEM file must contain the key as well as x509 certificates. This operation requires
+ the certificates/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to import the certificate.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.CertificateImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_certificate.metadata = {'url': '/certificates/{certificate-name}/import'} # type: ignore
+
+ def get_certificate_versions(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.CertificateListResult"]:
+ """List the versions of a certificate.
+
+ The GetCertificateVersions operation returns the versions of a certificate in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificate_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_certificate_versions.metadata = {'url': '/certificates/{certificate-name}/versions'} # type: ignore
+
+ async def get_certificate_policy(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificatePolicy":
+ """Lists the policy for a certificate.
+
+ The GetCertificatePolicy operation returns the specified certificate policy resources in the
+ specified key vault. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in a given key vault.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificatePolicy"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificatePolicy', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} # type: ignore
+
+ async def update_certificate_policy(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_policy: "models.CertificatePolicy",
+ **kwargs
+ ) -> "models.CertificatePolicy":
+ """Updates the policy for a certificate.
+
+ Set specified members in the certificate policy. Leave others as null. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_policy: The policy for the certificate.
+ :type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificatePolicy"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(certificate_policy, 'CertificatePolicy')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificatePolicy', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} # type: ignore
+
+ async def update_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_version: str,
+ parameters: "models.CertificateUpdateParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Updates the specified attributes associated with the given certificate.
+
+ The UpdateCertificate operation applies the specified update on the given certificate; the only
+ elements updated are the certificate's attributes. This operation requires the
+ certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given key vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate.
+ :type certificate_version: str
+ :param parameters: The parameters for certificate update.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.CertificateUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} # type: ignore
+
+ async def get_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_version: str,
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Gets information about a certificate.
+
+ Gets information about a specific certificate. This operation requires the certificates/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate.
+ :type certificate_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} # type: ignore
+
+ async def update_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_operation: "models.CertificateOperationUpdateParameter",
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Updates a certificate operation.
+
+ Updates a certificate creation operation that is already in progress. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param certificate_operation: The certificate operation response.
+ :type certificate_operation: ~azure.keyvault.v2016_10_01.models.CertificateOperationUpdateParameter
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(certificate_operation, 'CertificateOperationUpdateParameter')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ async def get_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Gets the creation operation of a certificate.
+
+ Gets the creation operation associated with a specified certificate. This operation requires
+ the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ async def delete_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Deletes the creation operation for a specific certificate.
+
+ Deletes the creation operation for a specified certificate that is in the process of being
+ created. The certificate is no longer created. This operation requires the certificates/update
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ async def merge_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateMergeParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Merges a certificate or a certificate chain with a key pair existing on the server.
+
+ The MergeCertificate operation performs the merging of a certificate or certificate chain with
+ a key pair currently available in the service. This operation requires the certificates/create
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to merge certificate.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.CertificateMergeParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.merge_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateMergeParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'} # type: ignore
+
+ def get_deleted_certificates(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedCertificateListResult"]:
+ """Lists the deleted certificates in the specified vault currently available for recovery.
+
+ The GetDeletedCertificates operation retrieves the certificates in the current vault which are
+ in a deleted state and ready for recovery or purging. This operation includes deletion-specific
+ information. This operation requires the certificates/get/list permission. This operation can
+ only be enabled on soft-delete enabled vaults.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedCertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_certificates.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedCertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_certificates.metadata = {'url': '/deletedcertificates'} # type: ignore
+
+ async def get_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.DeletedCertificateBundle":
+ """Retrieves information about the specified deleted certificate.
+
+ The GetDeletedCertificate operation retrieves the deleted certificate information plus its
+ attributes, such as retention interval, scheduled permanent deletion and the current deletion
+ recovery level. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedCertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} # type: ignore
+
+ async def purge_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified deleted certificate.
+
+ The PurgeDeletedCertificate operation performs an irreversible deletion of the specified
+ certificate, without possibility for recovery. The operation is not available if the recovery
+ level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.purge_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} # type: ignore
+
+ async def recover_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Recovers the deleted certificate back to its current version under /certificates.
+
+ The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The
+ operation is applicable in vaults enabled for soft-delete, and must be issued during the
+ retention interval (available in the deleted certificate's attributes). This operation requires
+ the certificates/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the deleted certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.recover_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}/recover'} # type: ignore
+
+ def get_storage_accounts(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.StorageListResult"]:
+ """List storage accounts managed by the specified key vault. This operation requires the
+ storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either StorageListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.StorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_storage_accounts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('StorageListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_storage_accounts.metadata = {'url': '/storage'} # type: ignore
+
+ async def delete_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Deletes a storage account. This operation requires the storage/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ async def get_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Gets information about a specified storage account. This operation requires the storage/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ async def set_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountCreateParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Creates or updates a new storage account. This operation requires the storage/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to create a storage account.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ async def update_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountUpdateParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Updates the specified attributes associated with the given storage account. This operation
+ requires the storage/set/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to update a storage account.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ async def regenerate_storage_account_key(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountRegenerteKeyParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Regenerates the specified key value for the given storage account. This operation requires the
+ storage/regeneratekey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to regenerate storage account key.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountRegenerteKeyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.regenerate_storage_account_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountRegenerteKeyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ regenerate_storage_account_key.metadata = {'url': '/storage/{storage-account-name}/regeneratekey'} # type: ignore
+
+ def get_sas_definitions(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.SasDefinitionListResult"]:
+ """List storage SAS definitions for the given storage account. This operation requires the
+ storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_sas_definitions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('SasDefinitionListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_sas_definitions.metadata = {'url': '/storage/{storage-account-name}/sas'} # type: ignore
+
+ async def delete_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Deletes a SAS definition from a specified storage account. This operation requires the
+ storage/deletesas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ async def get_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Gets information about a SAS definition for the specified storage account. This operation
+ requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ async def set_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ parameters: "models.SasDefinitionCreateParameters",
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Creates or updates a new SAS definition for the specified storage account. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to create a SAS definition.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SasDefinitionCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SasDefinitionCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ async def update_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ parameters: "models.SasDefinitionUpdateParameters",
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Updates the specified attributes associated with the given SAS definition. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to update a SAS definition.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SasDefinitionUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SasDefinitionUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/__init__.py
similarity index 58%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/__init__.py
index 6f134becdbd3..5f3be613a755 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
try:
@@ -59,7 +56,7 @@
from ._models_py3 import KeyRestoreParameters
from ._models_py3 import KeySignParameters
from ._models_py3 import KeyUpdateParameters
- from ._models_py3 import KeyVaultError, KeyVaultErrorException
+ from ._models_py3 import KeyVaultError
from ._models_py3 import KeyVerifyParameters
from ._models_py3 import KeyVerifyResult
from ._models_py3 import LifetimeAction
@@ -90,94 +87,95 @@
from ._models_py3 import Trigger
from ._models_py3 import X509CertificateProperties
except (SyntaxError, ImportError):
- from ._models import Action
- from ._models import AdministratorDetails
- from ._models import Attributes
- from ._models import BackupKeyResult
- from ._models import BackupSecretResult
- from ._models import CertificateAttributes
- from ._models import CertificateBundle
- from ._models import CertificateCreateParameters
- from ._models import CertificateImportParameters
- from ._models import CertificateIssuerItem
- from ._models import CertificateIssuerListResult
- from ._models import CertificateIssuerSetParameters
- from ._models import CertificateIssuerUpdateParameters
- from ._models import CertificateItem
- from ._models import CertificateListResult
- from ._models import CertificateMergeParameters
- from ._models import CertificateOperation
- from ._models import CertificateOperationUpdateParameter
- from ._models import CertificatePolicy
- from ._models import CertificateUpdateParameters
- from ._models import Contact
- from ._models import Contacts
- from ._models import DeletedCertificateBundle
- from ._models import DeletedCertificateItem
- from ._models import DeletedCertificateListResult
- from ._models import DeletedKeyBundle
- from ._models import DeletedKeyItem
- from ._models import DeletedKeyListResult
- from ._models import DeletedSecretBundle
- from ._models import DeletedSecretItem
- from ._models import DeletedSecretListResult
- from ._models import Error
- from ._models import IssuerAttributes
- from ._models import IssuerBundle
- from ._models import IssuerCredentials
- from ._models import IssuerParameters
- from ._models import JsonWebKey
- from ._models import KeyAttributes
- from ._models import KeyBundle
- from ._models import KeyCreateParameters
- from ._models import KeyImportParameters
- from ._models import KeyItem
- from ._models import KeyListResult
- from ._models import KeyOperationResult
- from ._models import KeyOperationsParameters
- from ._models import KeyProperties
- from ._models import KeyRestoreParameters
- from ._models import KeySignParameters
- from ._models import KeyUpdateParameters
- from ._models import KeyVaultError, KeyVaultErrorException
- from ._models import KeyVerifyParameters
- from ._models import KeyVerifyResult
- from ._models import LifetimeAction
- from ._models import OrganizationDetails
- from ._models import PendingCertificateSigningRequestResult
- from ._models import SasDefinitionAttributes
- from ._models import SasDefinitionBundle
- from ._models import SasDefinitionCreateParameters
- from ._models import SasDefinitionItem
- from ._models import SasDefinitionListResult
- from ._models import SasDefinitionUpdateParameters
- from ._models import SecretAttributes
- from ._models import SecretBundle
- from ._models import SecretItem
- from ._models import SecretListResult
- from ._models import SecretProperties
- from ._models import SecretRestoreParameters
- from ._models import SecretSetParameters
- from ._models import SecretUpdateParameters
- from ._models import StorageAccountAttributes
- from ._models import StorageAccountCreateParameters
- from ._models import StorageAccountItem
- from ._models import StorageAccountRegenerteKeyParameters
- from ._models import StorageAccountUpdateParameters
- from ._models import StorageBundle
- from ._models import StorageListResult
- from ._models import SubjectAlternativeNames
- from ._models import Trigger
- from ._models import X509CertificateProperties
+ from ._models import Action # type: ignore
+ from ._models import AdministratorDetails # type: ignore
+ from ._models import Attributes # type: ignore
+ from ._models import BackupKeyResult # type: ignore
+ from ._models import BackupSecretResult # type: ignore
+ from ._models import CertificateAttributes # type: ignore
+ from ._models import CertificateBundle # type: ignore
+ from ._models import CertificateCreateParameters # type: ignore
+ from ._models import CertificateImportParameters # type: ignore
+ from ._models import CertificateIssuerItem # type: ignore
+ from ._models import CertificateIssuerListResult # type: ignore
+ from ._models import CertificateIssuerSetParameters # type: ignore
+ from ._models import CertificateIssuerUpdateParameters # type: ignore
+ from ._models import CertificateItem # type: ignore
+ from ._models import CertificateListResult # type: ignore
+ from ._models import CertificateMergeParameters # type: ignore
+ from ._models import CertificateOperation # type: ignore
+ from ._models import CertificateOperationUpdateParameter # type: ignore
+ from ._models import CertificatePolicy # type: ignore
+ from ._models import CertificateUpdateParameters # type: ignore
+ from ._models import Contact # type: ignore
+ from ._models import Contacts # type: ignore
+ from ._models import DeletedCertificateBundle # type: ignore
+ from ._models import DeletedCertificateItem # type: ignore
+ from ._models import DeletedCertificateListResult # type: ignore
+ from ._models import DeletedKeyBundle # type: ignore
+ from ._models import DeletedKeyItem # type: ignore
+ from ._models import DeletedKeyListResult # type: ignore
+ from ._models import DeletedSecretBundle # type: ignore
+ from ._models import DeletedSecretItem # type: ignore
+ from ._models import DeletedSecretListResult # type: ignore
+ from ._models import Error # type: ignore
+ from ._models import IssuerAttributes # type: ignore
+ from ._models import IssuerBundle # type: ignore
+ from ._models import IssuerCredentials # type: ignore
+ from ._models import IssuerParameters # type: ignore
+ from ._models import JsonWebKey # type: ignore
+ from ._models import KeyAttributes # type: ignore
+ from ._models import KeyBundle # type: ignore
+ from ._models import KeyCreateParameters # type: ignore
+ from ._models import KeyImportParameters # type: ignore
+ from ._models import KeyItem # type: ignore
+ from ._models import KeyListResult # type: ignore
+ from ._models import KeyOperationResult # type: ignore
+ from ._models import KeyOperationsParameters # type: ignore
+ from ._models import KeyProperties # type: ignore
+ from ._models import KeyRestoreParameters # type: ignore
+ from ._models import KeySignParameters # type: ignore
+ from ._models import KeyUpdateParameters # type: ignore
+ from ._models import KeyVaultError # type: ignore
+ from ._models import KeyVerifyParameters # type: ignore
+ from ._models import KeyVerifyResult # type: ignore
+ from ._models import LifetimeAction # type: ignore
+ from ._models import OrganizationDetails # type: ignore
+ from ._models import PendingCertificateSigningRequestResult # type: ignore
+ from ._models import SasDefinitionAttributes # type: ignore
+ from ._models import SasDefinitionBundle # type: ignore
+ from ._models import SasDefinitionCreateParameters # type: ignore
+ from ._models import SasDefinitionItem # type: ignore
+ from ._models import SasDefinitionListResult # type: ignore
+ from ._models import SasDefinitionUpdateParameters # type: ignore
+ from ._models import SecretAttributes # type: ignore
+ from ._models import SecretBundle # type: ignore
+ from ._models import SecretItem # type: ignore
+ from ._models import SecretListResult # type: ignore
+ from ._models import SecretProperties # type: ignore
+ from ._models import SecretRestoreParameters # type: ignore
+ from ._models import SecretSetParameters # type: ignore
+ from ._models import SecretUpdateParameters # type: ignore
+ from ._models import StorageAccountAttributes # type: ignore
+ from ._models import StorageAccountCreateParameters # type: ignore
+ from ._models import StorageAccountItem # type: ignore
+ from ._models import StorageAccountRegenerteKeyParameters # type: ignore
+ from ._models import StorageAccountUpdateParameters # type: ignore
+ from ._models import StorageBundle # type: ignore
+ from ._models import StorageListResult # type: ignore
+ from ._models import SubjectAlternativeNames # type: ignore
+ from ._models import Trigger # type: ignore
+ from ._models import X509CertificateProperties # type: ignore
+
from ._key_vault_client_enums import (
- JsonWebKeyType,
- JsonWebKeyCurveName,
- DeletionRecoveryLevel,
- KeyUsageType,
ActionType,
- JsonWebKeyOperation,
+ DeletionRecoveryLevel,
+ JsonWebKeyCurveName,
JsonWebKeyEncryptionAlgorithm,
+ JsonWebKeyOperation,
JsonWebKeySignatureAlgorithm,
+ JsonWebKeyType,
+ KeyUsageType,
)
__all__ = [
@@ -230,7 +228,7 @@
'KeyRestoreParameters',
'KeySignParameters',
'KeyUpdateParameters',
- 'KeyVaultError', 'KeyVaultErrorException',
+ 'KeyVaultError',
'KeyVerifyParameters',
'KeyVerifyResult',
'LifetimeAction',
@@ -260,12 +258,12 @@
'SubjectAlternativeNames',
'Trigger',
'X509CertificateProperties',
- 'JsonWebKeyType',
- 'JsonWebKeyCurveName',
- 'DeletionRecoveryLevel',
- 'KeyUsageType',
'ActionType',
- 'JsonWebKeyOperation',
+ 'DeletionRecoveryLevel',
+ 'JsonWebKeyCurveName',
'JsonWebKeyEncryptionAlgorithm',
+ 'JsonWebKeyOperation',
'JsonWebKeySignatureAlgorithm',
+ 'JsonWebKeyType',
+ 'KeyUsageType',
]
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_key_vault_client_enums.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_key_vault_client_enums.py
new file mode 100644
index 000000000000..2c8667a888e8
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_key_vault_client_enums.py
@@ -0,0 +1,112 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from enum import Enum, EnumMeta
+from six import with_metaclass
+
+class _CaseInsensitiveEnumMeta(EnumMeta):
+ def __getitem__(self, name):
+ return super().__getitem__(name.upper())
+
+ def __getattr__(cls, name):
+ """Return the enum member matching `name`
+ We use __getattr__ instead of descriptors or inserting into the enum
+ class' __dict__ in order to support `name` and `value` being both
+ properties for enum members (which live in the class' __dict__) and
+ enum members themselves.
+ """
+ try:
+ return cls._member_map_[name.upper()]
+ except KeyError:
+ raise AttributeError(name)
+
+
+class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The type of the action.
+ """
+
+ EMAIL_CONTACTS = "EmailContacts"
+ AUTO_RENEW = "AutoRenew"
+
+class DeletionRecoveryLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """Reflects the deletion recovery level currently in effect for keys in the current vault. If it
+ contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only
+ the system can purge the key, at the end of the retention interval.
+ """
+
+ PURGEABLE = "Purgeable" #: Soft-delete is not enabled for this vault. A DELETE operation results in immediate and irreversible data loss.
+ RECOVERABLE_PURGEABLE = "Recoverable+Purgeable" #: Soft-delete is enabled for this vault; A privileged user may trigger an immediate, irreversible deletion(purge) of a deleted entity.
+ RECOVERABLE = "Recoverable" #: Soft-delete is enabled for this vault and purge has been disabled. A deleted entity will remain in this state until recovered, or the end of the retention interval.
+ RECOVERABLE_PROTECTED_SUBSCRIPTION = "Recoverable+ProtectedSubscription" #: Soft-delete is enabled for this vault, and the subscription is protected against immediate deletion.
+
+class JsonWebKeyCurveName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """Elliptic curve name. For valid values, see JsonWebKeyCurveName.
+ """
+
+ P256 = "P-256" #: The NIST P-256 elliptic curve, AKA SECG curve SECP256R1.
+ P384 = "P-384" #: The NIST P-384 elliptic curve, AKA SECG curve SECP384R1.
+ P521 = "P-521" #: The NIST P-521 elliptic curve, AKA SECG curve SECP521R1.
+ SECP256_K1 = "SECP256K1" #: The SECG SECP256K1 elliptic curve.
+
+class JsonWebKeyEncryptionAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """algorithm identifier
+ """
+
+ RSA_OAEP = "RSA-OAEP"
+ RSA_OAEP256 = "RSA-OAEP-256"
+ RSA1_5 = "RSA1_5"
+
+class JsonWebKeyOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """JSON web key operations. For more information, see JsonWebKeyOperation.
+ """
+
+ ENCRYPT = "encrypt"
+ DECRYPT = "decrypt"
+ SIGN = "sign"
+ VERIFY = "verify"
+ WRAP_KEY = "wrapKey"
+ UNWRAP_KEY = "unwrapKey"
+
+class JsonWebKeySignatureAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The signing/verification algorithm identifier. For more information on possible algorithm
+ types, see JsonWebKeySignatureAlgorithm.
+ """
+
+ PS256 = "PS256"
+ PS384 = "PS384"
+ PS512 = "PS512"
+ RS256 = "RS256"
+ RS384 = "RS384"
+ RS512 = "RS512"
+ RSNULL = "RSNULL"
+ ES256 = "ES256"
+ ES384 = "ES384"
+ ES512 = "ES512"
+ ECDSA256 = "ECDSA256"
+
+class JsonWebKeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """JsonWebKey key type (kty).
+ """
+
+ EC = "EC"
+ EC_HSM = "EC-HSM"
+ RSA = "RSA"
+ RSA_HSM = "RSA-HSM"
+ OCT = "oct"
+
+class KeyUsageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+
+ DIGITAL_SIGNATURE = "digitalSignature"
+ NON_REPUDIATION = "nonRepudiation"
+ KEY_ENCIPHERMENT = "keyEncipherment"
+ DATA_ENCIPHERMENT = "dataEncipherment"
+ KEY_AGREEMENT = "keyAgreement"
+ KEY_CERT_SIGN = "keyCertSign"
+ C_RL_SIGN = "cRLSign"
+ ENCIPHER_ONLY = "encipherOnly"
+ DECIPHER_ONLY = "decipherOnly"
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_models.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_models.py
similarity index 75%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_models.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_models.py
index d20f02613408..71ec3328f9d0 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_models.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_models.py
@@ -1,36 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from msrest.serialization import Model
from azure.core.exceptions import HttpResponseError
+import msrest.serialization
-class Action(Model):
+class Action(msrest.serialization.Model):
"""The action that will be executed.
- :param action_type: The type of the action. Possible values include:
- 'EmailContacts', 'AutoRenew'
+ :param action_type: The type of the action. Possible values include: "EmailContacts",
+ "AutoRenew".
:type action_type: str or ~azure.keyvault.v2016_10_01.models.ActionType
"""
_attribute_map = {
- 'action_type': {'key': 'action_type', 'type': 'ActionType'},
+ 'action_type': {'key': 'action_type', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Action, self).__init__(**kwargs)
self.action_type = kwargs.get('action_type', None)
-class AdministratorDetails(Model):
+class AdministratorDetails(msrest.serialization.Model):
"""Details of the organization administrator of the certificate issuer.
:param first_name: First name.
@@ -50,7 +50,10 @@ class AdministratorDetails(Model):
'phone': {'key': 'phone', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(AdministratorDetails, self).__init__(**kwargs)
self.first_name = kwargs.get('first_name', None)
self.last_name = kwargs.get('last_name', None)
@@ -58,22 +61,21 @@ def __init__(self, **kwargs):
self.phone = kwargs.get('phone', None)
-class Attributes(Model):
+class Attributes(msrest.serialization.Model):
"""The object attributes managed by the KeyVault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -89,7 +91,10 @@ class Attributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Attributes, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.not_before = kwargs.get('not_before', None)
@@ -98,11 +103,10 @@ def __init__(self, **kwargs):
self.updated = None
-class BackupKeyResult(Model):
+class BackupKeyResult(msrest.serialization.Model):
"""The backup key result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up key.
:vartype value: bytes
@@ -116,16 +120,18 @@ class BackupKeyResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupKeyResult, self).__init__(**kwargs)
self.value = None
-class BackupSecretResult(Model):
+class BackupSecretResult(msrest.serialization.Model):
"""The backup secret result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up secret.
:vartype value: bytes
@@ -139,7 +145,10 @@ class BackupSecretResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupSecretResult, self).__init__(**kwargs)
self.value = None
@@ -147,28 +156,24 @@ def __init__(self, **kwargs):
class CertificateAttributes(Attributes):
"""The certificate management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for certificates in the current vault. If it contains 'Purgeable',
- the certificate can be permanently deleted by a privileged user;
- otherwise, only the system can purge the certificate, at the end of the
- retention interval. Possible values include: 'Purgeable',
- 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for certificates
+ in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by
+ a privileged user; otherwise, only the system can purge the certificate, at the end of the
+ retention interval. Possible values include: "Purgeable", "Recoverable+Purgeable",
+ "Recoverable", "Recoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
"""
_validation = {
@@ -186,16 +191,18 @@ class CertificateAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateAttributes, self).__init__(**kwargs)
self.recovery_level = None
-class CertificateBundle(Model):
+class CertificateBundle(msrest.serialization.Model):
"""A certificate bundle consists of a certificate (X509) plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -213,7 +220,7 @@ class CertificateBundle(Model):
:type content_type: str
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -237,7 +244,10 @@ class CertificateBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateBundle, self).__init__(**kwargs)
self.id = None
self.kid = None
@@ -250,17 +260,14 @@ def __init__(self, **kwargs):
self.tags = kwargs.get('tags', None)
-class CertificateCreateParameters(Model):
+class CertificateCreateParameters(msrest.serialization.Model):
"""The certificate create parameters.
:param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -270,33 +277,32 @@ class CertificateCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateCreateParameters, self).__init__(**kwargs)
self.certificate_policy = kwargs.get('certificate_policy', None)
self.certificate_attributes = kwargs.get('certificate_attributes', None)
self.tags = kwargs.get('tags', None)
-class CertificateImportParameters(Model):
+class CertificateImportParameters(msrest.serialization.Model):
"""The certificate import parameters.
All required parameters must be populated in order to send to Azure.
- :param base64_encoded_certificate: Required. Base64 encoded representation
- of the certificate object to import. This certificate needs to contain the
- private key.
+ :param base64_encoded_certificate: Required. Base64 encoded representation of the certificate
+ object to import. This certificate needs to contain the private key.
:type base64_encoded_certificate: str
- :param password: If the private key in base64EncodedCertificate is
- encrypted, the password used for encryption.
+ :param password: If the private key in base64EncodedCertificate is encrypted, the password used
+ for encryption.
:type password: str
:param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -312,16 +318,19 @@ class CertificateImportParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateImportParameters, self).__init__(**kwargs)
- self.base64_encoded_certificate = kwargs.get('base64_encoded_certificate', None)
+ self.base64_encoded_certificate = kwargs['base64_encoded_certificate']
self.password = kwargs.get('password', None)
self.certificate_policy = kwargs.get('certificate_policy', None)
self.certificate_attributes = kwargs.get('certificate_attributes', None)
self.tags = kwargs.get('tags', None)
-class CertificateIssuerItem(Model):
+class CertificateIssuerItem(msrest.serialization.Model):
"""The certificate issuer item containing certificate issuer metadata.
:param id: Certificate Identifier.
@@ -335,23 +344,23 @@ class CertificateIssuerItem(Model):
'provider': {'key': 'provider', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerItem, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.provider = kwargs.get('provider', None)
-class CertificateIssuerListResult(Model):
+class CertificateIssuerListResult(msrest.serialization.Model):
"""The certificate issuer list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of certificate issuers
- in the key vault along with a link to the next page of certificate
- issuers.
- :vartype value:
- list[~azure.keyvault.v2016_10_01.models.CertificateIssuerItem]
+ :ivar value: A response message containing a list of certificate issuers in the key vault along
+ with a link to the next page of certificate issuers.
+ :vartype value: list[~azure.keyvault.v2016_10_01.models.CertificateIssuerItem]
:ivar next_link: The URL to get the next set of certificate issuers.
:vartype next_link: str
"""
@@ -366,13 +375,16 @@ class CertificateIssuerListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class CertificateIssuerSetParameters(Model):
+class CertificateIssuerSetParameters(msrest.serialization.Model):
"""The certificate issuer set parameters.
All required parameters must be populated in order to send to Azure.
@@ -381,10 +393,8 @@ class CertificateIssuerSetParameters(Model):
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v2016_10_01.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
"""
@@ -400,25 +410,26 @@ class CertificateIssuerSetParameters(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerSetParameters, self).__init__(**kwargs)
- self.provider = kwargs.get('provider', None)
+ self.provider = kwargs['provider']
self.credentials = kwargs.get('credentials', None)
self.organization_details = kwargs.get('organization_details', None)
self.attributes = kwargs.get('attributes', None)
-class CertificateIssuerUpdateParameters(Model):
+class CertificateIssuerUpdateParameters(msrest.serialization.Model):
"""The certificate issuer update parameters.
:param provider: The issuer provider.
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v2016_10_01.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
"""
@@ -430,7 +441,10 @@ class CertificateIssuerUpdateParameters(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerUpdateParameters, self).__init__(**kwargs)
self.provider = kwargs.get('provider', None)
self.credentials = kwargs.get('credentials', None)
@@ -438,14 +452,14 @@ def __init__(self, **kwargs):
self.attributes = kwargs.get('attributes', None)
-class CertificateItem(Model):
+class CertificateItem(msrest.serialization.Model):
"""The certificate item containing certificate metadata.
:param id: Certificate identifier.
:type id: str
:param attributes: The certificate management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param x509_thumbprint: Thumbprint of the certificate.
:type x509_thumbprint: bytes
@@ -458,7 +472,10 @@ class CertificateItem(Model):
'x509_thumbprint': {'key': 'x5t', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateItem, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.attributes = kwargs.get('attributes', None)
@@ -466,14 +483,13 @@ def __init__(self, **kwargs):
self.x509_thumbprint = kwargs.get('x509_thumbprint', None)
-class CertificateListResult(Model):
+class CertificateListResult(msrest.serialization.Model):
"""The certificate list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of certificates in the
- key vault along with a link to the next page of certificates.
+ :ivar value: A response message containing a list of certificates in the key vault along with a
+ link to the next page of certificates.
:vartype value: list[~azure.keyvault.v2016_10_01.models.CertificateItem]
:ivar next_link: The URL to get the next set of certificates.
:vartype next_link: str
@@ -489,25 +505,25 @@ class CertificateListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class CertificateMergeParameters(Model):
+class CertificateMergeParameters(msrest.serialization.Model):
"""The certificate merge parameters.
All required parameters must be populated in order to send to Azure.
- :param x509_certificates: Required. The certificate or the certificate
- chain to merge.
+ :param x509_certificates: Required. The certificate or the certificate chain to merge.
:type x509_certificates: list[bytearray]
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -521,30 +537,30 @@ class CertificateMergeParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateMergeParameters, self).__init__(**kwargs)
- self.x509_certificates = kwargs.get('x509_certificates', None)
+ self.x509_certificates = kwargs['x509_certificates']
self.certificate_attributes = kwargs.get('certificate_attributes', None)
self.tags = kwargs.get('tags', None)
-class CertificateOperation(Model):
+class CertificateOperation(msrest.serialization.Model):
"""A certificate operation is returned in case of asynchronous requests.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
- :param issuer_parameters: Parameters for the issuer of the X509 component
- of a certificate.
- :type issuer_parameters:
- ~azure.keyvault.v2016_10_01.models.IssuerParameters
- :param csr: The certificate signing request (CSR) that is being used in
- the certificate operation.
+ :param issuer_parameters: Parameters for the issuer of the X509 component of a certificate.
+ :type issuer_parameters: ~azure.keyvault.v2016_10_01.models.IssuerParameters
+ :param csr: The certificate signing request (CSR) that is being used in the certificate
+ operation.
:type csr: bytearray
- :param cancellation_requested: Indicates if cancellation was requested on
- the certificate operation.
+ :param cancellation_requested: Indicates if cancellation was requested on the certificate
+ operation.
:type cancellation_requested: bool
:param status: Status of the certificate operation.
:type status: str
@@ -552,8 +568,7 @@ class CertificateOperation(Model):
:type status_details: str
:param error: Error encountered, if any, during the certificate operation.
:type error: ~azure.keyvault.v2016_10_01.models.Error
- :param target: Location which contains the result of the certificate
- operation.
+ :param target: Location which contains the result of the certificate operation.
:type target: str
:param request_id: Identifier for the certificate operation.
:type request_id: str
@@ -575,7 +590,10 @@ class CertificateOperation(Model):
'request_id': {'key': 'request_id', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateOperation, self).__init__(**kwargs)
self.id = None
self.issuer_parameters = kwargs.get('issuer_parameters', None)
@@ -588,13 +606,13 @@ def __init__(self, **kwargs):
self.request_id = kwargs.get('request_id', None)
-class CertificateOperationUpdateParameter(Model):
+class CertificateOperationUpdateParameter(msrest.serialization.Model):
"""The certificate operation update parameters.
All required parameters must be populated in order to send to Azure.
- :param cancellation_requested: Required. Indicates if cancellation was
- requested on the certificate operation.
+ :param cancellation_requested: Required. Indicates if cancellation was requested on the
+ certificate operation.
:type cancellation_requested: bool
"""
@@ -606,36 +624,32 @@ class CertificateOperationUpdateParameter(Model):
'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateOperationUpdateParameter, self).__init__(**kwargs)
- self.cancellation_requested = kwargs.get('cancellation_requested', None)
+ self.cancellation_requested = kwargs['cancellation_requested']
-class CertificatePolicy(Model):
+class CertificatePolicy(msrest.serialization.Model):
"""Management policy for a certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
:param key_properties: Properties of the key backing a certificate.
:type key_properties: ~azure.keyvault.v2016_10_01.models.KeyProperties
:param secret_properties: Properties of the secret backing a certificate.
- :type secret_properties:
- ~azure.keyvault.v2016_10_01.models.SecretProperties
- :param x509_certificate_properties: Properties of the X509 component of a
+ :type secret_properties: ~azure.keyvault.v2016_10_01.models.SecretProperties
+ :param x509_certificate_properties: Properties of the X509 component of a certificate.
+ :type x509_certificate_properties: ~azure.keyvault.v2016_10_01.models.X509CertificateProperties
+ :param lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a
certificate.
- :type x509_certificate_properties:
- ~azure.keyvault.v2016_10_01.models.X509CertificateProperties
- :param lifetime_actions: Actions that will be performed by Key Vault over
- the lifetime of a certificate.
- :type lifetime_actions:
- list[~azure.keyvault.v2016_10_01.models.LifetimeAction]
- :param issuer_parameters: Parameters for the issuer of the X509 component
- of a certificate.
- :type issuer_parameters:
- ~azure.keyvault.v2016_10_01.models.IssuerParameters
+ :type lifetime_actions: list[~azure.keyvault.v2016_10_01.models.LifetimeAction]
+ :param issuer_parameters: Parameters for the issuer of the X509 component of a certificate.
+ :type issuer_parameters: ~azure.keyvault.v2016_10_01.models.IssuerParameters
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
"""
@@ -654,7 +668,10 @@ class CertificatePolicy(Model):
'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificatePolicy, self).__init__(**kwargs)
self.id = None
self.key_properties = kwargs.get('key_properties', None)
@@ -665,17 +682,14 @@ def __init__(self, **kwargs):
self.attributes = kwargs.get('attributes', None)
-class CertificateUpdateParameters(Model):
+class CertificateUpdateParameters(msrest.serialization.Model):
"""The certificate update parameters.
:param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -685,14 +699,17 @@ class CertificateUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateUpdateParameters, self).__init__(**kwargs)
self.certificate_policy = kwargs.get('certificate_policy', None)
self.certificate_attributes = kwargs.get('certificate_attributes', None)
self.tags = kwargs.get('tags', None)
-class Contact(Model):
+class Contact(msrest.serialization.Model):
"""The contact information for the vault certificates.
:param email_address: Email address.
@@ -709,18 +726,20 @@ class Contact(Model):
'phone': {'key': 'phone', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Contact, self).__init__(**kwargs)
self.email_address = kwargs.get('email_address', None)
self.name = kwargs.get('name', None)
self.phone = kwargs.get('phone', None)
-class Contacts(Model):
+class Contacts(msrest.serialization.Model):
"""The contacts for the vault certificates.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Identifier for the contacts collection.
:vartype id: str
@@ -737,18 +756,19 @@ class Contacts(Model):
'contact_list': {'key': 'contacts', 'type': '[Contact]'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Contacts, self).__init__(**kwargs)
self.id = None
self.contact_list = kwargs.get('contact_list', None)
class DeletedCertificateBundle(CertificateBundle):
- """A Deleted Certificate consisting of its previous id, attributes and its
- tags, as well as information on when it will be purged.
+ """A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -766,16 +786,15 @@ class DeletedCertificateBundle(CertificateBundle):
:type content_type: str
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted certificate.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ certificate.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the certificate is scheduled to
- be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the certificate was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the certificate is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the certificate was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -803,7 +822,10 @@ class DeletedCertificateBundle(CertificateBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedCertificateBundle, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
@@ -811,28 +833,25 @@ def __init__(self, **kwargs):
class DeletedCertificateItem(CertificateItem):
- """The deleted certificate item containing metadata about the deleted
- certificate.
+ """The deleted certificate item containing metadata about the deleted certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Certificate identifier.
:type id: str
:param attributes: The certificate management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param x509_thumbprint: Thumbprint of the certificate.
:type x509_thumbprint: bytes
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted certificate.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ certificate.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the certificate is scheduled to
- be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the certificate was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the certificate is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the certificate was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -850,23 +869,24 @@ class DeletedCertificateItem(CertificateItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedCertificateItem, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedCertificateListResult(Model):
+class DeletedCertificateListResult(msrest.serialization.Model):
"""A list of certificates that have been deleted in this vault.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of deleted certificates
- in the vault along with a link to the next page of deleted certificates
- :vartype value:
- list[~azure.keyvault.v2016_10_01.models.DeletedCertificateItem]
+ :ivar value: A response message containing a list of deleted certificates in the vault along
+ with a link to the next page of deleted certificates.
+ :vartype value: list[~azure.keyvault.v2016_10_01.models.DeletedCertificateItem]
:ivar next_link: The URL to get the next set of deleted certificates.
:vartype next_link: str
"""
@@ -881,26 +901,28 @@ class DeletedCertificateListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedCertificateListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class KeyBundle(Model):
+class KeyBundle(msrest.serialization.Model):
"""A KeyBundle consisting of a WebKey plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param key: The Json web key.
:type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
"""
@@ -915,7 +937,10 @@ class KeyBundle(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyBundle, self).__init__(**kwargs)
self.key = kwargs.get('key', None)
self.attributes = kwargs.get('attributes', None)
@@ -924,29 +949,26 @@ def __init__(self, **kwargs):
class DeletedKeyBundle(KeyBundle):
- """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion
- info.
+ """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param key: The Json web key.
:type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted key.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the key is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the key was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -965,27 +987,29 @@ class DeletedKeyBundle(KeyBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedKeyBundle, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class KeyItem(Model):
+class KeyItem(msrest.serialization.Model):
"""The key item containing key metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param kid: Key identifier.
:type kid: str
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1000,7 +1024,10 @@ class KeyItem(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyItem, self).__init__(**kwargs)
self.kid = kwargs.get('kid', None)
self.attributes = kwargs.get('attributes', None)
@@ -1009,29 +1036,26 @@ def __init__(self, **kwargs):
class DeletedKeyItem(KeyItem):
- """The deleted key item containing the deleted key metadata and information
- about deletion.
+ """The deleted key item containing the deleted key metadata and information about deletion.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param kid: Key identifier.
:type kid: str
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted key.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the key is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the key was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1050,21 +1074,23 @@ class DeletedKeyItem(KeyItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedKeyItem, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedKeyListResult(Model):
+class DeletedKeyListResult(msrest.serialization.Model):
"""A list of keys that have been deleted in this vault.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of deleted keys in the
- vault along with a link to the next page of deleted keys
+ :ivar value: A response message containing a list of deleted keys in the vault along with a
+ link to the next page of deleted keys.
:vartype value: list[~azure.keyvault.v2016_10_01.models.DeletedKeyItem]
:ivar next_link: The URL to get the next set of deleted keys.
:vartype next_link: str
@@ -1080,17 +1106,19 @@ class DeletedKeyListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedKeyListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SecretBundle(Model):
+class SecretBundle(msrest.serialization.Model):
"""A secret consisting of a value, id and its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param value: The secret value.
:type value: str
@@ -1100,13 +1128,13 @@ class SecretBundle(Model):
:type content_type: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar kid: If this is a secret backing a KV certificate, then this field
- specifies the corresponding key backing the KV certificate.
+ :ivar kid: If this is a secret backing a KV certificate, then this field specifies the
+ corresponding key backing the KV certificate.
:vartype kid: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a secret backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a secret
+ backing a certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1125,7 +1153,10 @@ class SecretBundle(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretBundle, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.id = kwargs.get('id', None)
@@ -1137,11 +1168,9 @@ def __init__(self, **kwargs):
class DeletedSecretBundle(SecretBundle):
- """A Deleted Secret consisting of its previous id, attributes and its tags, as
- well as information on when it will be purged.
+ """A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param value: The secret value.
:type value: str
@@ -1151,22 +1180,21 @@ class DeletedSecretBundle(SecretBundle):
:type content_type: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar kid: If this is a secret backing a KV certificate, then this field
- specifies the corresponding key backing the KV certificate.
+ :ivar kid: If this is a secret backing a KV certificate, then this field specifies the
+ corresponding key backing the KV certificate.
:vartype kid: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a secret backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a secret
+ backing a certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted secret.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ secret.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the secret is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the secret was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the secret is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the secret was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1189,29 +1217,31 @@ class DeletedSecretBundle(SecretBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSecretBundle, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class SecretItem(Model):
+class SecretItem(msrest.serialization.Model):
"""The secret item containing secret metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Secret identifier.
:type id: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a key backing
+ a certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1227,7 +1257,10 @@ class SecretItem(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretItem, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.attributes = kwargs.get('attributes', None)
@@ -1239,28 +1272,26 @@ def __init__(self, **kwargs):
class DeletedSecretItem(SecretItem):
"""The deleted secret item containing metadata about the deleted secret.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Secret identifier.
:type id: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a key backing
+ a certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted secret.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ secret.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the secret is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the secret was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the secret is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the secret was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1280,21 +1311,23 @@ class DeletedSecretItem(SecretItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSecretItem, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedSecretListResult(Model):
+class DeletedSecretListResult(msrest.serialization.Model):
"""The deleted secret list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of the deleted secrets
- in the vault along with a link to the next page of deleted secrets
+ :ivar value: A response message containing a list of the deleted secrets in the vault along
+ with a link to the next page of deleted secrets.
:vartype value: list[~azure.keyvault.v2016_10_01.models.DeletedSecretItem]
:ivar next_link: The URL to get the next set of deleted secrets.
:vartype next_link: str
@@ -1310,23 +1343,25 @@ class DeletedSecretListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSecretListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class Error(Model):
+class Error(msrest.serialization.Model):
"""The key vault server error.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: The error code.
:vartype code: str
:ivar message: The error message.
:vartype message: str
- :ivar inner_error:
+ :ivar inner_error: The key vault server error.
:vartype inner_error: ~azure.keyvault.v2016_10_01.models.Error
"""
@@ -1342,25 +1377,27 @@ class Error(Model):
'inner_error': {'key': 'innererror', 'type': 'Error'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Error, self).__init__(**kwargs)
self.code = None
self.message = None
self.inner_error = None
-class IssuerAttributes(Model):
+class IssuerAttributes(msrest.serialization.Model):
"""The attributes of an issuer managed by the Key Vault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the issuer is enabled.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -1374,18 +1411,20 @@ class IssuerAttributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(IssuerAttributes, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.created = None
self.updated = None
-class IssuerBundle(Model):
+class IssuerBundle(msrest.serialization.Model):
"""The issuer for Key Vault certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Identifier for the issuer object.
:vartype id: str
@@ -1393,10 +1432,8 @@ class IssuerBundle(Model):
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v2016_10_01.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
"""
@@ -1413,7 +1450,10 @@ class IssuerBundle(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(IssuerBundle, self).__init__(**kwargs)
self.id = None
self.provider = kwargs.get('provider', None)
@@ -1422,7 +1462,7 @@ def __init__(self, **kwargs):
self.attributes = kwargs.get('attributes', None)
-class IssuerCredentials(Model):
+class IssuerCredentials(msrest.serialization.Model):
"""The credentials to be used for the certificate issuer.
:param account_id: The user name/account name/account id.
@@ -1436,20 +1476,22 @@ class IssuerCredentials(Model):
'password': {'key': 'pwd', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(IssuerCredentials, self).__init__(**kwargs)
self.account_id = kwargs.get('account_id', None)
self.password = kwargs.get('password', None)
-class IssuerParameters(Model):
+class IssuerParameters(msrest.serialization.Model):
"""Parameters for the issuer of the X509 component of a certificate.
- :param name: Name of the referenced issuer object or reserved names; for
- example, 'Self' or 'Unknown'.
+ :param name: Name of the referenced issuer object or reserved names; for example, 'Self' or
+ 'Unknown'.
:type name: str
- :param certificate_type: Type of certificate to be requested from the
- issuer provider.
+ :param certificate_type: Type of certificate to be requested from the issuer provider.
:type certificate_type: str
"""
@@ -1458,19 +1500,22 @@ class IssuerParameters(Model):
'certificate_type': {'key': 'cty', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(IssuerParameters, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.certificate_type = kwargs.get('certificate_type', None)
-class JsonWebKey(Model):
+class JsonWebKey(msrest.serialization.Model):
"""As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18.
:param kid: Key identifier.
:type kid: str
- :param kty: JsonWebKey key type (kty). Possible values include: 'EC',
- 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'
+ :param kty: JsonWebKey key type (kty). Possible values include: "EC", "EC-HSM", "RSA", "RSA-
+ HSM", "oct".
:type kty: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyType
:param key_ops:
:type key_ops: list[str]
@@ -1494,9 +1539,8 @@ class JsonWebKey(Model):
:type k: bytes
:param t: HSM Token, used with 'Bring Your Own Key'.
:type t: bytes
- :param crv: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'SECP256K1'
+ :param crv: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "SECP256K1".
:type crv: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyCurveName
:param x: X component of an EC public key.
:type x: bytes
@@ -1523,7 +1567,10 @@ class JsonWebKey(Model):
'y': {'key': 'y', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(JsonWebKey, self).__init__(**kwargs)
self.kid = kwargs.get('kid', None)
self.kty = kwargs.get('kty', None)
@@ -1546,27 +1593,24 @@ def __init__(self, **kwargs):
class KeyAttributes(Attributes):
"""The attributes of a key managed by the key vault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for keys in the current vault. If it contains 'Purgeable' the key
- can be permanently deleted by a privileged user; otherwise, only the
- system can purge the key, at the end of the retention interval. Possible
- values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for keys in the
+ current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged
+ user; otherwise, only the system can purge the key, at the end of the retention interval.
+ Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
"""
_validation = {
@@ -1584,38 +1628,37 @@ class KeyAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyAttributes, self).__init__(**kwargs)
self.recovery_level = None
-class KeyCreateParameters(Model):
+class KeyCreateParameters(msrest.serialization.Model):
"""The key create parameters.
All required parameters must be populated in order to send to Azure.
- :param kty: Required. The type of key to create. For valid values, see
- JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM',
- 'oct'
+ :param kty: Required. The type of key to create. For valid values, see JsonWebKeyType. Possible
+ values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
:type kty: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or 4096
- for RSA.
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
:type key_size: int
:param key_ops:
- :type key_ops: list[str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
- :param key_attributes:
+ :type key_ops: list[str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'SECP256K1'
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "SECP256K1".
:type curve: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyCurveName
"""
_validation = {
- 'kty': {'required': True, 'min_length': 1},
+ 'kty': {'required': True},
}
_attribute_map = {
@@ -1627,9 +1670,12 @@ class KeyCreateParameters(Model):
'curve': {'key': 'crv', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyCreateParameters, self).__init__(**kwargs)
- self.kty = kwargs.get('kty', None)
+ self.kty = kwargs['kty']
self.key_size = kwargs.get('key_size', None)
self.key_ops = kwargs.get('key_ops', None)
self.key_attributes = kwargs.get('key_attributes', None)
@@ -1637,18 +1683,18 @@ def __init__(self, **kwargs):
self.curve = kwargs.get('curve', None)
-class KeyImportParameters(Model):
+class KeyImportParameters(msrest.serialization.Model):
"""The key import parameters.
All required parameters must be populated in order to send to Azure.
:param hsm: Whether to import as a hardware key (HSM) or software key.
:type hsm: bool
- :param key: Required. The Json web key
+ :param key: Required. The Json web key.
:type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
:param key_attributes: The key management attributes.
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -1663,22 +1709,24 @@ class KeyImportParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyImportParameters, self).__init__(**kwargs)
self.hsm = kwargs.get('hsm', None)
- self.key = kwargs.get('key', None)
+ self.key = kwargs['key']
self.key_attributes = kwargs.get('key_attributes', None)
self.tags = kwargs.get('tags', None)
-class KeyListResult(Model):
+class KeyListResult(msrest.serialization.Model):
"""The key list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of keys in the key vault
- along with a link to the next page of keys.
+ :ivar value: A response message containing a list of keys in the key vault along with a link to
+ the next page of keys.
:vartype value: list[~azure.keyvault.v2016_10_01.models.KeyItem]
:ivar next_link: The URL to get the next set of keys.
:vartype next_link: str
@@ -1694,19 +1742,21 @@ class KeyListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class KeyOperationResult(Model):
+class KeyOperationResult(msrest.serialization.Model):
"""The key operation result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar kid: Key identifier
+ :ivar kid: Key identifier.
:vartype kid: str
:ivar result:
:vartype result: bytes
@@ -1722,27 +1772,29 @@ class KeyOperationResult(Model):
'result': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyOperationResult, self).__init__(**kwargs)
self.kid = None
self.result = None
-class KeyOperationsParameters(Model):
+class KeyOperationsParameters(msrest.serialization.Model):
"""The key operations parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
+ :param algorithm: Required. algorithm identifier. Possible values include: "RSA-OAEP", "RSA-
+ OAEP-256", "RSA1_5".
+ :type algorithm: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
:param value: Required.
:type value: bytes
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'value': {'required': True},
}
@@ -1751,24 +1803,25 @@ class KeyOperationsParameters(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyOperationsParameters, self).__init__(**kwargs)
- self.algorithm = kwargs.get('algorithm', None)
- self.value = kwargs.get('value', None)
+ self.algorithm = kwargs['algorithm']
+ self.value = kwargs['value']
-class KeyProperties(Model):
+class KeyProperties(msrest.serialization.Model):
"""Properties of the key pair backing a certificate.
:param exportable: Indicates if the private key can be exported.
:type exportable: bool
:param key_type: The key type.
:type key_type: str
- :param key_size: The key size in bits. For example: 2048, 3072, or 4096
- for RSA.
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
:type key_size: int
- :param reuse_key: Indicates if the same key pair will be used on
- certificate renewal.
+ :param reuse_key: Indicates if the same key pair will be used on certificate renewal.
:type reuse_key: bool
"""
@@ -1779,7 +1832,10 @@ class KeyProperties(Model):
'reuse_key': {'key': 'reuse_key', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyProperties, self).__init__(**kwargs)
self.exportable = kwargs.get('exportable', None)
self.key_type = kwargs.get('key_type', None)
@@ -1787,13 +1843,12 @@ def __init__(self, **kwargs):
self.reuse_key = kwargs.get('reuse_key', None)
-class KeyRestoreParameters(Model):
+class KeyRestoreParameters(msrest.serialization.Model):
"""The key restore parameters.
All required parameters must be populated in order to send to Azure.
- :param key_bundle_backup: Required. The backup blob associated with a key
- bundle.
+ :param key_bundle_backup: Required. The backup blob associated with a key bundle.
:type key_bundle_backup: bytes
"""
@@ -1805,29 +1860,30 @@ class KeyRestoreParameters(Model):
'key_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyRestoreParameters, self).__init__(**kwargs)
- self.key_bundle_backup = kwargs.get('key_bundle_backup', None)
+ self.key_bundle_backup = kwargs['key_bundle_backup']
-class KeySignParameters(Model):
+class KeySignParameters(msrest.serialization.Model):
"""The key operations parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. The signing/verification algorithm identifier.
- For more information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384',
- 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512',
- 'ECDSA256'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
+ :param algorithm: Required. The signing/verification algorithm identifier. For more information
+ on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include:
+ "PS256", "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512",
+ "ECDSA256".
+ :type algorithm: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
:param value: Required.
:type value: bytes
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'value': {'required': True},
}
@@ -1836,22 +1892,24 @@ class KeySignParameters(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeySignParameters, self).__init__(**kwargs)
- self.algorithm = kwargs.get('algorithm', None)
- self.value = kwargs.get('value', None)
+ self.algorithm = kwargs['algorithm']
+ self.value = kwargs['value']
-class KeyUpdateParameters(Model):
+class KeyUpdateParameters(msrest.serialization.Model):
"""The key update parameters.
- :param key_ops: Json web key operations. For more information on possible
- key operations, see JsonWebKeyOperation.
- :type key_ops: list[str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
- :param key_attributes:
+ :param key_ops: Json web key operations. For more information on possible key operations, see
+ JsonWebKeyOperation.
+ :type key_ops: list[str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -1861,20 +1919,22 @@ class KeyUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyUpdateParameters, self).__init__(**kwargs)
self.key_ops = kwargs.get('key_ops', None)
self.key_attributes = kwargs.get('key_attributes', None)
self.tags = kwargs.get('tags', None)
-class KeyVaultError(Model):
+class KeyVaultError(msrest.serialization.Model):
"""The key vault error exception.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar error:
+ :ivar error: The key vault server error.
:vartype error: ~azure.keyvault.v2016_10_01.models.Error
"""
@@ -1886,38 +1946,23 @@ class KeyVaultError(Model):
'error': {'key': 'error', 'type': 'Error'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVaultError, self).__init__(**kwargs)
self.error = None
-class KeyVaultErrorException(HttpResponseError):
- """Server responsed with exception of type: 'KeyVaultError'.
-
- :param deserialize: A deserializer
- :param response: Server response to be deserialized.
- """
-
- def __init__(self, response, deserialize, *args):
-
- model_name = 'KeyVaultError'
- self.error = deserialize(model_name, response)
- if self.error is None:
- self.error = deserialize.dependencies[model_name]()
- super(KeyVaultErrorException, self).__init__(response=response)
-
-
-class KeyVerifyParameters(Model):
+class KeyVerifyParameters(msrest.serialization.Model):
"""The key verify parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. The signing/verification algorithm. For more
- information on possible algorithm types, see JsonWebKeySignatureAlgorithm.
- Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384',
- 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
+ :param algorithm: Required. The signing/verification algorithm. For more information on
+ possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: "PS256",
+ "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512", "ECDSA256".
+ :type algorithm: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
:param digest: Required. The digest used for signing.
:type digest: bytes
:param signature: Required. The signature to be verified.
@@ -1925,7 +1970,7 @@ class KeyVerifyParameters(Model):
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'digest': {'required': True},
'signature': {'required': True},
}
@@ -1936,18 +1981,20 @@ class KeyVerifyParameters(Model):
'signature': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVerifyParameters, self).__init__(**kwargs)
- self.algorithm = kwargs.get('algorithm', None)
- self.digest = kwargs.get('digest', None)
- self.signature = kwargs.get('signature', None)
+ self.algorithm = kwargs['algorithm']
+ self.digest = kwargs['digest']
+ self.signature = kwargs['signature']
-class KeyVerifyResult(Model):
+class KeyVerifyResult(msrest.serialization.Model):
"""The key verify result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: True if the signature is verified, otherwise false.
:vartype value: bool
@@ -1961,14 +2008,16 @@ class KeyVerifyResult(Model):
'value': {'key': 'value', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVerifyResult, self).__init__(**kwargs)
self.value = None
-class LifetimeAction(Model):
- """Action and its trigger that will be performed by Key Vault over the
- lifetime of a certificate.
+class LifetimeAction(msrest.serialization.Model):
+ """Action and its trigger that will be performed by Key Vault over the lifetime of a certificate.
:param trigger: The condition that will execute the action.
:type trigger: ~azure.keyvault.v2016_10_01.models.Trigger
@@ -1981,20 +2030,22 @@ class LifetimeAction(Model):
'action': {'key': 'action', 'type': 'Action'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(LifetimeAction, self).__init__(**kwargs)
self.trigger = kwargs.get('trigger', None)
self.action = kwargs.get('action', None)
-class OrganizationDetails(Model):
+class OrganizationDetails(msrest.serialization.Model):
"""Details of the organization of the certificate issuer.
:param id: Id of the organization.
:type id: str
:param admin_details: Details of the organization administrator.
- :type admin_details:
- list[~azure.keyvault.v2016_10_01.models.AdministratorDetails]
+ :type admin_details: list[~azure.keyvault.v2016_10_01.models.AdministratorDetails]
"""
_attribute_map = {
@@ -2002,20 +2053,21 @@ class OrganizationDetails(Model):
'admin_details': {'key': 'admin_details', 'type': '[AdministratorDetails]'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(OrganizationDetails, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.admin_details = kwargs.get('admin_details', None)
-class PendingCertificateSigningRequestResult(Model):
+class PendingCertificateSigningRequestResult(msrest.serialization.Model):
"""The pending certificate signing request result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: The pending certificate signing request as Base64 encoded
- string.
+ :ivar value: The pending certificate signing request as Base64 encoded string.
:vartype value: str
"""
@@ -2027,23 +2079,25 @@ class PendingCertificateSigningRequestResult(Model):
'value': {'key': 'value', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(PendingCertificateSigningRequestResult, self).__init__(**kwargs)
self.value = None
-class SasDefinitionAttributes(Model):
+class SasDefinitionAttributes(msrest.serialization.Model):
"""The SAS definition management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: the enabled state of the object.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -2057,31 +2111,30 @@ class SasDefinitionAttributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionAttributes, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.created = None
self.updated = None
-class SasDefinitionBundle(Model):
- """A SAS definition bundle consists of key vault SAS definition details plus
- its attributes.
+class SasDefinitionBundle(msrest.serialization.Model):
+ """A SAS definition bundle consists of key vault SAS definition details plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The SAS definition id.
:vartype id: str
:ivar secret_id: Storage account SAS definition secret id.
:vartype secret_id: str
- :ivar parameters: The SAS definition metadata in the form of key-value
- pairs.
+ :ivar parameters: The SAS definition metadata in the form of key-value pairs.
:vartype parameters: dict[str, str]
:ivar attributes: The SAS definition attributes.
- :vartype attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :vartype attributes: ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -2101,7 +2154,10 @@ class SasDefinitionBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionBundle, self).__init__(**kwargs)
self.id = None
self.secret_id = None
@@ -2110,18 +2166,16 @@ def __init__(self, **kwargs):
self.tags = None
-class SasDefinitionCreateParameters(Model):
+class SasDefinitionCreateParameters(msrest.serialization.Model):
"""The SAS definition create parameters.
All required parameters must be populated in order to send to Azure.
- :param parameters: Required. Sas definition creation metadata in the form
- of key-value pairs.
+ :param parameters: Required. Sas definition creation metadata in the form of key-value pairs.
:type parameters: dict[str, str]
:param sas_definition_attributes: The attributes of the SAS definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type sas_definition_attributes: ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2135,27 +2189,28 @@ class SasDefinitionCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionCreateParameters, self).__init__(**kwargs)
- self.parameters = kwargs.get('parameters', None)
+ self.parameters = kwargs['parameters']
self.sas_definition_attributes = kwargs.get('sas_definition_attributes', None)
self.tags = kwargs.get('tags', None)
-class SasDefinitionItem(Model):
+class SasDefinitionItem(msrest.serialization.Model):
"""The SAS definition item containing storage SAS definition metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage SAS identifier.
:vartype id: str
:ivar secret_id: The storage account SAS definition secret id.
:vartype secret_id: str
:ivar attributes: The SAS definition management attributes.
- :vartype attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :vartype attributes: ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -2173,7 +2228,10 @@ class SasDefinitionItem(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionItem, self).__init__(**kwargs)
self.id = None
self.secret_id = None
@@ -2181,14 +2239,13 @@ def __init__(self, **kwargs):
self.tags = None
-class SasDefinitionListResult(Model):
+class SasDefinitionListResult(msrest.serialization.Model):
"""The storage account SAS definition list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of SAS definitions along
- with a link to the next page of SAS definitions.
+ :ivar value: A response message containing a list of SAS definitions along with a link to the
+ next page of SAS definitions.
:vartype value: list[~azure.keyvault.v2016_10_01.models.SasDefinitionItem]
:ivar next_link: The URL to get the next set of SAS definitions.
:vartype next_link: str
@@ -2204,22 +2261,23 @@ class SasDefinitionListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SasDefinitionUpdateParameters(Model):
+class SasDefinitionUpdateParameters(msrest.serialization.Model):
"""The SAS definition update parameters.
- :param parameters: Sas definition update metadata in the form of key-value
- pairs.
+ :param parameters: Sas definition update metadata in the form of key-value pairs.
:type parameters: dict[str, str]
:param sas_definition_attributes: The attributes of the SAS definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type sas_definition_attributes: ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2229,7 +2287,10 @@ class SasDefinitionUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionUpdateParameters, self).__init__(**kwargs)
self.parameters = kwargs.get('parameters', None)
self.sas_definition_attributes = kwargs.get('sas_definition_attributes', None)
@@ -2239,27 +2300,24 @@ def __init__(self, **kwargs):
class SecretAttributes(Attributes):
"""The secret management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for secrets in the current vault. If it contains 'Purgeable', the
- secret can be permanently deleted by a privileged user; otherwise, only
- the system can purge the secret, at the end of the retention interval.
- Possible values include: 'Purgeable', 'Recoverable+Purgeable',
- 'Recoverable', 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for secrets in
+ the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a
+ privileged user; otherwise, only the system can purge the secret, at the end of the retention
+ interval. Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2277,19 +2335,21 @@ class SecretAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretAttributes, self).__init__(**kwargs)
self.recovery_level = None
-class SecretListResult(Model):
+class SecretListResult(msrest.serialization.Model):
"""The secret list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of secrets in the key
- vault along with a link to the next page of secrets.
+ :ivar value: A response message containing a list of secrets in the key vault along with a link
+ to the next page of secrets.
:vartype value: list[~azure.keyvault.v2016_10_01.models.SecretItem]
:ivar next_link: The URL to get the next set of secrets.
:vartype next_link: str
@@ -2305,13 +2365,16 @@ class SecretListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SecretProperties(Model):
+class SecretProperties(msrest.serialization.Model):
"""Properties of the key backing a certificate.
:param content_type: The media type (MIME type).
@@ -2322,18 +2385,20 @@ class SecretProperties(Model):
'content_type': {'key': 'contentType', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretProperties, self).__init__(**kwargs)
self.content_type = kwargs.get('content_type', None)
-class SecretRestoreParameters(Model):
+class SecretRestoreParameters(msrest.serialization.Model):
"""The secret restore parameters.
All required parameters must be populated in order to send to Azure.
- :param secret_bundle_backup: Required. The backup blob associated with a
- secret bundle.
+ :param secret_bundle_backup: Required. The backup blob associated with a secret bundle.
:type secret_bundle_backup: bytes
"""
@@ -2345,25 +2410,27 @@ class SecretRestoreParameters(Model):
'secret_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretRestoreParameters, self).__init__(**kwargs)
- self.secret_bundle_backup = kwargs.get('secret_bundle_backup', None)
+ self.secret_bundle_backup = kwargs['secret_bundle_backup']
-class SecretSetParameters(Model):
+class SecretSetParameters(msrest.serialization.Model):
"""The secret set parameters.
All required parameters must be populated in order to send to Azure.
:param value: Required. The value of the secret.
:type value: str
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
:param secret_attributes: The secret management attributes.
- :type secret_attributes:
- ~azure.keyvault.v2016_10_01.models.SecretAttributes
+ :type secret_attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
"""
_validation = {
@@ -2377,23 +2444,25 @@ class SecretSetParameters(Model):
'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretSetParameters, self).__init__(**kwargs)
- self.value = kwargs.get('value', None)
+ self.value = kwargs['value']
self.tags = kwargs.get('tags', None)
self.content_type = kwargs.get('content_type', None)
self.secret_attributes = kwargs.get('secret_attributes', None)
-class SecretUpdateParameters(Model):
+class SecretUpdateParameters(msrest.serialization.Model):
"""The secret update parameters.
:param content_type: Type of the secret value such as a password.
:type content_type: str
:param secret_attributes: The secret management attributes.
- :type secret_attributes:
- ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type secret_attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2403,25 +2472,27 @@ class SecretUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretUpdateParameters, self).__init__(**kwargs)
self.content_type = kwargs.get('content_type', None)
self.secret_attributes = kwargs.get('secret_attributes', None)
self.tags = kwargs.get('tags', None)
-class StorageAccountAttributes(Model):
+class StorageAccountAttributes(msrest.serialization.Model):
"""The storage account management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: the enabled state of the object.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -2435,14 +2506,17 @@ class StorageAccountAttributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountAttributes, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.created = None
self.updated = None
-class StorageAccountCreateParameters(Model):
+class StorageAccountCreateParameters(msrest.serialization.Model):
"""The storage account create parameters.
All required parameters must be populated in order to send to Azure.
@@ -2451,16 +2525,14 @@ class StorageAccountCreateParameters(Model):
:type resource_id: str
:param active_key_name: Required. Current active storage account key name.
:type active_key_name: str
- :param auto_regenerate_key: Required. whether keyvault should manage the
- storage account for the user.
+ :param auto_regenerate_key: Required. whether keyvault should manage the storage account for
+ the user.
:type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration specified
- in ISO-8601 format.
+ :param regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:type regeneration_period: str
:param storage_account_attributes: The attributes of the storage account.
- :type storage_account_attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type storage_account_attributes: ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2479,30 +2551,31 @@ class StorageAccountCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountCreateParameters, self).__init__(**kwargs)
- self.resource_id = kwargs.get('resource_id', None)
- self.active_key_name = kwargs.get('active_key_name', None)
- self.auto_regenerate_key = kwargs.get('auto_regenerate_key', None)
+ self.resource_id = kwargs['resource_id']
+ self.active_key_name = kwargs['active_key_name']
+ self.auto_regenerate_key = kwargs['auto_regenerate_key']
self.regeneration_period = kwargs.get('regeneration_period', None)
self.storage_account_attributes = kwargs.get('storage_account_attributes', None)
self.tags = kwargs.get('tags', None)
-class StorageAccountItem(Model):
+class StorageAccountItem(msrest.serialization.Model):
"""The storage account item containing storage account metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Storage identifier.
:vartype id: str
:ivar resource_id: Storage account resource Id.
:vartype resource_id: str
:ivar attributes: The storage account management attributes.
- :vartype attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :vartype attributes: ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -2520,7 +2593,10 @@ class StorageAccountItem(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountItem, self).__init__(**kwargs)
self.id = None
self.resource_id = None
@@ -2528,7 +2604,7 @@ def __init__(self, **kwargs):
self.tags = None
-class StorageAccountRegenerteKeyParameters(Model):
+class StorageAccountRegenerteKeyParameters(msrest.serialization.Model):
"""The storage account key regenerate parameters.
All required parameters must be populated in order to send to Azure.
@@ -2545,26 +2621,26 @@ class StorageAccountRegenerteKeyParameters(Model):
'key_name': {'key': 'keyName', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountRegenerteKeyParameters, self).__init__(**kwargs)
- self.key_name = kwargs.get('key_name', None)
+ self.key_name = kwargs['key_name']
-class StorageAccountUpdateParameters(Model):
+class StorageAccountUpdateParameters(msrest.serialization.Model):
"""The storage account update parameters.
:param active_key_name: The current active storage account key name.
:type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :param auto_regenerate_key: whether keyvault should manage the storage account for the user.
:type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration specified
- in ISO-8601 format.
+ :param regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:type regeneration_period: str
:param storage_account_attributes: The attributes of the storage account.
- :type storage_account_attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type storage_account_attributes: ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2576,7 +2652,10 @@ class StorageAccountUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountUpdateParameters, self).__init__(**kwargs)
self.active_key_name = kwargs.get('active_key_name', None)
self.auto_regenerate_key = kwargs.get('auto_regenerate_key', None)
@@ -2585,12 +2664,10 @@ def __init__(self, **kwargs):
self.tags = kwargs.get('tags', None)
-class StorageBundle(Model):
- """A Storage account bundle consists of key vault storage account details plus
- its attributes.
+class StorageBundle(msrest.serialization.Model):
+ """A Storage account bundle consists of key vault storage account details plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage account id.
:vartype id: str
@@ -2598,16 +2675,13 @@ class StorageBundle(Model):
:vartype resource_id: str
:ivar active_key_name: The current active storage account key name.
:vartype active_key_name: str
- :ivar auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :ivar auto_regenerate_key: whether keyvault should manage the storage account for the user.
:vartype auto_regenerate_key: bool
- :ivar regeneration_period: The key regeneration time duration specified in
- ISO-8601 format.
+ :ivar regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:vartype regeneration_period: str
:ivar attributes: The storage account attributes.
- :vartype attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :vartype attributes: ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -2631,7 +2705,10 @@ class StorageBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageBundle, self).__init__(**kwargs)
self.id = None
self.resource_id = None
@@ -2642,16 +2719,14 @@ def __init__(self, **kwargs):
self.tags = None
-class StorageListResult(Model):
+class StorageListResult(msrest.serialization.Model):
"""The storage accounts list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of storage accounts in
- the key vault along with a link to the next page of storage accounts.
- :vartype value:
- list[~azure.keyvault.v2016_10_01.models.StorageAccountItem]
+ :ivar value: A response message containing a list of storage accounts in the key vault along
+ with a link to the next page of storage accounts.
+ :vartype value: list[~azure.keyvault.v2016_10_01.models.StorageAccountItem]
:ivar next_link: The URL to get the next set of storage accounts.
:vartype next_link: str
"""
@@ -2666,13 +2741,16 @@ class StorageListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SubjectAlternativeNames(Model):
+class SubjectAlternativeNames(msrest.serialization.Model):
"""The subject alternate names of a X509 object.
:param emails: Email addresses.
@@ -2689,23 +2767,25 @@ class SubjectAlternativeNames(Model):
'upns': {'key': 'upns', 'type': '[str]'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SubjectAlternativeNames, self).__init__(**kwargs)
self.emails = kwargs.get('emails', None)
self.dns_names = kwargs.get('dns_names', None)
self.upns = kwargs.get('upns', None)
-class Trigger(Model):
+class Trigger(msrest.serialization.Model):
"""A condition to be satisfied for an action to be executed.
- :param lifetime_percentage: Percentage of lifetime at which to trigger.
- Value should be between 1 and 99.
+ :param lifetime_percentage: Percentage of lifetime at which to trigger. Value should be between
+ 1 and 99.
:type lifetime_percentage: int
- :param days_before_expiry: Days before expiry to attempt renewal. Value
- should be between 1 and validity_in_months multiplied by 27. If
- validity_in_months is 36, then value should be between 1 and 972 (36 *
- 27).
+ :param days_before_expiry: Days before expiry to attempt renewal. Value should be between 1 and
+ validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between
+ 1 and 972 (36 * 27).
:type days_before_expiry: int
"""
@@ -2718,28 +2798,27 @@ class Trigger(Model):
'days_before_expiry': {'key': 'days_before_expiry', 'type': 'int'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Trigger, self).__init__(**kwargs)
self.lifetime_percentage = kwargs.get('lifetime_percentage', None)
self.days_before_expiry = kwargs.get('days_before_expiry', None)
-class X509CertificateProperties(Model):
+class X509CertificateProperties(msrest.serialization.Model):
"""Properties of the X509 component of a certificate.
- :param subject: The subject name. Should be a valid X509 distinguished
- Name.
+ :param subject: The subject name. Should be a valid X509 distinguished Name.
:type subject: str
:param ekus: The enhanced key usage.
:type ekus: list[str]
:param subject_alternative_names: The subject alternative names.
- :type subject_alternative_names:
- ~azure.keyvault.v2016_10_01.models.SubjectAlternativeNames
+ :type subject_alternative_names: ~azure.keyvault.v2016_10_01.models.SubjectAlternativeNames
:param key_usage: List of key usages.
- :type key_usage: list[str or
- ~azure.keyvault.v2016_10_01.models.KeyUsageType]
- :param validity_in_months: The duration that the certificate is valid in
- months.
+ :type key_usage: list[str or ~azure.keyvault.v2016_10_01.models.KeyUsageType]
+ :param validity_in_months: The duration that the certificate is valid in months.
:type validity_in_months: int
"""
@@ -2755,7 +2834,10 @@ class X509CertificateProperties(Model):
'validity_in_months': {'key': 'validity_months', 'type': 'int'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(X509CertificateProperties, self).__init__(**kwargs)
self.subject = kwargs.get('subject', None)
self.ekus = kwargs.get('ekus', None)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_models_py3.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_models_py3.py
similarity index 68%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_models_py3.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_models_py3.py
index 397d2baa8b37..36e7f067c94b 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_models_py3.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/models/_models_py3.py
@@ -1,36 +1,43 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from msrest.serialization import Model
+import datetime
+from typing import Dict, List, Optional, Union
+
from azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+from ._key_vault_client_enums import *
-class Action(Model):
+class Action(msrest.serialization.Model):
"""The action that will be executed.
- :param action_type: The type of the action. Possible values include:
- 'EmailContacts', 'AutoRenew'
+ :param action_type: The type of the action. Possible values include: "EmailContacts",
+ "AutoRenew".
:type action_type: str or ~azure.keyvault.v2016_10_01.models.ActionType
"""
_attribute_map = {
- 'action_type': {'key': 'action_type', 'type': 'ActionType'},
+ 'action_type': {'key': 'action_type', 'type': 'str'},
}
- def __init__(self, *, action_type=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ action_type: Optional[Union[str, "ActionType"]] = None,
+ **kwargs
+ ):
super(Action, self).__init__(**kwargs)
self.action_type = action_type
-class AdministratorDetails(Model):
+class AdministratorDetails(msrest.serialization.Model):
"""Details of the organization administrator of the certificate issuer.
:param first_name: First name.
@@ -50,7 +57,15 @@ class AdministratorDetails(Model):
'phone': {'key': 'phone', 'type': 'str'},
}
- def __init__(self, *, first_name: str=None, last_name: str=None, email_address: str=None, phone: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ first_name: Optional[str] = None,
+ last_name: Optional[str] = None,
+ email_address: Optional[str] = None,
+ phone: Optional[str] = None,
+ **kwargs
+ ):
super(AdministratorDetails, self).__init__(**kwargs)
self.first_name = first_name
self.last_name = last_name
@@ -58,22 +73,21 @@ def __init__(self, *, first_name: str=None, last_name: str=None, email_address:
self.phone = phone
-class Attributes(Model):
+class Attributes(msrest.serialization.Model):
"""The object attributes managed by the KeyVault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -89,7 +103,14 @@ class Attributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
super(Attributes, self).__init__(**kwargs)
self.enabled = enabled
self.not_before = not_before
@@ -98,11 +119,10 @@ def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwarg
self.updated = None
-class BackupKeyResult(Model):
+class BackupKeyResult(msrest.serialization.Model):
"""The backup key result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up key.
:vartype value: bytes
@@ -116,16 +136,18 @@ class BackupKeyResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupKeyResult, self).__init__(**kwargs)
self.value = None
-class BackupSecretResult(Model):
+class BackupSecretResult(msrest.serialization.Model):
"""The backup secret result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up secret.
:vartype value: bytes
@@ -139,7 +161,10 @@ class BackupSecretResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupSecretResult, self).__init__(**kwargs)
self.value = None
@@ -147,28 +172,24 @@ def __init__(self, **kwargs) -> None:
class CertificateAttributes(Attributes):
"""The certificate management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for certificates in the current vault. If it contains 'Purgeable',
- the certificate can be permanently deleted by a privileged user;
- otherwise, only the system can purge the certificate, at the end of the
- retention interval. Possible values include: 'Purgeable',
- 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for certificates
+ in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by
+ a privileged user; otherwise, only the system can purge the certificate, at the end of the
+ retention interval. Possible values include: "Purgeable", "Recoverable+Purgeable",
+ "Recoverable", "Recoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
"""
_validation = {
@@ -186,16 +207,22 @@ class CertificateAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
super(CertificateAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs)
self.recovery_level = None
-class CertificateBundle(Model):
+class CertificateBundle(msrest.serialization.Model):
"""A certificate bundle consists of a certificate (X509) plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -213,7 +240,7 @@ class CertificateBundle(Model):
:type content_type: str
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -237,7 +264,15 @@ class CertificateBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ cer: Optional[bytearray] = None,
+ content_type: Optional[str] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateBundle, self).__init__(**kwargs)
self.id = None
self.kid = None
@@ -250,17 +285,14 @@ def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=No
self.tags = tags
-class CertificateCreateParameters(Model):
+class CertificateCreateParameters(msrest.serialization.Model):
"""The certificate create parameters.
:param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -270,33 +302,36 @@ class CertificateCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ certificate_policy: Optional["CertificatePolicy"] = None,
+ certificate_attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateCreateParameters, self).__init__(**kwargs)
self.certificate_policy = certificate_policy
self.certificate_attributes = certificate_attributes
self.tags = tags
-class CertificateImportParameters(Model):
+class CertificateImportParameters(msrest.serialization.Model):
"""The certificate import parameters.
All required parameters must be populated in order to send to Azure.
- :param base64_encoded_certificate: Required. Base64 encoded representation
- of the certificate object to import. This certificate needs to contain the
- private key.
+ :param base64_encoded_certificate: Required. Base64 encoded representation of the certificate
+ object to import. This certificate needs to contain the private key.
:type base64_encoded_certificate: str
- :param password: If the private key in base64EncodedCertificate is
- encrypted, the password used for encryption.
+ :param password: If the private key in base64EncodedCertificate is encrypted, the password used
+ for encryption.
:type password: str
:param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -312,7 +347,16 @@ class CertificateImportParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, base64_encoded_certificate: str, password: str=None, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ base64_encoded_certificate: str,
+ password: Optional[str] = None,
+ certificate_policy: Optional["CertificatePolicy"] = None,
+ certificate_attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateImportParameters, self).__init__(**kwargs)
self.base64_encoded_certificate = base64_encoded_certificate
self.password = password
@@ -321,7 +365,7 @@ def __init__(self, *, base64_encoded_certificate: str, password: str=None, certi
self.tags = tags
-class CertificateIssuerItem(Model):
+class CertificateIssuerItem(msrest.serialization.Model):
"""The certificate issuer item containing certificate issuer metadata.
:param id: Certificate Identifier.
@@ -335,23 +379,26 @@ class CertificateIssuerItem(Model):
'provider': {'key': 'provider', 'type': 'str'},
}
- def __init__(self, *, id: str=None, provider: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ provider: Optional[str] = None,
+ **kwargs
+ ):
super(CertificateIssuerItem, self).__init__(**kwargs)
self.id = id
self.provider = provider
-class CertificateIssuerListResult(Model):
+class CertificateIssuerListResult(msrest.serialization.Model):
"""The certificate issuer list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of certificate issuers
- in the key vault along with a link to the next page of certificate
- issuers.
- :vartype value:
- list[~azure.keyvault.v2016_10_01.models.CertificateIssuerItem]
+ :ivar value: A response message containing a list of certificate issuers in the key vault along
+ with a link to the next page of certificate issuers.
+ :vartype value: list[~azure.keyvault.v2016_10_01.models.CertificateIssuerItem]
:ivar next_link: The URL to get the next set of certificate issuers.
:vartype next_link: str
"""
@@ -366,13 +413,16 @@ class CertificateIssuerListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class CertificateIssuerSetParameters(Model):
+class CertificateIssuerSetParameters(msrest.serialization.Model):
"""The certificate issuer set parameters.
All required parameters must be populated in order to send to Azure.
@@ -381,10 +431,8 @@ class CertificateIssuerSetParameters(Model):
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v2016_10_01.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
"""
@@ -400,7 +448,15 @@ class CertificateIssuerSetParameters(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, *, provider: str, credentials=None, organization_details=None, attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ provider: str,
+ credentials: Optional["IssuerCredentials"] = None,
+ organization_details: Optional["OrganizationDetails"] = None,
+ attributes: Optional["IssuerAttributes"] = None,
+ **kwargs
+ ):
super(CertificateIssuerSetParameters, self).__init__(**kwargs)
self.provider = provider
self.credentials = credentials
@@ -408,17 +464,15 @@ def __init__(self, *, provider: str, credentials=None, organization_details=None
self.attributes = attributes
-class CertificateIssuerUpdateParameters(Model):
+class CertificateIssuerUpdateParameters(msrest.serialization.Model):
"""The certificate issuer update parameters.
:param provider: The issuer provider.
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v2016_10_01.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
"""
@@ -430,7 +484,15 @@ class CertificateIssuerUpdateParameters(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, *, provider: str=None, credentials=None, organization_details=None, attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ provider: Optional[str] = None,
+ credentials: Optional["IssuerCredentials"] = None,
+ organization_details: Optional["OrganizationDetails"] = None,
+ attributes: Optional["IssuerAttributes"] = None,
+ **kwargs
+ ):
super(CertificateIssuerUpdateParameters, self).__init__(**kwargs)
self.provider = provider
self.credentials = credentials
@@ -438,14 +500,14 @@ def __init__(self, *, provider: str=None, credentials=None, organization_details
self.attributes = attributes
-class CertificateItem(Model):
+class CertificateItem(msrest.serialization.Model):
"""The certificate item containing certificate metadata.
:param id: Certificate identifier.
:type id: str
:param attributes: The certificate management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param x509_thumbprint: Thumbprint of the certificate.
:type x509_thumbprint: bytes
@@ -458,7 +520,15 @@ class CertificateItem(Model):
'x509_thumbprint': {'key': 'x5t', 'type': 'base64'},
}
- def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint: bytes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ x509_thumbprint: Optional[bytes] = None,
+ **kwargs
+ ):
super(CertificateItem, self).__init__(**kwargs)
self.id = id
self.attributes = attributes
@@ -466,14 +536,13 @@ def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint:
self.x509_thumbprint = x509_thumbprint
-class CertificateListResult(Model):
+class CertificateListResult(msrest.serialization.Model):
"""The certificate list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of certificates in the
- key vault along with a link to the next page of certificates.
+ :ivar value: A response message containing a list of certificates in the key vault along with a
+ link to the next page of certificates.
:vartype value: list[~azure.keyvault.v2016_10_01.models.CertificateItem]
:ivar next_link: The URL to get the next set of certificates.
:vartype next_link: str
@@ -489,25 +558,25 @@ class CertificateListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class CertificateMergeParameters(Model):
+class CertificateMergeParameters(msrest.serialization.Model):
"""The certificate merge parameters.
All required parameters must be populated in order to send to Azure.
- :param x509_certificates: Required. The certificate or the certificate
- chain to merge.
+ :param x509_certificates: Required. The certificate or the certificate chain to merge.
:type x509_certificates: list[bytearray]
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -521,30 +590,34 @@ class CertificateMergeParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, x509_certificates, certificate_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ x509_certificates: List[bytearray],
+ certificate_attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateMergeParameters, self).__init__(**kwargs)
self.x509_certificates = x509_certificates
self.certificate_attributes = certificate_attributes
self.tags = tags
-class CertificateOperation(Model):
+class CertificateOperation(msrest.serialization.Model):
"""A certificate operation is returned in case of asynchronous requests.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
- :param issuer_parameters: Parameters for the issuer of the X509 component
- of a certificate.
- :type issuer_parameters:
- ~azure.keyvault.v2016_10_01.models.IssuerParameters
- :param csr: The certificate signing request (CSR) that is being used in
- the certificate operation.
+ :param issuer_parameters: Parameters for the issuer of the X509 component of a certificate.
+ :type issuer_parameters: ~azure.keyvault.v2016_10_01.models.IssuerParameters
+ :param csr: The certificate signing request (CSR) that is being used in the certificate
+ operation.
:type csr: bytearray
- :param cancellation_requested: Indicates if cancellation was requested on
- the certificate operation.
+ :param cancellation_requested: Indicates if cancellation was requested on the certificate
+ operation.
:type cancellation_requested: bool
:param status: Status of the certificate operation.
:type status: str
@@ -552,8 +625,7 @@ class CertificateOperation(Model):
:type status_details: str
:param error: Error encountered, if any, during the certificate operation.
:type error: ~azure.keyvault.v2016_10_01.models.Error
- :param target: Location which contains the result of the certificate
- operation.
+ :param target: Location which contains the result of the certificate operation.
:type target: str
:param request_id: Identifier for the certificate operation.
:type request_id: str
@@ -575,7 +647,19 @@ class CertificateOperation(Model):
'request_id': {'key': 'request_id', 'type': 'str'},
}
- def __init__(self, *, issuer_parameters=None, csr: bytearray=None, cancellation_requested: bool=None, status: str=None, status_details: str=None, error=None, target: str=None, request_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ issuer_parameters: Optional["IssuerParameters"] = None,
+ csr: Optional[bytearray] = None,
+ cancellation_requested: Optional[bool] = None,
+ status: Optional[str] = None,
+ status_details: Optional[str] = None,
+ error: Optional["Error"] = None,
+ target: Optional[str] = None,
+ request_id: Optional[str] = None,
+ **kwargs
+ ):
super(CertificateOperation, self).__init__(**kwargs)
self.id = None
self.issuer_parameters = issuer_parameters
@@ -588,13 +672,13 @@ def __init__(self, *, issuer_parameters=None, csr: bytearray=None, cancellation_
self.request_id = request_id
-class CertificateOperationUpdateParameter(Model):
+class CertificateOperationUpdateParameter(msrest.serialization.Model):
"""The certificate operation update parameters.
All required parameters must be populated in order to send to Azure.
- :param cancellation_requested: Required. Indicates if cancellation was
- requested on the certificate operation.
+ :param cancellation_requested: Required. Indicates if cancellation was requested on the
+ certificate operation.
:type cancellation_requested: bool
"""
@@ -606,36 +690,34 @@ class CertificateOperationUpdateParameter(Model):
'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'},
}
- def __init__(self, *, cancellation_requested: bool, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ cancellation_requested: bool,
+ **kwargs
+ ):
super(CertificateOperationUpdateParameter, self).__init__(**kwargs)
self.cancellation_requested = cancellation_requested
-class CertificatePolicy(Model):
+class CertificatePolicy(msrest.serialization.Model):
"""Management policy for a certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
:param key_properties: Properties of the key backing a certificate.
:type key_properties: ~azure.keyvault.v2016_10_01.models.KeyProperties
:param secret_properties: Properties of the secret backing a certificate.
- :type secret_properties:
- ~azure.keyvault.v2016_10_01.models.SecretProperties
- :param x509_certificate_properties: Properties of the X509 component of a
+ :type secret_properties: ~azure.keyvault.v2016_10_01.models.SecretProperties
+ :param x509_certificate_properties: Properties of the X509 component of a certificate.
+ :type x509_certificate_properties: ~azure.keyvault.v2016_10_01.models.X509CertificateProperties
+ :param lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a
certificate.
- :type x509_certificate_properties:
- ~azure.keyvault.v2016_10_01.models.X509CertificateProperties
- :param lifetime_actions: Actions that will be performed by Key Vault over
- the lifetime of a certificate.
- :type lifetime_actions:
- list[~azure.keyvault.v2016_10_01.models.LifetimeAction]
- :param issuer_parameters: Parameters for the issuer of the X509 component
- of a certificate.
- :type issuer_parameters:
- ~azure.keyvault.v2016_10_01.models.IssuerParameters
+ :type lifetime_actions: list[~azure.keyvault.v2016_10_01.models.LifetimeAction]
+ :param issuer_parameters: Parameters for the issuer of the X509 component of a certificate.
+ :type issuer_parameters: ~azure.keyvault.v2016_10_01.models.IssuerParameters
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
"""
@@ -654,7 +736,17 @@ class CertificatePolicy(Model):
'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'},
}
- def __init__(self, *, key_properties=None, secret_properties=None, x509_certificate_properties=None, lifetime_actions=None, issuer_parameters=None, attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key_properties: Optional["KeyProperties"] = None,
+ secret_properties: Optional["SecretProperties"] = None,
+ x509_certificate_properties: Optional["X509CertificateProperties"] = None,
+ lifetime_actions: Optional[List["LifetimeAction"]] = None,
+ issuer_parameters: Optional["IssuerParameters"] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ **kwargs
+ ):
super(CertificatePolicy, self).__init__(**kwargs)
self.id = None
self.key_properties = key_properties
@@ -665,17 +757,14 @@ def __init__(self, *, key_properties=None, secret_properties=None, x509_certific
self.attributes = attributes
-class CertificateUpdateParameters(Model):
+class CertificateUpdateParameters(msrest.serialization.Model):
"""The certificate update parameters.
:param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -685,14 +774,21 @@ class CertificateUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ certificate_policy: Optional["CertificatePolicy"] = None,
+ certificate_attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateUpdateParameters, self).__init__(**kwargs)
self.certificate_policy = certificate_policy
self.certificate_attributes = certificate_attributes
self.tags = tags
-class Contact(Model):
+class Contact(msrest.serialization.Model):
"""The contact information for the vault certificates.
:param email_address: Email address.
@@ -709,18 +805,24 @@ class Contact(Model):
'phone': {'key': 'phone', 'type': 'str'},
}
- def __init__(self, *, email_address: str=None, name: str=None, phone: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ email_address: Optional[str] = None,
+ name: Optional[str] = None,
+ phone: Optional[str] = None,
+ **kwargs
+ ):
super(Contact, self).__init__(**kwargs)
self.email_address = email_address
self.name = name
self.phone = phone
-class Contacts(Model):
+class Contacts(msrest.serialization.Model):
"""The contacts for the vault certificates.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Identifier for the contacts collection.
:vartype id: str
@@ -737,18 +839,21 @@ class Contacts(Model):
'contact_list': {'key': 'contacts', 'type': '[Contact]'},
}
- def __init__(self, *, contact_list=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ contact_list: Optional[List["Contact"]] = None,
+ **kwargs
+ ):
super(Contacts, self).__init__(**kwargs)
self.id = None
self.contact_list = contact_list
class DeletedCertificateBundle(CertificateBundle):
- """A Deleted Certificate consisting of its previous id, attributes and its
- tags, as well as information on when it will be purged.
+ """A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -766,16 +871,15 @@ class DeletedCertificateBundle(CertificateBundle):
:type content_type: str
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted certificate.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ certificate.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the certificate is scheduled to
- be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the certificate was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the certificate is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the certificate was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -803,7 +907,16 @@ class DeletedCertificateBundle(CertificateBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ cer: Optional[bytearray] = None,
+ content_type: Optional[str] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedCertificateBundle, self).__init__(cer=cer, content_type=content_type, attributes=attributes, tags=tags, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
@@ -811,28 +924,25 @@ def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=No
class DeletedCertificateItem(CertificateItem):
- """The deleted certificate item containing metadata about the deleted
- certificate.
+ """The deleted certificate item containing metadata about the deleted certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Certificate identifier.
:type id: str
:param attributes: The certificate management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param x509_thumbprint: Thumbprint of the certificate.
:type x509_thumbprint: bytes
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted certificate.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ certificate.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the certificate is scheduled to
- be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the certificate was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the certificate is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the certificate was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -850,23 +960,30 @@ class DeletedCertificateItem(CertificateItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint: bytes=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ x509_thumbprint: Optional[bytes] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedCertificateItem, self).__init__(id=id, attributes=attributes, tags=tags, x509_thumbprint=x509_thumbprint, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedCertificateListResult(Model):
+class DeletedCertificateListResult(msrest.serialization.Model):
"""A list of certificates that have been deleted in this vault.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of deleted certificates
- in the vault along with a link to the next page of deleted certificates
- :vartype value:
- list[~azure.keyvault.v2016_10_01.models.DeletedCertificateItem]
+ :ivar value: A response message containing a list of deleted certificates in the vault along
+ with a link to the next page of deleted certificates.
+ :vartype value: list[~azure.keyvault.v2016_10_01.models.DeletedCertificateItem]
:ivar next_link: The URL to get the next set of deleted certificates.
:vartype next_link: str
"""
@@ -881,26 +998,28 @@ class DeletedCertificateListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedCertificateListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class KeyBundle(Model):
+class KeyBundle(msrest.serialization.Model):
"""A KeyBundle consisting of a WebKey plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param key: The Json web key.
:type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
"""
@@ -915,7 +1034,14 @@ class KeyBundle(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, *, key=None, attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key: Optional["JsonWebKey"] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(KeyBundle, self).__init__(**kwargs)
self.key = key
self.attributes = attributes
@@ -924,29 +1050,26 @@ def __init__(self, *, key=None, attributes=None, tags=None, **kwargs) -> None:
class DeletedKeyBundle(KeyBundle):
- """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion
- info.
+ """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param key: The Json web key.
:type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted key.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the key is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the key was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -965,27 +1088,34 @@ class DeletedKeyBundle(KeyBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, key=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key: Optional["JsonWebKey"] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedKeyBundle, self).__init__(key=key, attributes=attributes, tags=tags, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class KeyItem(Model):
+class KeyItem(msrest.serialization.Model):
"""The key item containing key metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param kid: Key identifier.
:type kid: str
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1000,7 +1130,14 @@ class KeyItem(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, *, kid: str=None, attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(KeyItem, self).__init__(**kwargs)
self.kid = kid
self.attributes = attributes
@@ -1009,29 +1146,26 @@ def __init__(self, *, kid: str=None, attributes=None, tags=None, **kwargs) -> No
class DeletedKeyItem(KeyItem):
- """The deleted key item containing the deleted key metadata and information
- about deletion.
+ """The deleted key item containing the deleted key metadata and information about deletion.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param kid: Key identifier.
:type kid: str
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted key.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the key is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the key was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1050,21 +1184,28 @@ class DeletedKeyItem(KeyItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, kid: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedKeyItem, self).__init__(kid=kid, attributes=attributes, tags=tags, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedKeyListResult(Model):
+class DeletedKeyListResult(msrest.serialization.Model):
"""A list of keys that have been deleted in this vault.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of deleted keys in the
- vault along with a link to the next page of deleted keys
+ :ivar value: A response message containing a list of deleted keys in the vault along with a
+ link to the next page of deleted keys.
:vartype value: list[~azure.keyvault.v2016_10_01.models.DeletedKeyItem]
:ivar next_link: The URL to get the next set of deleted keys.
:vartype next_link: str
@@ -1080,17 +1221,19 @@ class DeletedKeyListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedKeyListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SecretBundle(Model):
+class SecretBundle(msrest.serialization.Model):
"""A secret consisting of a value, id and its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param value: The secret value.
:type value: str
@@ -1100,13 +1243,13 @@ class SecretBundle(Model):
:type content_type: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar kid: If this is a secret backing a KV certificate, then this field
- specifies the corresponding key backing the KV certificate.
+ :ivar kid: If this is a secret backing a KV certificate, then this field specifies the
+ corresponding key backing the KV certificate.
:vartype kid: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a secret backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a secret
+ backing a certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1125,7 +1268,16 @@ class SecretBundle(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, *, value: str=None, id: str=None, content_type: str=None, attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ value: Optional[str] = None,
+ id: Optional[str] = None,
+ content_type: Optional[str] = None,
+ attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(SecretBundle, self).__init__(**kwargs)
self.value = value
self.id = id
@@ -1137,11 +1289,9 @@ def __init__(self, *, value: str=None, id: str=None, content_type: str=None, att
class DeletedSecretBundle(SecretBundle):
- """A Deleted Secret consisting of its previous id, attributes and its tags, as
- well as information on when it will be purged.
+ """A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param value: The secret value.
:type value: str
@@ -1151,22 +1301,21 @@ class DeletedSecretBundle(SecretBundle):
:type content_type: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar kid: If this is a secret backing a KV certificate, then this field
- specifies the corresponding key backing the KV certificate.
+ :ivar kid: If this is a secret backing a KV certificate, then this field specifies the
+ corresponding key backing the KV certificate.
:vartype kid: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a secret backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a secret
+ backing a certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted secret.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ secret.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the secret is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the secret was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the secret is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the secret was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1189,29 +1338,38 @@ class DeletedSecretBundle(SecretBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, value: str=None, id: str=None, content_type: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ value: Optional[str] = None,
+ id: Optional[str] = None,
+ content_type: Optional[str] = None,
+ attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedSecretBundle, self).__init__(value=value, id=id, content_type=content_type, attributes=attributes, tags=tags, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class SecretItem(Model):
+class SecretItem(msrest.serialization.Model):
"""The secret item containing secret metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Secret identifier.
:type id: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a key backing
+ a certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1227,7 +1385,15 @@ class SecretItem(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ content_type: Optional[str] = None,
+ **kwargs
+ ):
super(SecretItem, self).__init__(**kwargs)
self.id = id
self.attributes = attributes
@@ -1239,28 +1405,26 @@ def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: st
class DeletedSecretItem(SecretItem):
"""The deleted secret item containing metadata about the deleted secret.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Secret identifier.
:type id: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a key backing
+ a certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted secret.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ secret.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the secret is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the secret was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the secret is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the secret was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1280,21 +1444,29 @@ class DeletedSecretItem(SecretItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: str=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ content_type: Optional[str] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedSecretItem, self).__init__(id=id, attributes=attributes, tags=tags, content_type=content_type, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedSecretListResult(Model):
+class DeletedSecretListResult(msrest.serialization.Model):
"""The deleted secret list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of the deleted secrets
- in the vault along with a link to the next page of deleted secrets
+ :ivar value: A response message containing a list of the deleted secrets in the vault along
+ with a link to the next page of deleted secrets.
:vartype value: list[~azure.keyvault.v2016_10_01.models.DeletedSecretItem]
:ivar next_link: The URL to get the next set of deleted secrets.
:vartype next_link: str
@@ -1310,23 +1482,25 @@ class DeletedSecretListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSecretListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class Error(Model):
+class Error(msrest.serialization.Model):
"""The key vault server error.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: The error code.
:vartype code: str
:ivar message: The error message.
:vartype message: str
- :ivar inner_error:
+ :ivar inner_error: The key vault server error.
:vartype inner_error: ~azure.keyvault.v2016_10_01.models.Error
"""
@@ -1342,25 +1516,27 @@ class Error(Model):
'inner_error': {'key': 'innererror', 'type': 'Error'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Error, self).__init__(**kwargs)
self.code = None
self.message = None
self.inner_error = None
-class IssuerAttributes(Model):
+class IssuerAttributes(msrest.serialization.Model):
"""The attributes of an issuer managed by the Key Vault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the issuer is enabled.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -1374,18 +1550,22 @@ class IssuerAttributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, *, enabled: bool=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ **kwargs
+ ):
super(IssuerAttributes, self).__init__(**kwargs)
self.enabled = enabled
self.created = None
self.updated = None
-class IssuerBundle(Model):
+class IssuerBundle(msrest.serialization.Model):
"""The issuer for Key Vault certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Identifier for the issuer object.
:vartype id: str
@@ -1393,10 +1573,8 @@ class IssuerBundle(Model):
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v2016_10_01.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
"""
@@ -1413,7 +1591,15 @@ class IssuerBundle(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, *, provider: str=None, credentials=None, organization_details=None, attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ provider: Optional[str] = None,
+ credentials: Optional["IssuerCredentials"] = None,
+ organization_details: Optional["OrganizationDetails"] = None,
+ attributes: Optional["IssuerAttributes"] = None,
+ **kwargs
+ ):
super(IssuerBundle, self).__init__(**kwargs)
self.id = None
self.provider = provider
@@ -1422,7 +1608,7 @@ def __init__(self, *, provider: str=None, credentials=None, organization_details
self.attributes = attributes
-class IssuerCredentials(Model):
+class IssuerCredentials(msrest.serialization.Model):
"""The credentials to be used for the certificate issuer.
:param account_id: The user name/account name/account id.
@@ -1436,20 +1622,25 @@ class IssuerCredentials(Model):
'password': {'key': 'pwd', 'type': 'str'},
}
- def __init__(self, *, account_id: str=None, password: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ account_id: Optional[str] = None,
+ password: Optional[str] = None,
+ **kwargs
+ ):
super(IssuerCredentials, self).__init__(**kwargs)
self.account_id = account_id
self.password = password
-class IssuerParameters(Model):
+class IssuerParameters(msrest.serialization.Model):
"""Parameters for the issuer of the X509 component of a certificate.
- :param name: Name of the referenced issuer object or reserved names; for
- example, 'Self' or 'Unknown'.
+ :param name: Name of the referenced issuer object or reserved names; for example, 'Self' or
+ 'Unknown'.
:type name: str
- :param certificate_type: Type of certificate to be requested from the
- issuer provider.
+ :param certificate_type: Type of certificate to be requested from the issuer provider.
:type certificate_type: str
"""
@@ -1458,19 +1649,25 @@ class IssuerParameters(Model):
'certificate_type': {'key': 'cty', 'type': 'str'},
}
- def __init__(self, *, name: str=None, certificate_type: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ certificate_type: Optional[str] = None,
+ **kwargs
+ ):
super(IssuerParameters, self).__init__(**kwargs)
self.name = name
self.certificate_type = certificate_type
-class JsonWebKey(Model):
+class JsonWebKey(msrest.serialization.Model):
"""As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18.
:param kid: Key identifier.
:type kid: str
- :param kty: JsonWebKey key type (kty). Possible values include: 'EC',
- 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'
+ :param kty: JsonWebKey key type (kty). Possible values include: "EC", "EC-HSM", "RSA", "RSA-
+ HSM", "oct".
:type kty: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyType
:param key_ops:
:type key_ops: list[str]
@@ -1494,9 +1691,8 @@ class JsonWebKey(Model):
:type k: bytes
:param t: HSM Token, used with 'Bring Your Own Key'.
:type t: bytes
- :param crv: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'SECP256K1'
+ :param crv: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "SECP256K1".
:type crv: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyCurveName
:param x: X component of an EC public key.
:type x: bytes
@@ -1523,7 +1719,27 @@ class JsonWebKey(Model):
'y': {'key': 'y', 'type': 'base64'},
}
- def __init__(self, *, kid: str=None, kty=None, key_ops=None, n: bytes=None, e: bytes=None, d: bytes=None, dp: bytes=None, dq: bytes=None, qi: bytes=None, p: bytes=None, q: bytes=None, k: bytes=None, t: bytes=None, crv=None, x: bytes=None, y: bytes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ kty: Optional[Union[str, "JsonWebKeyType"]] = None,
+ key_ops: Optional[List[str]] = None,
+ n: Optional[bytes] = None,
+ e: Optional[bytes] = None,
+ d: Optional[bytes] = None,
+ dp: Optional[bytes] = None,
+ dq: Optional[bytes] = None,
+ qi: Optional[bytes] = None,
+ p: Optional[bytes] = None,
+ q: Optional[bytes] = None,
+ k: Optional[bytes] = None,
+ t: Optional[bytes] = None,
+ crv: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
+ x: Optional[bytes] = None,
+ y: Optional[bytes] = None,
+ **kwargs
+ ):
super(JsonWebKey, self).__init__(**kwargs)
self.kid = kid
self.kty = kty
@@ -1546,27 +1762,24 @@ def __init__(self, *, kid: str=None, kty=None, key_ops=None, n: bytes=None, e: b
class KeyAttributes(Attributes):
"""The attributes of a key managed by the key vault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for keys in the current vault. If it contains 'Purgeable' the key
- can be permanently deleted by a privileged user; otherwise, only the
- system can purge the key, at the end of the retention interval. Possible
- values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for keys in the
+ current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged
+ user; otherwise, only the system can purge the key, at the end of the retention interval.
+ Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
"""
_validation = {
@@ -1584,38 +1797,41 @@ class KeyAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
super(KeyAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs)
self.recovery_level = None
-class KeyCreateParameters(Model):
+class KeyCreateParameters(msrest.serialization.Model):
"""The key create parameters.
All required parameters must be populated in order to send to Azure.
- :param kty: Required. The type of key to create. For valid values, see
- JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM',
- 'oct'
+ :param kty: Required. The type of key to create. For valid values, see JsonWebKeyType. Possible
+ values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
:type kty: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or 4096
- for RSA.
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
:type key_size: int
:param key_ops:
- :type key_ops: list[str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
- :param key_attributes:
+ :type key_ops: list[str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'SECP256K1'
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "SECP256K1".
:type curve: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyCurveName
"""
_validation = {
- 'kty': {'required': True, 'min_length': 1},
+ 'kty': {'required': True},
}
_attribute_map = {
@@ -1627,7 +1843,17 @@ class KeyCreateParameters(Model):
'curve': {'key': 'crv', 'type': 'str'},
}
- def __init__(self, *, kty, key_size: int=None, key_ops=None, key_attributes=None, tags=None, curve=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ kty: Union[str, "JsonWebKeyType"],
+ key_size: Optional[int] = None,
+ key_ops: Optional[List[Union[str, "JsonWebKeyOperation"]]] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ curve: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
+ **kwargs
+ ):
super(KeyCreateParameters, self).__init__(**kwargs)
self.kty = kty
self.key_size = key_size
@@ -1637,18 +1863,18 @@ def __init__(self, *, kty, key_size: int=None, key_ops=None, key_attributes=None
self.curve = curve
-class KeyImportParameters(Model):
+class KeyImportParameters(msrest.serialization.Model):
"""The key import parameters.
All required parameters must be populated in order to send to Azure.
:param hsm: Whether to import as a hardware key (HSM) or software key.
:type hsm: bool
- :param key: Required. The Json web key
+ :param key: Required. The Json web key.
:type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
:param key_attributes: The key management attributes.
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -1663,7 +1889,15 @@ class KeyImportParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, key, hsm: bool=None, key_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key: "JsonWebKey",
+ hsm: Optional[bool] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(KeyImportParameters, self).__init__(**kwargs)
self.hsm = hsm
self.key = key
@@ -1671,14 +1905,13 @@ def __init__(self, *, key, hsm: bool=None, key_attributes=None, tags=None, **kwa
self.tags = tags
-class KeyListResult(Model):
+class KeyListResult(msrest.serialization.Model):
"""The key list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of keys in the key vault
- along with a link to the next page of keys.
+ :ivar value: A response message containing a list of keys in the key vault along with a link to
+ the next page of keys.
:vartype value: list[~azure.keyvault.v2016_10_01.models.KeyItem]
:ivar next_link: The URL to get the next set of keys.
:vartype next_link: str
@@ -1694,19 +1927,21 @@ class KeyListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class KeyOperationResult(Model):
+class KeyOperationResult(msrest.serialization.Model):
"""The key operation result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar kid: Key identifier
+ :ivar kid: Key identifier.
:vartype kid: str
:ivar result:
:vartype result: bytes
@@ -1722,27 +1957,29 @@ class KeyOperationResult(Model):
'result': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyOperationResult, self).__init__(**kwargs)
self.kid = None
self.result = None
-class KeyOperationsParameters(Model):
+class KeyOperationsParameters(msrest.serialization.Model):
"""The key operations parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
+ :param algorithm: Required. algorithm identifier. Possible values include: "RSA-OAEP", "RSA-
+ OAEP-256", "RSA1_5".
+ :type algorithm: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
:param value: Required.
:type value: bytes
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'value': {'required': True},
}
@@ -1751,24 +1988,28 @@ class KeyOperationsParameters(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, algorithm, value: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeyEncryptionAlgorithm"],
+ value: bytes,
+ **kwargs
+ ):
super(KeyOperationsParameters, self).__init__(**kwargs)
self.algorithm = algorithm
self.value = value
-class KeyProperties(Model):
+class KeyProperties(msrest.serialization.Model):
"""Properties of the key pair backing a certificate.
:param exportable: Indicates if the private key can be exported.
:type exportable: bool
:param key_type: The key type.
:type key_type: str
- :param key_size: The key size in bits. For example: 2048, 3072, or 4096
- for RSA.
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
:type key_size: int
- :param reuse_key: Indicates if the same key pair will be used on
- certificate renewal.
+ :param reuse_key: Indicates if the same key pair will be used on certificate renewal.
:type reuse_key: bool
"""
@@ -1779,7 +2020,15 @@ class KeyProperties(Model):
'reuse_key': {'key': 'reuse_key', 'type': 'bool'},
}
- def __init__(self, *, exportable: bool=None, key_type: str=None, key_size: int=None, reuse_key: bool=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ exportable: Optional[bool] = None,
+ key_type: Optional[str] = None,
+ key_size: Optional[int] = None,
+ reuse_key: Optional[bool] = None,
+ **kwargs
+ ):
super(KeyProperties, self).__init__(**kwargs)
self.exportable = exportable
self.key_type = key_type
@@ -1787,13 +2036,12 @@ def __init__(self, *, exportable: bool=None, key_type: str=None, key_size: int=N
self.reuse_key = reuse_key
-class KeyRestoreParameters(Model):
+class KeyRestoreParameters(msrest.serialization.Model):
"""The key restore parameters.
All required parameters must be populated in order to send to Azure.
- :param key_bundle_backup: Required. The backup blob associated with a key
- bundle.
+ :param key_bundle_backup: Required. The backup blob associated with a key bundle.
:type key_bundle_backup: bytes
"""
@@ -1805,29 +2053,32 @@ class KeyRestoreParameters(Model):
'key_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, key_bundle_backup: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key_bundle_backup: bytes,
+ **kwargs
+ ):
super(KeyRestoreParameters, self).__init__(**kwargs)
self.key_bundle_backup = key_bundle_backup
-class KeySignParameters(Model):
+class KeySignParameters(msrest.serialization.Model):
"""The key operations parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. The signing/verification algorithm identifier.
- For more information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384',
- 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512',
- 'ECDSA256'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
+ :param algorithm: Required. The signing/verification algorithm identifier. For more information
+ on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include:
+ "PS256", "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512",
+ "ECDSA256".
+ :type algorithm: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
:param value: Required.
:type value: bytes
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'value': {'required': True},
}
@@ -1836,22 +2087,27 @@ class KeySignParameters(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, algorithm, value: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeySignatureAlgorithm"],
+ value: bytes,
+ **kwargs
+ ):
super(KeySignParameters, self).__init__(**kwargs)
self.algorithm = algorithm
self.value = value
-class KeyUpdateParameters(Model):
+class KeyUpdateParameters(msrest.serialization.Model):
"""The key update parameters.
- :param key_ops: Json web key operations. For more information on possible
- key operations, see JsonWebKeyOperation.
- :type key_ops: list[str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
- :param key_attributes:
+ :param key_ops: Json web key operations. For more information on possible key operations, see
+ JsonWebKeyOperation.
+ :type key_ops: list[str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -1861,20 +2117,26 @@ class KeyUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, key_ops=None, key_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key_ops: Optional[List[Union[str, "JsonWebKeyOperation"]]] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(KeyUpdateParameters, self).__init__(**kwargs)
self.key_ops = key_ops
self.key_attributes = key_attributes
self.tags = tags
-class KeyVaultError(Model):
+class KeyVaultError(msrest.serialization.Model):
"""The key vault error exception.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar error:
+ :ivar error: The key vault server error.
:vartype error: ~azure.keyvault.v2016_10_01.models.Error
"""
@@ -1886,38 +2148,23 @@ class KeyVaultError(Model):
'error': {'key': 'error', 'type': 'Error'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVaultError, self).__init__(**kwargs)
self.error = None
-class KeyVaultErrorException(HttpResponseError):
- """Server responsed with exception of type: 'KeyVaultError'.
-
- :param deserialize: A deserializer
- :param response: Server response to be deserialized.
- """
-
- def __init__(self, response, deserialize, *args):
-
- model_name = 'KeyVaultError'
- self.error = deserialize(model_name, response)
- if self.error is None:
- self.error = deserialize.dependencies[model_name]()
- super(KeyVaultErrorException, self).__init__(response=response)
-
-
-class KeyVerifyParameters(Model):
+class KeyVerifyParameters(msrest.serialization.Model):
"""The key verify parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. The signing/verification algorithm. For more
- information on possible algorithm types, see JsonWebKeySignatureAlgorithm.
- Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384',
- 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
+ :param algorithm: Required. The signing/verification algorithm. For more information on
+ possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: "PS256",
+ "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512", "ECDSA256".
+ :type algorithm: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
:param digest: Required. The digest used for signing.
:type digest: bytes
:param signature: Required. The signature to be verified.
@@ -1925,7 +2172,7 @@ class KeyVerifyParameters(Model):
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'digest': {'required': True},
'signature': {'required': True},
}
@@ -1936,18 +2183,24 @@ class KeyVerifyParameters(Model):
'signature': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, algorithm, digest: bytes, signature: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeySignatureAlgorithm"],
+ digest: bytes,
+ signature: bytes,
+ **kwargs
+ ):
super(KeyVerifyParameters, self).__init__(**kwargs)
self.algorithm = algorithm
self.digest = digest
self.signature = signature
-class KeyVerifyResult(Model):
+class KeyVerifyResult(msrest.serialization.Model):
"""The key verify result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: True if the signature is verified, otherwise false.
:vartype value: bool
@@ -1961,14 +2214,16 @@ class KeyVerifyResult(Model):
'value': {'key': 'value', 'type': 'bool'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVerifyResult, self).__init__(**kwargs)
self.value = None
-class LifetimeAction(Model):
- """Action and its trigger that will be performed by Key Vault over the
- lifetime of a certificate.
+class LifetimeAction(msrest.serialization.Model):
+ """Action and its trigger that will be performed by Key Vault over the lifetime of a certificate.
:param trigger: The condition that will execute the action.
:type trigger: ~azure.keyvault.v2016_10_01.models.Trigger
@@ -1981,20 +2236,25 @@ class LifetimeAction(Model):
'action': {'key': 'action', 'type': 'Action'},
}
- def __init__(self, *, trigger=None, action=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ trigger: Optional["Trigger"] = None,
+ action: Optional["Action"] = None,
+ **kwargs
+ ):
super(LifetimeAction, self).__init__(**kwargs)
self.trigger = trigger
self.action = action
-class OrganizationDetails(Model):
+class OrganizationDetails(msrest.serialization.Model):
"""Details of the organization of the certificate issuer.
:param id: Id of the organization.
:type id: str
:param admin_details: Details of the organization administrator.
- :type admin_details:
- list[~azure.keyvault.v2016_10_01.models.AdministratorDetails]
+ :type admin_details: list[~azure.keyvault.v2016_10_01.models.AdministratorDetails]
"""
_attribute_map = {
@@ -2002,20 +2262,24 @@ class OrganizationDetails(Model):
'admin_details': {'key': 'admin_details', 'type': '[AdministratorDetails]'},
}
- def __init__(self, *, id: str=None, admin_details=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ admin_details: Optional[List["AdministratorDetails"]] = None,
+ **kwargs
+ ):
super(OrganizationDetails, self).__init__(**kwargs)
self.id = id
self.admin_details = admin_details
-class PendingCertificateSigningRequestResult(Model):
+class PendingCertificateSigningRequestResult(msrest.serialization.Model):
"""The pending certificate signing request result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: The pending certificate signing request as Base64 encoded
- string.
+ :ivar value: The pending certificate signing request as Base64 encoded string.
:vartype value: str
"""
@@ -2027,23 +2291,25 @@ class PendingCertificateSigningRequestResult(Model):
'value': {'key': 'value', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(PendingCertificateSigningRequestResult, self).__init__(**kwargs)
self.value = None
-class SasDefinitionAttributes(Model):
+class SasDefinitionAttributes(msrest.serialization.Model):
"""The SAS definition management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: the enabled state of the object.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -2057,31 +2323,32 @@ class SasDefinitionAttributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, *, enabled: bool=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ **kwargs
+ ):
super(SasDefinitionAttributes, self).__init__(**kwargs)
self.enabled = enabled
self.created = None
self.updated = None
-class SasDefinitionBundle(Model):
- """A SAS definition bundle consists of key vault SAS definition details plus
- its attributes.
+class SasDefinitionBundle(msrest.serialization.Model):
+ """A SAS definition bundle consists of key vault SAS definition details plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The SAS definition id.
:vartype id: str
:ivar secret_id: Storage account SAS definition secret id.
:vartype secret_id: str
- :ivar parameters: The SAS definition metadata in the form of key-value
- pairs.
+ :ivar parameters: The SAS definition metadata in the form of key-value pairs.
:vartype parameters: dict[str, str]
:ivar attributes: The SAS definition attributes.
- :vartype attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :vartype attributes: ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -2101,7 +2368,10 @@ class SasDefinitionBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionBundle, self).__init__(**kwargs)
self.id = None
self.secret_id = None
@@ -2110,18 +2380,16 @@ def __init__(self, **kwargs) -> None:
self.tags = None
-class SasDefinitionCreateParameters(Model):
+class SasDefinitionCreateParameters(msrest.serialization.Model):
"""The SAS definition create parameters.
All required parameters must be populated in order to send to Azure.
- :param parameters: Required. Sas definition creation metadata in the form
- of key-value pairs.
+ :param parameters: Required. Sas definition creation metadata in the form of key-value pairs.
:type parameters: dict[str, str]
:param sas_definition_attributes: The attributes of the SAS definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type sas_definition_attributes: ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2135,27 +2403,32 @@ class SasDefinitionCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, parameters, sas_definition_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ parameters: Dict[str, str],
+ sas_definition_attributes: Optional["SasDefinitionAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(SasDefinitionCreateParameters, self).__init__(**kwargs)
self.parameters = parameters
self.sas_definition_attributes = sas_definition_attributes
self.tags = tags
-class SasDefinitionItem(Model):
+class SasDefinitionItem(msrest.serialization.Model):
"""The SAS definition item containing storage SAS definition metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage SAS identifier.
:vartype id: str
:ivar secret_id: The storage account SAS definition secret id.
:vartype secret_id: str
:ivar attributes: The SAS definition management attributes.
- :vartype attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :vartype attributes: ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -2173,7 +2446,10 @@ class SasDefinitionItem(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionItem, self).__init__(**kwargs)
self.id = None
self.secret_id = None
@@ -2181,14 +2457,13 @@ def __init__(self, **kwargs) -> None:
self.tags = None
-class SasDefinitionListResult(Model):
+class SasDefinitionListResult(msrest.serialization.Model):
"""The storage account SAS definition list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of SAS definitions along
- with a link to the next page of SAS definitions.
+ :ivar value: A response message containing a list of SAS definitions along with a link to the
+ next page of SAS definitions.
:vartype value: list[~azure.keyvault.v2016_10_01.models.SasDefinitionItem]
:ivar next_link: The URL to get the next set of SAS definitions.
:vartype next_link: str
@@ -2204,22 +2479,23 @@ class SasDefinitionListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SasDefinitionUpdateParameters(Model):
+class SasDefinitionUpdateParameters(msrest.serialization.Model):
"""The SAS definition update parameters.
- :param parameters: Sas definition update metadata in the form of key-value
- pairs.
+ :param parameters: Sas definition update metadata in the form of key-value pairs.
:type parameters: dict[str, str]
:param sas_definition_attributes: The attributes of the SAS definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type sas_definition_attributes: ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2229,7 +2505,14 @@ class SasDefinitionUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, parameters=None, sas_definition_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ parameters: Optional[Dict[str, str]] = None,
+ sas_definition_attributes: Optional["SasDefinitionAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(SasDefinitionUpdateParameters, self).__init__(**kwargs)
self.parameters = parameters
self.sas_definition_attributes = sas_definition_attributes
@@ -2239,27 +2522,24 @@ def __init__(self, *, parameters=None, sas_definition_attributes=None, tags=None
class SecretAttributes(Attributes):
"""The secret management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for secrets in the current vault. If it contains 'Purgeable', the
- secret can be permanently deleted by a privileged user; otherwise, only
- the system can purge the secret, at the end of the retention interval.
- Possible values include: 'Purgeable', 'Recoverable+Purgeable',
- 'Recoverable', 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for secrets in
+ the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a
+ privileged user; otherwise, only the system can purge the secret, at the end of the retention
+ interval. Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v2016_10_01.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2277,19 +2557,25 @@ class SecretAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
super(SecretAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs)
self.recovery_level = None
-class SecretListResult(Model):
+class SecretListResult(msrest.serialization.Model):
"""The secret list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of secrets in the key
- vault along with a link to the next page of secrets.
+ :ivar value: A response message containing a list of secrets in the key vault along with a link
+ to the next page of secrets.
:vartype value: list[~azure.keyvault.v2016_10_01.models.SecretItem]
:ivar next_link: The URL to get the next set of secrets.
:vartype next_link: str
@@ -2305,13 +2591,16 @@ class SecretListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SecretProperties(Model):
+class SecretProperties(msrest.serialization.Model):
"""Properties of the key backing a certificate.
:param content_type: The media type (MIME type).
@@ -2322,18 +2611,22 @@ class SecretProperties(Model):
'content_type': {'key': 'contentType', 'type': 'str'},
}
- def __init__(self, *, content_type: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ content_type: Optional[str] = None,
+ **kwargs
+ ):
super(SecretProperties, self).__init__(**kwargs)
self.content_type = content_type
-class SecretRestoreParameters(Model):
+class SecretRestoreParameters(msrest.serialization.Model):
"""The secret restore parameters.
All required parameters must be populated in order to send to Azure.
- :param secret_bundle_backup: Required. The backup blob associated with a
- secret bundle.
+ :param secret_bundle_backup: Required. The backup blob associated with a secret bundle.
:type secret_bundle_backup: bytes
"""
@@ -2345,25 +2638,29 @@ class SecretRestoreParameters(Model):
'secret_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, secret_bundle_backup: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ secret_bundle_backup: bytes,
+ **kwargs
+ ):
super(SecretRestoreParameters, self).__init__(**kwargs)
self.secret_bundle_backup = secret_bundle_backup
-class SecretSetParameters(Model):
+class SecretSetParameters(msrest.serialization.Model):
"""The secret set parameters.
All required parameters must be populated in order to send to Azure.
:param value: Required. The value of the secret.
:type value: str
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
:param secret_attributes: The secret management attributes.
- :type secret_attributes:
- ~azure.keyvault.v2016_10_01.models.SecretAttributes
+ :type secret_attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
"""
_validation = {
@@ -2377,7 +2674,15 @@ class SecretSetParameters(Model):
'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'},
}
- def __init__(self, *, value: str, tags=None, content_type: str=None, secret_attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ value: str,
+ tags: Optional[Dict[str, str]] = None,
+ content_type: Optional[str] = None,
+ secret_attributes: Optional["SecretAttributes"] = None,
+ **kwargs
+ ):
super(SecretSetParameters, self).__init__(**kwargs)
self.value = value
self.tags = tags
@@ -2385,15 +2690,14 @@ def __init__(self, *, value: str, tags=None, content_type: str=None, secret_attr
self.secret_attributes = secret_attributes
-class SecretUpdateParameters(Model):
+class SecretUpdateParameters(msrest.serialization.Model):
"""The secret update parameters.
:param content_type: Type of the secret value such as a password.
:type content_type: str
:param secret_attributes: The secret management attributes.
- :type secret_attributes:
- ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type secret_attributes: ~azure.keyvault.v2016_10_01.models.SecretAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2403,25 +2707,31 @@ class SecretUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, content_type: str=None, secret_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ content_type: Optional[str] = None,
+ secret_attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(SecretUpdateParameters, self).__init__(**kwargs)
self.content_type = content_type
self.secret_attributes = secret_attributes
self.tags = tags
-class StorageAccountAttributes(Model):
+class StorageAccountAttributes(msrest.serialization.Model):
"""The storage account management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: the enabled state of the object.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -2435,14 +2745,19 @@ class StorageAccountAttributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, *, enabled: bool=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ **kwargs
+ ):
super(StorageAccountAttributes, self).__init__(**kwargs)
self.enabled = enabled
self.created = None
self.updated = None
-class StorageAccountCreateParameters(Model):
+class StorageAccountCreateParameters(msrest.serialization.Model):
"""The storage account create parameters.
All required parameters must be populated in order to send to Azure.
@@ -2451,16 +2766,14 @@ class StorageAccountCreateParameters(Model):
:type resource_id: str
:param active_key_name: Required. Current active storage account key name.
:type active_key_name: str
- :param auto_regenerate_key: Required. whether keyvault should manage the
- storage account for the user.
+ :param auto_regenerate_key: Required. whether keyvault should manage the storage account for
+ the user.
:type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration specified
- in ISO-8601 format.
+ :param regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:type regeneration_period: str
:param storage_account_attributes: The attributes of the storage account.
- :type storage_account_attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type storage_account_attributes: ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2479,7 +2792,17 @@ class StorageAccountCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, resource_id: str, active_key_name: str, auto_regenerate_key: bool, regeneration_period: str=None, storage_account_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ resource_id: str,
+ active_key_name: str,
+ auto_regenerate_key: bool,
+ regeneration_period: Optional[str] = None,
+ storage_account_attributes: Optional["StorageAccountAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(StorageAccountCreateParameters, self).__init__(**kwargs)
self.resource_id = resource_id
self.active_key_name = active_key_name
@@ -2489,20 +2812,18 @@ def __init__(self, *, resource_id: str, active_key_name: str, auto_regenerate_ke
self.tags = tags
-class StorageAccountItem(Model):
+class StorageAccountItem(msrest.serialization.Model):
"""The storage account item containing storage account metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Storage identifier.
:vartype id: str
:ivar resource_id: Storage account resource Id.
:vartype resource_id: str
:ivar attributes: The storage account management attributes.
- :vartype attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :vartype attributes: ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -2520,7 +2841,10 @@ class StorageAccountItem(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountItem, self).__init__(**kwargs)
self.id = None
self.resource_id = None
@@ -2528,7 +2852,7 @@ def __init__(self, **kwargs) -> None:
self.tags = None
-class StorageAccountRegenerteKeyParameters(Model):
+class StorageAccountRegenerteKeyParameters(msrest.serialization.Model):
"""The storage account key regenerate parameters.
All required parameters must be populated in order to send to Azure.
@@ -2545,26 +2869,28 @@ class StorageAccountRegenerteKeyParameters(Model):
'key_name': {'key': 'keyName', 'type': 'str'},
}
- def __init__(self, *, key_name: str, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key_name: str,
+ **kwargs
+ ):
super(StorageAccountRegenerteKeyParameters, self).__init__(**kwargs)
self.key_name = key_name
-class StorageAccountUpdateParameters(Model):
+class StorageAccountUpdateParameters(msrest.serialization.Model):
"""The storage account update parameters.
:param active_key_name: The current active storage account key name.
:type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :param auto_regenerate_key: whether keyvault should manage the storage account for the user.
:type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration specified
- in ISO-8601 format.
+ :param regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:type regeneration_period: str
:param storage_account_attributes: The attributes of the storage account.
- :type storage_account_attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type storage_account_attributes: ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2576,7 +2902,16 @@ class StorageAccountUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, active_key_name: str=None, auto_regenerate_key: bool=None, regeneration_period: str=None, storage_account_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ active_key_name: Optional[str] = None,
+ auto_regenerate_key: Optional[bool] = None,
+ regeneration_period: Optional[str] = None,
+ storage_account_attributes: Optional["StorageAccountAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(StorageAccountUpdateParameters, self).__init__(**kwargs)
self.active_key_name = active_key_name
self.auto_regenerate_key = auto_regenerate_key
@@ -2585,12 +2920,10 @@ def __init__(self, *, active_key_name: str=None, auto_regenerate_key: bool=None,
self.tags = tags
-class StorageBundle(Model):
- """A Storage account bundle consists of key vault storage account details plus
- its attributes.
+class StorageBundle(msrest.serialization.Model):
+ """A Storage account bundle consists of key vault storage account details plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage account id.
:vartype id: str
@@ -2598,16 +2931,13 @@ class StorageBundle(Model):
:vartype resource_id: str
:ivar active_key_name: The current active storage account key name.
:vartype active_key_name: str
- :ivar auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :ivar auto_regenerate_key: whether keyvault should manage the storage account for the user.
:vartype auto_regenerate_key: bool
- :ivar regeneration_period: The key regeneration time duration specified in
- ISO-8601 format.
+ :ivar regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:vartype regeneration_period: str
:ivar attributes: The storage account attributes.
- :vartype attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :vartype attributes: ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -2631,7 +2961,10 @@ class StorageBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageBundle, self).__init__(**kwargs)
self.id = None
self.resource_id = None
@@ -2642,16 +2975,14 @@ def __init__(self, **kwargs) -> None:
self.tags = None
-class StorageListResult(Model):
+class StorageListResult(msrest.serialization.Model):
"""The storage accounts list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of storage accounts in
- the key vault along with a link to the next page of storage accounts.
- :vartype value:
- list[~azure.keyvault.v2016_10_01.models.StorageAccountItem]
+ :ivar value: A response message containing a list of storage accounts in the key vault along
+ with a link to the next page of storage accounts.
+ :vartype value: list[~azure.keyvault.v2016_10_01.models.StorageAccountItem]
:ivar next_link: The URL to get the next set of storage accounts.
:vartype next_link: str
"""
@@ -2666,13 +2997,16 @@ class StorageListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SubjectAlternativeNames(Model):
+class SubjectAlternativeNames(msrest.serialization.Model):
"""The subject alternate names of a X509 object.
:param emails: Email addresses.
@@ -2689,23 +3023,29 @@ class SubjectAlternativeNames(Model):
'upns': {'key': 'upns', 'type': '[str]'},
}
- def __init__(self, *, emails=None, dns_names=None, upns=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ emails: Optional[List[str]] = None,
+ dns_names: Optional[List[str]] = None,
+ upns: Optional[List[str]] = None,
+ **kwargs
+ ):
super(SubjectAlternativeNames, self).__init__(**kwargs)
self.emails = emails
self.dns_names = dns_names
self.upns = upns
-class Trigger(Model):
+class Trigger(msrest.serialization.Model):
"""A condition to be satisfied for an action to be executed.
- :param lifetime_percentage: Percentage of lifetime at which to trigger.
- Value should be between 1 and 99.
+ :param lifetime_percentage: Percentage of lifetime at which to trigger. Value should be between
+ 1 and 99.
:type lifetime_percentage: int
- :param days_before_expiry: Days before expiry to attempt renewal. Value
- should be between 1 and validity_in_months multiplied by 27. If
- validity_in_months is 36, then value should be between 1 and 972 (36 *
- 27).
+ :param days_before_expiry: Days before expiry to attempt renewal. Value should be between 1 and
+ validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between
+ 1 and 972 (36 * 27).
:type days_before_expiry: int
"""
@@ -2718,28 +3058,30 @@ class Trigger(Model):
'days_before_expiry': {'key': 'days_before_expiry', 'type': 'int'},
}
- def __init__(self, *, lifetime_percentage: int=None, days_before_expiry: int=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ lifetime_percentage: Optional[int] = None,
+ days_before_expiry: Optional[int] = None,
+ **kwargs
+ ):
super(Trigger, self).__init__(**kwargs)
self.lifetime_percentage = lifetime_percentage
self.days_before_expiry = days_before_expiry
-class X509CertificateProperties(Model):
+class X509CertificateProperties(msrest.serialization.Model):
"""Properties of the X509 component of a certificate.
- :param subject: The subject name. Should be a valid X509 distinguished
- Name.
+ :param subject: The subject name. Should be a valid X509 distinguished Name.
:type subject: str
:param ekus: The enhanced key usage.
:type ekus: list[str]
:param subject_alternative_names: The subject alternative names.
- :type subject_alternative_names:
- ~azure.keyvault.v2016_10_01.models.SubjectAlternativeNames
+ :type subject_alternative_names: ~azure.keyvault.v2016_10_01.models.SubjectAlternativeNames
:param key_usage: List of key usages.
- :type key_usage: list[str or
- ~azure.keyvault.v2016_10_01.models.KeyUsageType]
- :param validity_in_months: The duration that the certificate is valid in
- months.
+ :type key_usage: list[str or ~azure.keyvault.v2016_10_01.models.KeyUsageType]
+ :param validity_in_months: The duration that the certificate is valid in months.
:type validity_in_months: int
"""
@@ -2755,7 +3097,16 @@ class X509CertificateProperties(Model):
'validity_in_months': {'key': 'validity_months', 'type': 'int'},
}
- def __init__(self, *, subject: str=None, ekus=None, subject_alternative_names=None, key_usage=None, validity_in_months: int=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ subject: Optional[str] = None,
+ ekus: Optional[List[str]] = None,
+ subject_alternative_names: Optional["SubjectAlternativeNames"] = None,
+ key_usage: Optional[List[Union[str, "KeyUsageType"]]] = None,
+ validity_in_months: Optional[int] = None,
+ **kwargs
+ ):
super(X509CertificateProperties, self).__init__(**kwargs)
self.subject = subject
self.ekus = ekus
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/operations/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/operations/__init__.py
similarity index 90%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/operations/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/operations/__init__.py
index 603e37d3ee07..44bfc9d07bb1 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/operations/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/operations/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_operations import KeyVaultClientOperationsMixin
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/operations/_key_vault_client_operations.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/operations/_key_vault_client_operations.py
new file mode 100644
index 000000000000..3ea87e0dccb8
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/operations/_key_vault_client_operations.py
@@ -0,0 +1,4583 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class KeyVaultClientOperationsMixin(object):
+
+ def create_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ parameters, # type: "models.KeyCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Creates a new key, stores it, then returns key parameters and attributes to the client.
+
+ The create key operation can be used to create any key type in Azure Key Vault. If the named
+ key already exists, Azure Key Vault creates a new version of the key. It requires the
+ keys/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name for the new key. The system will generate the version name for the
+ new key.
+ :type key_name: str
+ :param parameters: The parameters to create a key.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_key.metadata = {'url': '/keys/{key-name}/create'} # type: ignore
+
+ def import_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ parameters, # type: "models.KeyImportParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Imports an externally created key, stores it, and returns key parameters and attributes to the client.
+
+ The import key operation may be used to import any key type into an Azure Key Vault. If the
+ named key already exists, Azure Key Vault creates a new version of the key. This operation
+ requires the keys/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: Name for the imported key.
+ :type key_name: str
+ :param parameters: The parameters to import a key.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ def delete_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedKeyBundle"
+ """Deletes a key of any type from storage in Azure Key Vault.
+
+ The delete key operation cannot be used to remove individual versions of a key. This operation
+ removes the cryptographic material associated with the key, which means the key is not usable
+ for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
+ keys/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to delete.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ def update_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
+
+ In order to perform this operation, the key must already exist in the Key Vault. Note: The
+ cryptographic material of a key itself cannot be changed. This operation requires the
+ keys/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of key to update.
+ :type key_name: str
+ :param key_version: The version of the key to update.
+ :type key_version: str
+ :param parameters: The parameters of the key to update.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Gets the public part of a stored key.
+
+ The get key operation is applicable to all key types. If the requested key is symmetric, then
+ no key material is released in the response. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to get.
+ :type key_name: str
+ :param key_version: Adding the version parameter retrieves a specific version of a key.
+ :type key_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key_versions(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.KeyListResult"]
+ """Retrieves a list of individual key versions with the same key name.
+
+ The full key identifier, attributes, and tags are provided in the response. This operation
+ requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_key_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_key_versions.metadata = {'url': '/keys/{key-name}/versions'} # type: ignore
+
+ def get_keys(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.KeyListResult"]
+ """List keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a stored key. The LIST operation is applicable to all key types, however only
+ the base key identifier, attributes, and tags are provided in the response. Individual versions
+ of a key are not listed in the response. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_keys.metadata = {'url': '/keys'} # type: ignore
+
+ def backup_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.BackupKeyResult"
+ """Requests that a backup of the specified key be downloaded to the client.
+
+ The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this
+ operation does NOT return key material in a form that can be used outside the Azure Key Vault
+ system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key
+ Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
+ Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.
+ The BACKUP operation may be used to export, in protected form, any key type from Azure Key
+ Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed
+ within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be
+ restored to another geographical area. For example, a backup from the US geographical area
+ cannot be restored in an EU geographical area. This operation requires the key/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupKeyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.BackupKeyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupKeyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.backup_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupKeyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_key.metadata = {'url': '/keys/{key-name}/backup'} # type: ignore
+
+ def restore_key(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.KeyRestoreParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Restores a backed up key to a vault.
+
+ Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
+ attributes and access control policies. The RESTORE operation may be used to import a
+ previously backed up key. Individual versions of a key cannot be restored. The key is restored
+ in its entirety with the same key name as it had when it was backed up. If the key name is not
+ available in the target Key Vault, the RESTORE operation will be rejected. While the key name
+ is retained during restore, the final key identifier will change if the key is restored to a
+ different vault. Restore will restore all versions and preserve version identifiers. The
+ RESTORE operation is subject to security constraints: The target Key Vault must be owned by the
+ same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission
+ in the target Key Vault. This operation requires the keys/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the key.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_key.metadata = {'url': '/keys/restore'} # type: ignore
+
+ def encrypt(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
+
+ The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
+ stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of
+ data, the size of which is dependent on the target key and the encryption algorithm to be used.
+ The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
+ since protection with an asymmetric key can be performed using public portion of the key. This
+ operation is supported for asymmetric keys as a convenience for callers that have a key-
+ reference but do not have access to the public key material. This operation requires the
+ keys/encrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the encryption operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.encrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'} # type: ignore
+
+ def decrypt(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Decrypts a single block of encrypted data.
+
+ The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption
+ key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a
+ single block of data may be decrypted, the size of this block is dependent on the target key
+ and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys
+ stored in Azure Key Vault since it uses the private portion of the key. This operation requires
+ the keys/decrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the decryption operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.decrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'} # type: ignore
+
+ def sign(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeySignParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Creates a signature from a digest using the specified key.
+
+ The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault
+ since this operation uses the private portion of the key. This operation requires the keys/sign
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the signing operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeySignParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.sign.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeySignParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'} # type: ignore
+
+ def verify(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyVerifyParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyVerifyResult"
+ """Verifies a signature using a specified key.
+
+ The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not
+ strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification
+ can be performed using the public portion of the key but this operation is supported as a
+ convenience for callers that only have a key-reference and not the public portion of the key.
+ This operation requires the keys/verify permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for verify operations.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyVerifyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyVerifyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyVerifyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyVerifyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.verify.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyVerifyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'} # type: ignore
+
+ def wrap_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Wraps a symmetric key using a specified key.
+
+ The WRAP operation supports encryption of a symmetric key using a key encryption key that has
+ previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for
+ symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be
+ performed using the public portion of the key. This operation is supported for asymmetric keys
+ as a convenience for callers that have a key-reference but do not have access to the public key
+ material. This operation requires the keys/wrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for wrap operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.wrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'} # type: ignore
+
+ def unwrap_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
+
+ The UNWRAP operation supports decryption of a symmetric key using the target key encryption
+ key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to
+ asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of
+ the key. This operation requires the keys/unwrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the key operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.unwrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'} # type: ignore
+
+ def get_deleted_keys(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedKeyListResult"]
+ """Lists the deleted keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a deleted key. This operation includes deletion-specific information. The Get
+ Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedKeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedKeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_keys.metadata = {'url': '/deletedkeys'} # type: ignore
+
+ def get_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedKeyBundle"
+ """Gets the public part of a deleted key.
+
+ The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ def purge_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Permanently deletes the specified key.
+
+ The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the
+ operation can be invoked on any vault, it will return an error if invoked on a non soft-delete
+ enabled vault. This operation requires the keys/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.purge_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ def recover_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Recovers the deleted key to its latest version.
+
+ The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.
+ It recovers the deleted key back to its latest version under /keys. An attempt to recover an
+ non-deleted key will return an error. Consider this the inverse of the delete operation on
+ soft-delete enabled vaults. This operation requires the keys/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the deleted key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.recover_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'} # type: ignore
+
+ def set_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ parameters, # type: "models.SecretSetParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Sets a secret in a specified key vault.
+
+ The SET operation adds a secret to the Azure Key Vault. If the named secret already exists,
+ Azure Key Vault creates a new version of that secret. This operation requires the secrets/set
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param parameters: The parameters for setting the secret.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SecretSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretSetParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_secret.metadata = {'url': '/secrets/{secret-name}'} # type: ignore
+
+ def delete_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedSecretBundle"
+ """Deletes a secret from a specified key vault.
+
+ The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied
+ to an individual version of a secret. This operation requires the secrets/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_secret.metadata = {'url': '/secrets/{secret-name}'} # type: ignore
+
+ def update_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ secret_version, # type: str
+ parameters, # type: "models.SecretUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Updates the attributes associated with a specified secret in a given key vault.
+
+ The UPDATE operation changes specified attributes of an existing stored secret. Attributes that
+ are not specified in the request are left unchanged. The value of a secret itself cannot be
+ changed. This operation requires the secrets/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret.
+ :type secret_version: str
+ :param parameters: The parameters for update secret operation.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SecretUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ 'secret-version': self._serialize.url("secret_version", secret_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} # type: ignore
+
+ def get_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ secret_version, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Get a specified secret from a given key vault.
+
+ The GET operation is applicable to any secret stored in Azure Key Vault. This operation
+ requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret.
+ :type secret_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ 'secret-version': self._serialize.url("secret_version", secret_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} # type: ignore
+
+ def get_secrets(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.SecretListResult"]
+ """List secrets in a specified key vault.
+
+ The Get Secrets operation is applicable to the entire vault. However, only the base secret
+ identifier and its attributes are provided in the response. Individual secret versions are not
+ listed in the response. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_secrets.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('SecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_secrets.metadata = {'url': '/secrets'} # type: ignore
+
+ def get_secret_versions(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.SecretListResult"]
+ """List all versions of the specified secret.
+
+ The full secret identifier and attributes are provided in the response. No values are returned
+ for the secrets. This operations requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_secret_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('SecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_secret_versions.metadata = {'url': '/secrets/{secret-name}/versions'} # type: ignore
+
+ def get_deleted_secrets(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedSecretListResult"]
+ """Lists deleted secrets for the specified vault.
+
+ The Get Deleted Secrets operation returns the secrets that have been deleted for a vault
+ enabled for soft-delete. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedSecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_secrets.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedSecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_secrets.metadata = {'url': '/deletedsecrets'} # type: ignore
+
+ def get_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedSecretBundle"
+ """Gets the specified deleted secret.
+
+ The Get Deleted Secret operation returns the specified deleted secret along with its
+ attributes. This operation requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} # type: ignore
+
+ def purge_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Permanently deletes the specified secret.
+
+ The purge deleted secret operation removes the secret permanently, without the possibility of
+ recovery. This operation can only be enabled on a soft-delete enabled vault. This operation
+ requires the secrets/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.purge_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} # type: ignore
+
+ def recover_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Recovers the deleted secret to the latest version.
+
+ Recovers the deleted secret in the specified vault. This operation can only be performed on a
+ soft-delete enabled vault. This operation requires the secrets/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the deleted secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.recover_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}/recover'} # type: ignore
+
+ def backup_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.BackupSecretResult"
+ """Backs up the specified secret.
+
+ Requests that a backup of the specified secret be downloaded to the client. All versions of the
+ secret will be downloaded. This operation requires the secrets/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupSecretResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.BackupSecretResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupSecretResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.backup_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupSecretResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_secret.metadata = {'url': '/secrets/{secret-name}/backup'} # type: ignore
+
+ def restore_secret(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.SecretRestoreParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Restores a backed up secret to a vault.
+
+ Restores a backed up secret, and all its versions, to a vault. This operation requires the
+ secrets/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the secret.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SecretRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_secret.metadata = {'url': '/secrets/restore'} # type: ignore
+
+ def get_certificates(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.CertificateListResult"]
+ """List certificates in a specified key vault.
+
+ The GetCertificates operation returns the set of certificates resources in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificates.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_certificates.metadata = {'url': '/certificates'} # type: ignore
+
+ def delete_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedCertificateBundle"
+ """Deletes a certificate from a specified key vault.
+
+ Deletes all versions of a certificate object along with its associated policy. Delete
+ certificate cannot be used to remove individual versions of a certificate object. This
+ operation requires the certificates/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedCertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate.metadata = {'url': '/certificates/{certificate-name}'} # type: ignore
+
+ def set_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ contacts, # type: "models.Contacts"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.Contacts"
+ """Sets the certificate contacts for the specified key vault.
+
+ Sets the certificate contacts for the specified key vault. This operation requires the
+ certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param contacts: The contacts for the key vault certificate.
+ :type contacts: ~azure.keyvault.v2016_10_01.models.Contacts
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(contacts, 'Contacts')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ def get_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.Contacts"
+ """Lists the certificate contacts for a specified key vault.
+
+ The GetCertificateContacts operation returns the set of certificate contact resources in the
+ specified key vault. This operation requires the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ def delete_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.Contacts"
+ """Deletes the certificate contacts for a specified key vault.
+
+ Deletes the certificate contacts for a specified key vault certificate. This operation requires
+ the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ def get_certificate_issuers(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.CertificateIssuerListResult"]
+ """List certificate issuers for a specified key vault.
+
+ The GetCertificateIssuers operation returns the set of certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateIssuerListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateIssuerListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificate_issuers.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateIssuerListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_certificate_issuers.metadata = {'url': '/certificates/issuers'} # type: ignore
+
+ def set_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ parameter, # type: "models.CertificateIssuerSetParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.IssuerBundle"
+ """Sets the specified certificate issuer.
+
+ The SetCertificateIssuer operation adds or updates the specified certificate issuer. This
+ operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer set parameter.
+ :type parameter: ~azure.keyvault.v2016_10_01.models.CertificateIssuerSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameter, 'CertificateIssuerSetParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ def update_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ parameter, # type: "models.CertificateIssuerUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.IssuerBundle"
+ """Updates the specified certificate issuer.
+
+ The UpdateCertificateIssuer operation performs an update on the specified certificate issuer
+ entity. This operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer update parameter.
+ :type parameter: ~azure.keyvault.v2016_10_01.models.CertificateIssuerUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameter, 'CertificateIssuerUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ def get_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.IssuerBundle"
+ """Lists the specified certificate issuer.
+
+ The GetCertificateIssuer operation returns the specified certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ def delete_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.IssuerBundle"
+ """Deletes the specified certificate issuer.
+
+ The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from
+ the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ def create_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateOperation"
+ """Creates a new certificate.
+
+ If this is the first version, the certificate resource is created. This operation requires the
+ certificates/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to create a certificate.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.CertificateCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_certificate.metadata = {'url': '/certificates/{certificate-name}/create'} # type: ignore
+
+ def import_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateImportParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Imports a certificate into a specified key vault.
+
+ Imports an existing valid certificate, containing a private key, into Azure Key Vault. The
+ certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM
+ format the PEM file must contain the key as well as x509 certificates. This operation requires
+ the certificates/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to import the certificate.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.CertificateImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_certificate.metadata = {'url': '/certificates/{certificate-name}/import'} # type: ignore
+
+ def get_certificate_versions(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.CertificateListResult"]
+ """List the versions of a certificate.
+
+ The GetCertificateVersions operation returns the versions of a certificate in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificate_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_certificate_versions.metadata = {'url': '/certificates/{certificate-name}/versions'} # type: ignore
+
+ def get_certificate_policy(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificatePolicy"
+ """Lists the policy for a certificate.
+
+ The GetCertificatePolicy operation returns the specified certificate policy resources in the
+ specified key vault. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in a given key vault.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificatePolicy"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificatePolicy', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} # type: ignore
+
+ def update_certificate_policy(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_policy, # type: "models.CertificatePolicy"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificatePolicy"
+ """Updates the policy for a certificate.
+
+ Set specified members in the certificate policy. Leave others as null. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_policy: The policy for the certificate.
+ :type certificate_policy: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificatePolicy"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(certificate_policy, 'CertificatePolicy')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificatePolicy', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} # type: ignore
+
+ def update_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_version, # type: str
+ parameters, # type: "models.CertificateUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Updates the specified attributes associated with the given certificate.
+
+ The UpdateCertificate operation applies the specified update on the given certificate; the only
+ elements updated are the certificate's attributes. This operation requires the
+ certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given key vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate.
+ :type certificate_version: str
+ :param parameters: The parameters for certificate update.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.CertificateUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} # type: ignore
+
+ def get_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_version, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Gets information about a certificate.
+
+ Gets information about a specific certificate. This operation requires the certificates/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate.
+ :type certificate_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} # type: ignore
+
+ def update_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_operation, # type: "models.CertificateOperationUpdateParameter"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateOperation"
+ """Updates a certificate operation.
+
+ Updates a certificate creation operation that is already in progress. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param certificate_operation: The certificate operation response.
+ :type certificate_operation: ~azure.keyvault.v2016_10_01.models.CertificateOperationUpdateParameter
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(certificate_operation, 'CertificateOperationUpdateParameter')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ def get_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateOperation"
+ """Gets the creation operation of a certificate.
+
+ Gets the creation operation associated with a specified certificate. This operation requires
+ the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ def delete_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateOperation"
+ """Deletes the creation operation for a specific certificate.
+
+ Deletes the creation operation for a specified certificate that is in the process of being
+ created. The certificate is no longer created. This operation requires the certificates/update
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ def merge_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateMergeParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Merges a certificate or a certificate chain with a key pair existing on the server.
+
+ The MergeCertificate operation performs the merging of a certificate or certificate chain with
+ a key pair currently available in the service. This operation requires the certificates/create
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to merge certificate.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.CertificateMergeParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.merge_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateMergeParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'} # type: ignore
+
+ def get_deleted_certificates(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedCertificateListResult"]
+ """Lists the deleted certificates in the specified vault currently available for recovery.
+
+ The GetDeletedCertificates operation retrieves the certificates in the current vault which are
+ in a deleted state and ready for recovery or purging. This operation includes deletion-specific
+ information. This operation requires the certificates/get/list permission. This operation can
+ only be enabled on soft-delete enabled vaults.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedCertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_certificates.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedCertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_certificates.metadata = {'url': '/deletedcertificates'} # type: ignore
+
+ def get_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedCertificateBundle"
+ """Retrieves information about the specified deleted certificate.
+
+ The GetDeletedCertificate operation retrieves the deleted certificate information plus its
+ attributes, such as retention interval, scheduled permanent deletion and the current deletion
+ recovery level. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedCertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} # type: ignore
+
+ def purge_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Permanently deletes the specified deleted certificate.
+
+ The PurgeDeletedCertificate operation performs an irreversible deletion of the specified
+ certificate, without possibility for recovery. The operation is not available if the recovery
+ level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.purge_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} # type: ignore
+
+ def recover_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Recovers the deleted certificate back to its current version under /certificates.
+
+ The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The
+ operation is applicable in vaults enabled for soft-delete, and must be issued during the
+ retention interval (available in the deleted certificate's attributes). This operation requires
+ the certificates/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the deleted certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.recover_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}/recover'} # type: ignore
+
+ def get_storage_accounts(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.StorageListResult"]
+ """List storage accounts managed by the specified key vault. This operation requires the
+ storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either StorageListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.StorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_storage_accounts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('StorageListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_storage_accounts.metadata = {'url': '/storage'} # type: ignore
+
+ def delete_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Deletes a storage account. This operation requires the storage/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ def get_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Gets information about a specified storage account. This operation requires the storage/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ def set_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Creates or updates a new storage account. This operation requires the storage/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to create a storage account.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ def update_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Updates the specified attributes associated with the given storage account. This operation
+ requires the storage/set/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to update a storage account.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ def regenerate_storage_account_key(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountRegenerteKeyParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Regenerates the specified key value for the given storage account. This operation requires the
+ storage/regeneratekey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to regenerate storage account key.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.StorageAccountRegenerteKeyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.regenerate_storage_account_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountRegenerteKeyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ regenerate_storage_account_key.metadata = {'url': '/storage/{storage-account-name}/regeneratekey'} # type: ignore
+
+ def get_sas_definitions(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.SasDefinitionListResult"]
+ """List storage SAS definitions for the given storage account. This operation requires the
+ storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_sas_definitions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('SasDefinitionListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_sas_definitions.metadata = {'url': '/storage/{storage-account-name}/sas'} # type: ignore
+
+ def delete_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SasDefinitionBundle"
+ """Deletes a SAS definition from a specified storage account. This operation requires the
+ storage/deletesas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.delete_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ def get_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SasDefinitionBundle"
+ """Gets information about a SAS definition for the specified storage account. This operation
+ requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+
+ # Construct URL
+ url = self.get_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ def set_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ parameters, # type: "models.SasDefinitionCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SasDefinitionBundle"
+ """Creates or updates a new SAS definition for the specified storage account. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to create a SAS definition.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SasDefinitionCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SasDefinitionCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ def update_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ parameters, # type: "models.SasDefinitionUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SasDefinitionBundle"
+ """Updates the specified attributes associated with the given SAS definition. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to update a SAS definition.
+ :type parameters: ~azure.keyvault.v2016_10_01.models.SasDefinitionUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2016-10-01"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SasDefinitionUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/py.typed b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/py.typed
new file mode 100644
index 000000000000..e5aff4f83af8
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/__init__.py
similarity index 76%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/__init__.py
index e913d4cf6c46..a6c1f9b7a792 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/__init__.py
@@ -1,18 +1,16 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client import KeyVaultClient
__all__ = ['KeyVaultClient']
-from .version import VERSION
-
-__version__ = VERSION
-
+try:
+ from ._patch import patch_sdk # type: ignore
+ patch_sdk()
+except ImportError:
+ pass
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/_configuration.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_configuration.py
similarity index 66%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/_configuration.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_configuration.py
index 68d6f5b6bd2c..500fe2b64fad 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/_configuration.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_configuration.py
@@ -1,47 +1,52 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+
+from typing import TYPE_CHECKING
+
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
-from .version import VERSION
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
+VERSION = "unknown"
class KeyVaultClientConfiguration(Configuration):
- """Configuration for KeyVaultClient
+ """Configuration for KeyVaultClient.
+
Note that all parameters used to create this instance are saved as instance
attributes.
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
"""
- def __init__(self, credentials, **kwargs):
-
- if credentials is None:
- raise ValueError("Parameter 'credentials' must not be None.")
-
+ def __init__(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
super(KeyVaultClientConfiguration, self).__init__(**kwargs)
- self._configure(**kwargs)
- self.user_agent_policy.add_user_agent('azsdk-python-azure-keyvault/{}'.format(VERSION))
- self.generate_client_request_id = True
-
- self.credentials = credentials
+ self.api_version = "7.0"
+ kwargs.setdefault('sdk_moniker', 'keyvault/{}'.format(VERSION))
+ self._configure(**kwargs)
- def _configure(self, **kwargs):
+ def _configure(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/_key_vault_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_key_vault_client.py
similarity index 66%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/_key_vault_client.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_key_vault_client.py
index a1a1eb19328b..d9db79ab8785 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/_key_vault_client.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_key_vault_client.py
@@ -1,16 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+
from azure.core import PipelineClient
-from msrest import Serializer, Deserializer
+from msrest import Deserializer, Serializer
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
from ._configuration import KeyVaultClientConfiguration
from .operations import KeyVaultClientOperationsMixin
@@ -20,27 +23,32 @@
class KeyVaultClient(KeyVaultClientOperationsMixin):
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
-
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
def __init__(
- self, credentials, **kwargs):
-
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
base_url = '{vaultBaseUrl}'
- self._config = KeyVaultClientConfiguration(credentials, **kwargs)
+ self._config = KeyVaultClientConfiguration(**kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
- self.api_version = '7.0'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
+ def close(self):
+ # type: () -> None
+ self._client.close()
+
def __enter__(self):
+ # type: () -> KeyVaultClient
self._client.__enter__()
return self
+
def __exit__(self, *exc_details):
+ # type: (Any) -> None
self._client.__exit__(*exc_details)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_metadata.json b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_metadata.json
new file mode 100644
index 000000000000..32f572a8aad4
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/_metadata.json
@@ -0,0 +1,969 @@
+{
+ "chosen_version": "7.0",
+ "total_api_version_list": ["7.0"],
+ "client": {
+ "name": "KeyVaultClient",
+ "filename": "_key_vault_client",
+ "description": "The key vault client performs cryptographic key operations and vault operations against the Key Vault service.",
+ "base_url": null,
+ "custom_base_url": "\u0027{vaultBaseUrl}\u0027",
+ "azure_arm": false
+ },
+ "global_parameters": {
+ "sync_method": {
+ },
+ "async_method": {
+ },
+ "constant": {
+ },
+ "call": ""
+ },
+ "config": {
+ "credential": false,
+ "credential_scopes": null,
+ "credential_default_policy_type": "BearerTokenCredentialPolicy",
+ "credential_default_policy_type_has_async_version": true
+ },
+ "operation_groups": {
+ },
+ "operation_mixins": {
+ "create_key" : {
+ "sync": {
+ "signature": "def create_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n parameters, # type: \"models.KeyCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates a new key, stores it, then returns key parameters and attributes to the client.\n\nThe create key operation can be used to create any key type in Azure Key Vault. If the named\nkey already exists, Azure Key Vault creates a new version of the key. It requires the\nkeys/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name for the new key. The system will generate the version name for the\n new key.\n:type key_name: str\n:param parameters: The parameters to create a key.\n:type parameters: ~azure.keyvault.v7_0.models.KeyCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def create_key(\n self,\n vault_base_url: str,\n key_name: str,\n parameters: \"models.KeyCreateParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Creates a new key, stores it, then returns key parameters and attributes to the client.\n\nThe create key operation can be used to create any key type in Azure Key Vault. If the named\nkey already exists, Azure Key Vault creates a new version of the key. It requires the\nkeys/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name for the new key. The system will generate the version name for the\n new key.\n:type key_name: str\n:param parameters: The parameters to create a key.\n:type parameters: ~azure.keyvault.v7_0.models.KeyCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, parameters"
+ },
+ "import_key" : {
+ "sync": {
+ "signature": "def import_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n parameters, # type: \"models.KeyImportParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Imports an externally created key, stores it, and returns key parameters and attributes to the client.\n\nThe import key operation may be used to import any key type into an Azure Key Vault. If the\nnamed key already exists, Azure Key Vault creates a new version of the key. This operation\nrequires the keys/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: Name for the imported key.\n:type key_name: str\n:param parameters: The parameters to import a key.\n:type parameters: ~azure.keyvault.v7_0.models.KeyImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def import_key(\n self,\n vault_base_url: str,\n key_name: str,\n parameters: \"models.KeyImportParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Imports an externally created key, stores it, and returns key parameters and attributes to the client.\n\nThe import key operation may be used to import any key type into an Azure Key Vault. If the\nnamed key already exists, Azure Key Vault creates a new version of the key. This operation\nrequires the keys/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: Name for the imported key.\n:type key_name: str\n:param parameters: The parameters to import a key.\n:type parameters: ~azure.keyvault.v7_0.models.KeyImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, parameters"
+ },
+ "delete_key" : {
+ "sync": {
+ "signature": "def delete_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a key of any type from storage in Azure Key Vault.\n\nThe delete key operation cannot be used to remove individual versions of a key. This operation\nremoves the cryptographic material associated with the key, which means the key is not usable\nfor Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the\nkeys/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to delete.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.DeletedKeyBundle\":\n",
+ "doc": "\"\"\"Deletes a key of any type from storage in Azure Key Vault.\n\nThe delete key operation cannot be used to remove individual versions of a key. This operation\nremoves the cryptographic material associated with the key, which means the key is not usable\nfor Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the\nkeys/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to delete.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "update_key" : {
+ "sync": {
+ "signature": "def update_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.\n\nIn order to perform this operation, the key must already exist in the Key Vault. Note: The\ncryptographic material of a key itself cannot be changed. This operation requires the\nkeys/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of key to update.\n:type key_name: str\n:param key_version: The version of the key to update.\n:type key_version: str\n:param parameters: The parameters of the key to update.\n:type parameters: ~azure.keyvault.v7_0.models.KeyUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyUpdateParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.\n\nIn order to perform this operation, the key must already exist in the Key Vault. Note: The\ncryptographic material of a key itself cannot be changed. This operation requires the\nkeys/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of key to update.\n:type key_name: str\n:param key_version: The version of the key to update.\n:type key_version: str\n:param parameters: The parameters of the key to update.\n:type parameters: ~azure.keyvault.v7_0.models.KeyUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "get_key" : {
+ "sync": {
+ "signature": "def get_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the public part of a stored key.\n\nThe get key operation is applicable to all key types. If the requested key is symmetric, then\nno key material is released in the response. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to get.\n:type key_name: str\n:param key_version: Adding the version parameter retrieves a specific version of a key. This\n URI fragment is optional. If not specified, the latest version of the key is returned.\n:type key_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Gets the public part of a stored key.\n\nThe get key operation is applicable to all key types. If the requested key is symmetric, then\nno key material is released in the response. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to get.\n:type key_name: str\n:param key_version: Adding the version parameter retrieves a specific version of a key. This\n URI fragment is optional. If not specified, the latest version of the key is returned.\n:type key_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version"
+ },
+ "get_key_versions" : {
+ "sync": {
+ "signature": "def get_key_versions(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Retrieves a list of individual key versions with the same key name.\n\nThe full key identifier, attributes, and tags are provided in the response. This operation\nrequires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_key_versions(\n self,\n vault_base_url: str,\n key_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.KeyListResult\"]:\n",
+ "doc": "\"\"\"Retrieves a list of individual key versions with the same key name.\n\nThe full key identifier, attributes, and tags are provided in the response. This operation\nrequires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, maxresults"
+ },
+ "get_keys" : {
+ "sync": {
+ "signature": "def get_keys(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a stored key. The LIST operation is applicable to all key types, however only\nthe base key identifier, attributes, and tags are provided in the response. Individual versions\nof a key are not listed in the response. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_keys(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.KeyListResult\"]:\n",
+ "doc": "\"\"\"List keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a stored key. The LIST operation is applicable to all key types, however only\nthe base key identifier, attributes, and tags are provided in the response. Individual versions\nof a key are not listed in the response. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "backup_key" : {
+ "sync": {
+ "signature": "def backup_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Requests that a backup of the specified key be downloaded to the client.\n\nThe Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this\noperation does NOT return key material in a form that can be used outside the Azure Key Vault\nsystem, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key\nVault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure\nKey Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.\nThe BACKUP operation may be used to export, in protected form, any key type from Azure Key\nVault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed\nwithin geographical boundaries only; meaning that a BACKUP from one geographical area cannot be\nrestored to another geographical area. For example, a backup from the US geographical area\ncannot be restored in an EU geographical area. This operation requires the key/backup\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupKeyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.BackupKeyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def backup_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.BackupKeyResult\":\n",
+ "doc": "\"\"\"Requests that a backup of the specified key be downloaded to the client.\n\nThe Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this\noperation does NOT return key material in a form that can be used outside the Azure Key Vault\nsystem, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key\nVault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure\nKey Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.\nThe BACKUP operation may be used to export, in protected form, any key type from Azure Key\nVault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed\nwithin geographical boundaries only; meaning that a BACKUP from one geographical area cannot be\nrestored to another geographical area. For example, a backup from the US geographical area\ncannot be restored in an EU geographical area. This operation requires the key/backup\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupKeyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.BackupKeyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "restore_key" : {
+ "sync": {
+ "signature": "def restore_key(\n self,\n vault_base_url, # type: str\n parameters, # type: \"models.KeyRestoreParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Restores a backed up key to a vault.\n\nImports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,\nattributes and access control policies. The RESTORE operation may be used to import a\npreviously backed up key. Individual versions of a key cannot be restored. The key is restored\nin its entirety with the same key name as it had when it was backed up. If the key name is not\navailable in the target Key Vault, the RESTORE operation will be rejected. While the key name\nis retained during restore, the final key identifier will change if the key is restored to a\ndifferent vault. Restore will restore all versions and preserve version identifiers. The\nRESTORE operation is subject to security constraints: The target Key Vault must be owned by the\nsame Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission\nin the target Key Vault. This operation requires the keys/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the key.\n:type parameters: ~azure.keyvault.v7_0.models.KeyRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def restore_key(\n self,\n vault_base_url: str,\n parameters: \"models.KeyRestoreParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Restores a backed up key to a vault.\n\nImports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,\nattributes and access control policies. The RESTORE operation may be used to import a\npreviously backed up key. Individual versions of a key cannot be restored. The key is restored\nin its entirety with the same key name as it had when it was backed up. If the key name is not\navailable in the target Key Vault, the RESTORE operation will be rejected. While the key name\nis retained during restore, the final key identifier will change if the key is restored to a\ndifferent vault. Restore will restore all versions and preserve version identifiers. The\nRESTORE operation is subject to security constraints: The target Key Vault must be owned by the\nsame Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission\nin the target Key Vault. This operation requires the keys/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the key.\n:type parameters: ~azure.keyvault.v7_0.models.KeyRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, parameters"
+ },
+ "encrypt" : {
+ "sync": {
+ "signature": "def encrypt(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.\n\nThe ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is\nstored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of\ndata, the size of which is dependent on the target key and the encryption algorithm to be used.\nThe ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault\nsince protection with an asymmetric key can be performed using public portion of the key. This\noperation is supported for asymmetric keys as a convenience for callers that have a key-\nreference but do not have access to the public key material. This operation requires the\nkeys/encrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the encryption operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def encrypt(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.\n\nThe ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is\nstored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of\ndata, the size of which is dependent on the target key and the encryption algorithm to be used.\nThe ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault\nsince protection with an asymmetric key can be performed using public portion of the key. This\noperation is supported for asymmetric keys as a convenience for callers that have a key-\nreference but do not have access to the public key material. This operation requires the\nkeys/encrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the encryption operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "decrypt" : {
+ "sync": {
+ "signature": "def decrypt(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Decrypts a single block of encrypted data.\n\nThe DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption\nkey and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a\nsingle block of data may be decrypted, the size of this block is dependent on the target key\nand the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys\nstored in Azure Key Vault since it uses the private portion of the key. This operation requires\nthe keys/decrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the decryption operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def decrypt(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Decrypts a single block of encrypted data.\n\nThe DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption\nkey and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a\nsingle block of data may be decrypted, the size of this block is dependent on the target key\nand the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys\nstored in Azure Key Vault since it uses the private portion of the key. This operation requires\nthe keys/decrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the decryption operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "sign" : {
+ "sync": {
+ "signature": "def sign(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeySignParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates a signature from a digest using the specified key.\n\nThe SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault\nsince this operation uses the private portion of the key. This operation requires the keys/sign\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the signing operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeySignParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def sign(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeySignParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Creates a signature from a digest using the specified key.\n\nThe SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault\nsince this operation uses the private portion of the key. This operation requires the keys/sign\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the signing operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeySignParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "verify" : {
+ "sync": {
+ "signature": "def verify(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyVerifyParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Verifies a signature using a specified key.\n\nThe VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not\nstrictly necessary for asymmetric keys stored in Azure Key Vault since signature verification\ncan be performed using the public portion of the key but this operation is supported as a\nconvenience for callers that only have a key-reference and not the public portion of the key.\nThis operation requires the keys/verify permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for verify operations.\n:type parameters: ~azure.keyvault.v7_0.models.KeyVerifyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyVerifyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyVerifyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def verify(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyVerifyParameters\",\n **kwargs\n) -\u003e \"models.KeyVerifyResult\":\n",
+ "doc": "\"\"\"Verifies a signature using a specified key.\n\nThe VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not\nstrictly necessary for asymmetric keys stored in Azure Key Vault since signature verification\ncan be performed using the public portion of the key but this operation is supported as a\nconvenience for callers that only have a key-reference and not the public portion of the key.\nThis operation requires the keys/verify permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for verify operations.\n:type parameters: ~azure.keyvault.v7_0.models.KeyVerifyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyVerifyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyVerifyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "wrap_key" : {
+ "sync": {
+ "signature": "def wrap_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Wraps a symmetric key using a specified key.\n\nThe WRAP operation supports encryption of a symmetric key using a key encryption key that has\npreviously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for\nsymmetric keys stored in Azure Key Vault since protection with an asymmetric key can be\nperformed using the public portion of the key. This operation is supported for asymmetric keys\nas a convenience for callers that have a key-reference but do not have access to the public key\nmaterial. This operation requires the keys/wrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for wrap operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def wrap_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Wraps a symmetric key using a specified key.\n\nThe WRAP operation supports encryption of a symmetric key using a key encryption key that has\npreviously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for\nsymmetric keys stored in Azure Key Vault since protection with an asymmetric key can be\nperformed using the public portion of the key. This operation is supported for asymmetric keys\nas a convenience for callers that have a key-reference but do not have access to the public key\nmaterial. This operation requires the keys/wrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for wrap operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "unwrap_key" : {
+ "sync": {
+ "signature": "def unwrap_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Unwraps a symmetric key using the specified key that was initially used for wrapping that key.\n\nThe UNWRAP operation supports decryption of a symmetric key using the target key encryption\nkey. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to\nasymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of\nthe key. This operation requires the keys/unwrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the key operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def unwrap_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Unwraps a symmetric key using the specified key that was initially used for wrapping that key.\n\nThe UNWRAP operation supports decryption of a symmetric key using the target key encryption\nkey. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to\nasymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of\nthe key. This operation requires the keys/unwrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the key operation.\n:type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "get_deleted_keys" : {
+ "sync": {
+ "signature": "def get_deleted_keys(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the deleted keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a deleted key. This operation includes deletion-specific information. The Get\nDeleted Keys operation is applicable for vaults enabled for soft-delete. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedKeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_keys(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedKeyListResult\"]:\n",
+ "doc": "\"\"\"Lists the deleted keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a deleted key. This operation includes deletion-specific information. The Get\nDeleted Keys operation is applicable for vaults enabled for soft-delete. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedKeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_deleted_key" : {
+ "sync": {
+ "signature": "def get_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the public part of a deleted key.\n\nThe Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.DeletedKeyBundle\":\n",
+ "doc": "\"\"\"Gets the public part of a deleted key.\n\nThe Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "purge_deleted_key" : {
+ "sync": {
+ "signature": "def purge_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Permanently deletes the specified key.\n\nThe Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the\noperation can be invoked on any vault, it will return an error if invoked on a non soft-delete\nenabled vault. This operation requires the keys/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def purge_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e None:\n",
+ "doc": "\"\"\"Permanently deletes the specified key.\n\nThe Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the\noperation can be invoked on any vault, it will return an error if invoked on a non soft-delete\nenabled vault. This operation requires the keys/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "recover_deleted_key" : {
+ "sync": {
+ "signature": "def recover_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted key to its latest version.\n\nThe Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.\nIt recovers the deleted key back to its latest version under /keys. An attempt to recover an\nnon-deleted key will return an error. Consider this the inverse of the delete operation on\nsoft-delete enabled vaults. This operation requires the keys/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the deleted key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted key to its latest version.\n\nThe Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.\nIt recovers the deleted key back to its latest version under /keys. An attempt to recover an\nnon-deleted key will return an error. Consider this the inverse of the delete operation on\nsoft-delete enabled vaults. This operation requires the keys/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the deleted key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "set_secret" : {
+ "sync": {
+ "signature": "def set_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n parameters, # type: \"models.SecretSetParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Sets a secret in a specified key vault.\n\nThe SET operation adds a secret to the Azure Key Vault. If the named secret already exists,\nAzure Key Vault creates a new version of that secret. This operation requires the secrets/set\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param parameters: The parameters for setting the secret.\n:type parameters: ~azure.keyvault.v7_0.models.SecretSetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n parameters: \"models.SecretSetParameters\",\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Sets a secret in a specified key vault.\n\nThe SET operation adds a secret to the Azure Key Vault. If the named secret already exists,\nAzure Key Vault creates a new version of that secret. This operation requires the secrets/set\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param parameters: The parameters for setting the secret.\n:type parameters: ~azure.keyvault.v7_0.models.SecretSetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name, parameters"
+ },
+ "delete_secret" : {
+ "sync": {
+ "signature": "def delete_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a secret from a specified key vault.\n\nThe DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied\nto an individual version of a secret. This operation requires the secrets/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e \"models.DeletedSecretBundle\":\n",
+ "doc": "\"\"\"Deletes a secret from a specified key vault.\n\nThe DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied\nto an individual version of a secret. This operation requires the secrets/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "update_secret" : {
+ "sync": {
+ "signature": "def update_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n secret_version, # type: str\n parameters, # type: \"models.SecretUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the attributes associated with a specified secret in a given key vault.\n\nThe UPDATE operation changes specified attributes of an existing stored secret. Attributes that\nare not specified in the request are left unchanged. The value of a secret itself cannot be\nchanged. This operation requires the secrets/set permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param secret_version: The version of the secret.\n:type secret_version: str\n:param parameters: The parameters for update secret operation.\n:type parameters: ~azure.keyvault.v7_0.models.SecretUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n secret_version: str,\n parameters: \"models.SecretUpdateParameters\",\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Updates the attributes associated with a specified secret in a given key vault.\n\nThe UPDATE operation changes specified attributes of an existing stored secret. Attributes that\nare not specified in the request are left unchanged. The value of a secret itself cannot be\nchanged. This operation requires the secrets/set permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param secret_version: The version of the secret.\n:type secret_version: str\n:param parameters: The parameters for update secret operation.\n:type parameters: ~azure.keyvault.v7_0.models.SecretUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name, secret_version, parameters"
+ },
+ "get_secret" : {
+ "sync": {
+ "signature": "def get_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n secret_version, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Get a specified secret from a given key vault.\n\nThe GET operation is applicable to any secret stored in Azure Key Vault. This operation\nrequires the secrets/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param secret_version: The version of the secret. This URI fragment is optional. If not\n specified, the latest version of the secret is returned.\n:type secret_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n secret_version: str,\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Get a specified secret from a given key vault.\n\nThe GET operation is applicable to any secret stored in Azure Key Vault. This operation\nrequires the secrets/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param secret_version: The version of the secret. This URI fragment is optional. If not\n specified, the latest version of the secret is returned.\n:type secret_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name, secret_version"
+ },
+ "get_secrets" : {
+ "sync": {
+ "signature": "def get_secrets(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List secrets in a specified key vault.\n\nThe Get Secrets operation is applicable to the entire vault. However, only the base secret\nidentifier and its attributes are provided in the response. Individual secret versions are not\nlisted in the response. This operation requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified, the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SecretListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_secrets(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.SecretListResult\"]:\n",
+ "doc": "\"\"\"List secrets in a specified key vault.\n\nThe Get Secrets operation is applicable to the entire vault. However, only the base secret\nidentifier and its attributes are provided in the response. Individual secret versions are not\nlisted in the response. This operation requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified, the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SecretListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_secret_versions" : {
+ "sync": {
+ "signature": "def get_secret_versions(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List all versions of the specified secret.\n\nThe full secret identifier and attributes are provided in the response. No values are returned\nfor the secrets. This operations requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified, the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SecretListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_secret_versions(\n self,\n vault_base_url: str,\n secret_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.SecretListResult\"]:\n",
+ "doc": "\"\"\"List all versions of the specified secret.\n\nThe full secret identifier and attributes are provided in the response. No values are returned\nfor the secrets. This operations requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified, the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SecretListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name, maxresults"
+ },
+ "get_deleted_secrets" : {
+ "sync": {
+ "signature": "def get_deleted_secrets(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists deleted secrets for the specified vault.\n\nThe Get Deleted Secrets operation returns the secrets that have been deleted for a vault\nenabled for soft-delete. This operation requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedSecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_secrets(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedSecretListResult\"]:\n",
+ "doc": "\"\"\"Lists deleted secrets for the specified vault.\n\nThe Get Deleted Secrets operation returns the secrets that have been deleted for a vault\nenabled for soft-delete. This operation requires the secrets/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedSecretListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_deleted_secret" : {
+ "sync": {
+ "signature": "def get_deleted_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the specified deleted secret.\n\nThe Get Deleted Secret operation returns the specified deleted secret along with its\nattributes. This operation requires the secrets/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e \"models.DeletedSecretBundle\":\n",
+ "doc": "\"\"\"Gets the specified deleted secret.\n\nThe Get Deleted Secret operation returns the specified deleted secret along with its\nattributes. This operation requires the secrets/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "purge_deleted_secret" : {
+ "sync": {
+ "signature": "def purge_deleted_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Permanently deletes the specified secret.\n\nThe purge deleted secret operation removes the secret permanently, without the possibility of\nrecovery. This operation can only be enabled on a soft-delete enabled vault. This operation\nrequires the secrets/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def purge_deleted_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e None:\n",
+ "doc": "\"\"\"Permanently deletes the specified secret.\n\nThe purge deleted secret operation removes the secret permanently, without the possibility of\nrecovery. This operation can only be enabled on a soft-delete enabled vault. This operation\nrequires the secrets/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "recover_deleted_secret" : {
+ "sync": {
+ "signature": "def recover_deleted_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted secret to the latest version.\n\nRecovers the deleted secret in the specified vault. This operation can only be performed on a\nsoft-delete enabled vault. This operation requires the secrets/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the deleted secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted secret to the latest version.\n\nRecovers the deleted secret in the specified vault. This operation can only be performed on a\nsoft-delete enabled vault. This operation requires the secrets/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the deleted secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "backup_secret" : {
+ "sync": {
+ "signature": "def backup_secret(\n self,\n vault_base_url, # type: str\n secret_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Backs up the specified secret.\n\nRequests that a backup of the specified secret be downloaded to the client. All versions of the\nsecret will be downloaded. This operation requires the secrets/backup permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupSecretResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.BackupSecretResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def backup_secret(\n self,\n vault_base_url: str,\n secret_name: str,\n **kwargs\n) -\u003e \"models.BackupSecretResult\":\n",
+ "doc": "\"\"\"Backs up the specified secret.\n\nRequests that a backup of the specified secret be downloaded to the client. All versions of the\nsecret will be downloaded. This operation requires the secrets/backup permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param secret_name: The name of the secret.\n:type secret_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupSecretResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.BackupSecretResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, secret_name"
+ },
+ "restore_secret" : {
+ "sync": {
+ "signature": "def restore_secret(\n self,\n vault_base_url, # type: str\n parameters, # type: \"models.SecretRestoreParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Restores a backed up secret to a vault.\n\nRestores a backed up secret, and all its versions, to a vault. This operation requires the\nsecrets/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the secret.\n:type parameters: ~azure.keyvault.v7_0.models.SecretRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def restore_secret(\n self,\n vault_base_url: str,\n parameters: \"models.SecretRestoreParameters\",\n **kwargs\n) -\u003e \"models.SecretBundle\":\n",
+ "doc": "\"\"\"Restores a backed up secret to a vault.\n\nRestores a backed up secret, and all its versions, to a vault. This operation requires the\nsecrets/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the secret.\n:type parameters: ~azure.keyvault.v7_0.models.SecretRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SecretBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SecretBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, parameters"
+ },
+ "get_certificates" : {
+ "sync": {
+ "signature": "def get_certificates(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n include_pending=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List certificates in a specified key vault.\n\nThe GetCertificates operation returns the set of certificates resources in the specified key\nvault. This operation requires the certificates/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:param include_pending: Specifies whether to include certificates which are not completely\n provisioned.\n:type include_pending: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_certificates(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n include_pending: Optional[bool] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.CertificateListResult\"]:\n",
+ "doc": "\"\"\"List certificates in a specified key vault.\n\nThe GetCertificates operation returns the set of certificates resources in the specified key\nvault. This operation requires the certificates/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:param include_pending: Specifies whether to include certificates which are not completely\n provisioned.\n:type include_pending: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults, include_pending"
+ },
+ "delete_certificate" : {
+ "sync": {
+ "signature": "def delete_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a certificate from a specified key vault.\n\nDeletes all versions of a certificate object along with its associated policy. Delete\ncertificate cannot be used to remove individual versions of a certificate object. This\noperation requires the certificates/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedCertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.DeletedCertificateBundle\":\n",
+ "doc": "\"\"\"Deletes a certificate from a specified key vault.\n\nDeletes all versions of a certificate object along with its associated policy. Delete\ncertificate cannot be used to remove individual versions of a certificate object. This\noperation requires the certificates/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedCertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "set_certificate_contacts" : {
+ "sync": {
+ "signature": "def set_certificate_contacts(\n self,\n vault_base_url, # type: str\n contacts, # type: \"models.Contacts\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Sets the certificate contacts for the specified key vault.\n\nSets the certificate contacts for the specified key vault. This operation requires the\ncertificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param contacts: The contacts for the key vault certificate.\n:type contacts: ~azure.keyvault.v7_0.models.Contacts\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_certificate_contacts(\n self,\n vault_base_url: str,\n contacts: \"models.Contacts\",\n **kwargs\n) -\u003e \"models.Contacts\":\n",
+ "doc": "\"\"\"Sets the certificate contacts for the specified key vault.\n\nSets the certificate contacts for the specified key vault. This operation requires the\ncertificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param contacts: The contacts for the key vault certificate.\n:type contacts: ~azure.keyvault.v7_0.models.Contacts\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, contacts"
+ },
+ "get_certificate_contacts" : {
+ "sync": {
+ "signature": "def get_certificate_contacts(\n self,\n vault_base_url, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the certificate contacts for a specified key vault.\n\nThe GetCertificateContacts operation returns the set of certificate contact resources in the\nspecified key vault. This operation requires the certificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate_contacts(\n self,\n vault_base_url: str,\n **kwargs\n) -\u003e \"models.Contacts\":\n",
+ "doc": "\"\"\"Lists the certificate contacts for a specified key vault.\n\nThe GetCertificateContacts operation returns the set of certificate contact resources in the\nspecified key vault. This operation requires the certificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url"
+ },
+ "delete_certificate_contacts" : {
+ "sync": {
+ "signature": "def delete_certificate_contacts(\n self,\n vault_base_url, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes the certificate contacts for a specified key vault.\n\nDeletes the certificate contacts for a specified key vault certificate. This operation requires\nthe certificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_certificate_contacts(\n self,\n vault_base_url: str,\n **kwargs\n) -\u003e \"models.Contacts\":\n",
+ "doc": "\"\"\"Deletes the certificate contacts for a specified key vault.\n\nDeletes the certificate contacts for a specified key vault certificate. This operation requires\nthe certificates/managecontacts permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Contacts, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.Contacts\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url"
+ },
+ "get_certificate_issuers" : {
+ "sync": {
+ "signature": "def get_certificate_issuers(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List certificate issuers for a specified key vault.\n\nThe GetCertificateIssuers operation returns the set of certificate issuer resources in the\nspecified key vault. This operation requires the certificates/manageissuers/getissuers\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateIssuerListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_certificate_issuers(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.CertificateIssuerListResult\"]:\n",
+ "doc": "\"\"\"List certificate issuers for a specified key vault.\n\nThe GetCertificateIssuers operation returns the set of certificate issuer resources in the\nspecified key vault. This operation requires the certificates/manageissuers/getissuers\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateIssuerListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "set_certificate_issuer" : {
+ "sync": {
+ "signature": "def set_certificate_issuer(\n self,\n vault_base_url, # type: str\n issuer_name, # type: str\n parameter, # type: \"models.CertificateIssuerSetParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Sets the specified certificate issuer.\n\nThe SetCertificateIssuer operation adds or updates the specified certificate issuer. This\noperation requires the certificates/setissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:param parameter: Certificate issuer set parameter.\n:type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerSetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_certificate_issuer(\n self,\n vault_base_url: str,\n issuer_name: str,\n parameter: \"models.CertificateIssuerSetParameters\",\n **kwargs\n) -\u003e \"models.IssuerBundle\":\n",
+ "doc": "\"\"\"Sets the specified certificate issuer.\n\nThe SetCertificateIssuer operation adds or updates the specified certificate issuer. This\noperation requires the certificates/setissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:param parameter: Certificate issuer set parameter.\n:type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerSetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, issuer_name, parameter"
+ },
+ "update_certificate_issuer" : {
+ "sync": {
+ "signature": "def update_certificate_issuer(\n self,\n vault_base_url, # type: str\n issuer_name, # type: str\n parameter, # type: \"models.CertificateIssuerUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the specified certificate issuer.\n\nThe UpdateCertificateIssuer operation performs an update on the specified certificate issuer\nentity. This operation requires the certificates/setissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:param parameter: Certificate issuer update parameter.\n:type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_certificate_issuer(\n self,\n vault_base_url: str,\n issuer_name: str,\n parameter: \"models.CertificateIssuerUpdateParameters\",\n **kwargs\n) -\u003e \"models.IssuerBundle\":\n",
+ "doc": "\"\"\"Updates the specified certificate issuer.\n\nThe UpdateCertificateIssuer operation performs an update on the specified certificate issuer\nentity. This operation requires the certificates/setissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:param parameter: Certificate issuer update parameter.\n:type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, issuer_name, parameter"
+ },
+ "get_certificate_issuer" : {
+ "sync": {
+ "signature": "def get_certificate_issuer(\n self,\n vault_base_url, # type: str\n issuer_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the specified certificate issuer.\n\nThe GetCertificateIssuer operation returns the specified certificate issuer resources in the\nspecified key vault. This operation requires the certificates/manageissuers/getissuers\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate_issuer(\n self,\n vault_base_url: str,\n issuer_name: str,\n **kwargs\n) -\u003e \"models.IssuerBundle\":\n",
+ "doc": "\"\"\"Lists the specified certificate issuer.\n\nThe GetCertificateIssuer operation returns the specified certificate issuer resources in the\nspecified key vault. This operation requires the certificates/manageissuers/getissuers\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, issuer_name"
+ },
+ "delete_certificate_issuer" : {
+ "sync": {
+ "signature": "def delete_certificate_issuer(\n self,\n vault_base_url, # type: str\n issuer_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes the specified certificate issuer.\n\nThe DeleteCertificateIssuer operation permanently removes the specified certificate issuer from\nthe vault. This operation requires the certificates/manageissuers/deleteissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_certificate_issuer(\n self,\n vault_base_url: str,\n issuer_name: str,\n **kwargs\n) -\u003e \"models.IssuerBundle\":\n",
+ "doc": "\"\"\"Deletes the specified certificate issuer.\n\nThe DeleteCertificateIssuer operation permanently removes the specified certificate issuer from\nthe vault. This operation requires the certificates/manageissuers/deleteissuers permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param issuer_name: The name of the issuer.\n:type issuer_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IssuerBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.IssuerBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, issuer_name"
+ },
+ "create_certificate" : {
+ "sync": {
+ "signature": "def create_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n parameters, # type: \"models.CertificateCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates a new certificate.\n\nIf this is the first version, the certificate resource is created. This operation requires the\ncertificates/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to create a certificate.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def create_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n parameters: \"models.CertificateCreateParameters\",\n **kwargs\n) -\u003e \"models.CertificateOperation\":\n",
+ "doc": "\"\"\"Creates a new certificate.\n\nIf this is the first version, the certificate resource is created. This operation requires the\ncertificates/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to create a certificate.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, parameters"
+ },
+ "import_certificate" : {
+ "sync": {
+ "signature": "def import_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n parameters, # type: \"models.CertificateImportParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Imports a certificate into a specified key vault.\n\nImports an existing valid certificate, containing a private key, into Azure Key Vault. The\ncertificate to be imported can be in either PFX or PEM format. If the certificate is in PEM\nformat the PEM file must contain the key as well as x509 certificates. This operation requires\nthe certificates/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to import the certificate.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def import_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n parameters: \"models.CertificateImportParameters\",\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Imports a certificate into a specified key vault.\n\nImports an existing valid certificate, containing a private key, into Azure Key Vault. The\ncertificate to be imported can be in either PFX or PEM format. If the certificate is in PEM\nformat the PEM file must contain the key as well as x509 certificates. This operation requires\nthe certificates/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to import the certificate.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, parameters"
+ },
+ "get_certificate_versions" : {
+ "sync": {
+ "signature": "def get_certificate_versions(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List the versions of a certificate.\n\nThe GetCertificateVersions operation returns the versions of a certificate in the specified key\nvault. This operation requires the certificates/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_certificate_versions(\n self,\n vault_base_url: str,\n certificate_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.CertificateListResult\"]:\n",
+ "doc": "\"\"\"List the versions of a certificate.\n\nThe GetCertificateVersions operation returns the versions of a certificate in the specified key\nvault. This operation requires the certificates/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either CertificateListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, maxresults"
+ },
+ "get_certificate_policy" : {
+ "sync": {
+ "signature": "def get_certificate_policy(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the policy for a certificate.\n\nThe GetCertificatePolicy operation returns the specified certificate policy resources in the\nspecified key vault. This operation requires the certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in a given key vault.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificatePolicy, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificatePolicy\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate_policy(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.CertificatePolicy\":\n",
+ "doc": "\"\"\"Lists the policy for a certificate.\n\nThe GetCertificatePolicy operation returns the specified certificate policy resources in the\nspecified key vault. This operation requires the certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in a given key vault.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificatePolicy, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificatePolicy\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "update_certificate_policy" : {
+ "sync": {
+ "signature": "def update_certificate_policy(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n certificate_policy, # type: \"models.CertificatePolicy\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the policy for a certificate.\n\nSet specified members in the certificate policy. Leave others as null. This operation requires\nthe certificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given vault.\n:type certificate_name: str\n:param certificate_policy: The policy for the certificate.\n:type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificatePolicy, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificatePolicy\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_certificate_policy(\n self,\n vault_base_url: str,\n certificate_name: str,\n certificate_policy: \"models.CertificatePolicy\",\n **kwargs\n) -\u003e \"models.CertificatePolicy\":\n",
+ "doc": "\"\"\"Updates the policy for a certificate.\n\nSet specified members in the certificate policy. Leave others as null. This operation requires\nthe certificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given vault.\n:type certificate_name: str\n:param certificate_policy: The policy for the certificate.\n:type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificatePolicy, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificatePolicy\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, certificate_policy"
+ },
+ "update_certificate" : {
+ "sync": {
+ "signature": "def update_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n certificate_version, # type: str\n parameters, # type: \"models.CertificateUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given certificate.\n\nThe UpdateCertificate operation applies the specified update on the given certificate; the only\nelements updated are the certificate\u0027s attributes. This operation requires the\ncertificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given key vault.\n:type certificate_name: str\n:param certificate_version: The version of the certificate.\n:type certificate_version: str\n:param parameters: The parameters for certificate update.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n certificate_version: str,\n parameters: \"models.CertificateUpdateParameters\",\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given certificate.\n\nThe UpdateCertificate operation applies the specified update on the given certificate; the only\nelements updated are the certificate\u0027s attributes. This operation requires the\ncertificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given key vault.\n:type certificate_name: str\n:param certificate_version: The version of the certificate.\n:type certificate_version: str\n:param parameters: The parameters for certificate update.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, certificate_version, parameters"
+ },
+ "get_certificate" : {
+ "sync": {
+ "signature": "def get_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n certificate_version, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets information about a certificate.\n\nGets information about a specific certificate. This operation requires the certificates/get\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given vault.\n:type certificate_name: str\n:param certificate_version: The version of the certificate. This URI fragment is optional. If\n not specified, the latest version of the certificate is returned.\n:type certificate_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n certificate_version: str,\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Gets information about a certificate.\n\nGets information about a specific certificate. This operation requires the certificates/get\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate in the given vault.\n:type certificate_name: str\n:param certificate_version: The version of the certificate. This URI fragment is optional. If\n not specified, the latest version of the certificate is returned.\n:type certificate_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, certificate_version"
+ },
+ "update_certificate_operation" : {
+ "sync": {
+ "signature": "def update_certificate_operation(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n certificate_operation, # type: \"models.CertificateOperationUpdateParameter\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates a certificate operation.\n\nUpdates a certificate creation operation that is already in progress. This operation requires\nthe certificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param certificate_operation: The certificate operation response.\n:type certificate_operation: ~azure.keyvault.v7_0.models.CertificateOperationUpdateParameter\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_certificate_operation(\n self,\n vault_base_url: str,\n certificate_name: str,\n certificate_operation: \"models.CertificateOperationUpdateParameter\",\n **kwargs\n) -\u003e \"models.CertificateOperation\":\n",
+ "doc": "\"\"\"Updates a certificate operation.\n\nUpdates a certificate creation operation that is already in progress. This operation requires\nthe certificates/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param certificate_operation: The certificate operation response.\n:type certificate_operation: ~azure.keyvault.v7_0.models.CertificateOperationUpdateParameter\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, certificate_operation"
+ },
+ "get_certificate_operation" : {
+ "sync": {
+ "signature": "def get_certificate_operation(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the creation operation of a certificate.\n\nGets the creation operation associated with a specified certificate. This operation requires\nthe certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_certificate_operation(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.CertificateOperation\":\n",
+ "doc": "\"\"\"Gets the creation operation of a certificate.\n\nGets the creation operation associated with a specified certificate. This operation requires\nthe certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "delete_certificate_operation" : {
+ "sync": {
+ "signature": "def delete_certificate_operation(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes the creation operation for a specific certificate.\n\nDeletes the creation operation for a specified certificate that is in the process of being\ncreated. The certificate is no longer created. This operation requires the certificates/update\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_certificate_operation(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.CertificateOperation\":\n",
+ "doc": "\"\"\"Deletes the creation operation for a specific certificate.\n\nDeletes the creation operation for a specified certificate that is in the process of being\ncreated. The certificate is no longer created. This operation requires the certificates/update\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateOperation, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateOperation\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "merge_certificate" : {
+ "sync": {
+ "signature": "def merge_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n parameters, # type: \"models.CertificateMergeParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Merges a certificate or a certificate chain with a key pair existing on the server.\n\nThe MergeCertificate operation performs the merging of a certificate or certificate chain with\na key pair currently available in the service. This operation requires the certificates/create\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to merge certificate.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateMergeParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def merge_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n parameters: \"models.CertificateMergeParameters\",\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Merges a certificate or a certificate chain with a key pair existing on the server.\n\nThe MergeCertificate operation performs the merging of a certificate or certificate chain with\na key pair currently available in the service. This operation requires the certificates/create\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:param parameters: The parameters to merge certificate.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateMergeParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name, parameters"
+ },
+ "backup_certificate" : {
+ "sync": {
+ "signature": "def backup_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Backs up the specified certificate.\n\nRequests that a backup of the specified certificate be downloaded to the client. All versions\nof the certificate will be downloaded. This operation requires the certificates/backup\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupCertificateResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.BackupCertificateResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def backup_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.BackupCertificateResult\":\n",
+ "doc": "\"\"\"Backs up the specified certificate.\n\nRequests that a backup of the specified certificate be downloaded to the client. All versions\nof the certificate will be downloaded. This operation requires the certificates/backup\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupCertificateResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.BackupCertificateResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "restore_certificate" : {
+ "sync": {
+ "signature": "def restore_certificate(\n self,\n vault_base_url, # type: str\n parameters, # type: \"models.CertificateRestoreParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Restores a backed up certificate to a vault.\n\nRestores a backed up certificate, and all its versions, to a vault. This operation requires the\ncertificates/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the certificate.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def restore_certificate(\n self,\n vault_base_url: str,\n parameters: \"models.CertificateRestoreParameters\",\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Restores a backed up certificate to a vault.\n\nRestores a backed up certificate, and all its versions, to a vault. This operation requires the\ncertificates/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the certificate.\n:type parameters: ~azure.keyvault.v7_0.models.CertificateRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, parameters"
+ },
+ "get_deleted_certificates" : {
+ "sync": {
+ "signature": "def get_deleted_certificates(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n include_pending=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the deleted certificates in the specified vault currently available for recovery.\n\nThe GetDeletedCertificates operation retrieves the certificates in the current vault which are\nin a deleted state and ready for recovery or purging. This operation includes deletion-specific\ninformation. This operation requires the certificates/get/list permission. This operation can\nonly be enabled on soft-delete enabled vaults.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:param include_pending: Specifies whether to include certificates which are not completely\n provisioned.\n:type include_pending: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedCertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_certificates(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n include_pending: Optional[bool] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedCertificateListResult\"]:\n",
+ "doc": "\"\"\"Lists the deleted certificates in the specified vault currently available for recovery.\n\nThe GetDeletedCertificates operation retrieves the certificates in the current vault which are\nin a deleted state and ready for recovery or purging. This operation includes deletion-specific\ninformation. This operation requires the certificates/get/list permission. This operation can\nonly be enabled on soft-delete enabled vaults.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:param include_pending: Specifies whether to include certificates which are not completely\n provisioned.\n:type include_pending: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedCertificateListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults, include_pending"
+ },
+ "get_deleted_certificate" : {
+ "sync": {
+ "signature": "def get_deleted_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Retrieves information about the specified deleted certificate.\n\nThe GetDeletedCertificate operation retrieves the deleted certificate information plus its\nattributes, such as retention interval, scheduled permanent deletion and the current deletion\nrecovery level. This operation requires the certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedCertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.DeletedCertificateBundle\":\n",
+ "doc": "\"\"\"Retrieves information about the specified deleted certificate.\n\nThe GetDeletedCertificate operation retrieves the deleted certificate information plus its\nattributes, such as retention interval, scheduled permanent deletion and the current deletion\nrecovery level. This operation requires the certificates/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedCertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "purge_deleted_certificate" : {
+ "sync": {
+ "signature": "def purge_deleted_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Permanently deletes the specified deleted certificate.\n\nThe PurgeDeletedCertificate operation performs an irreversible deletion of the specified\ncertificate, without possibility for recovery. The operation is not available if the recovery\nlevel does not specify \u0027Purgeable\u0027. This operation requires the certificate/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def purge_deleted_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e None:\n",
+ "doc": "\"\"\"Permanently deletes the specified deleted certificate.\n\nThe PurgeDeletedCertificate operation performs an irreversible deletion of the specified\ncertificate, without possibility for recovery. The operation is not available if the recovery\nlevel does not specify \u0027Purgeable\u0027. This operation requires the certificate/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "recover_deleted_certificate" : {
+ "sync": {
+ "signature": "def recover_deleted_certificate(\n self,\n vault_base_url, # type: str\n certificate_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted certificate back to its current version under /certificates.\n\nThe RecoverDeletedCertificate operation performs the reversal of the Delete operation. The\noperation is applicable in vaults enabled for soft-delete, and must be issued during the\nretention interval (available in the deleted certificate\u0027s attributes). This operation requires\nthe certificates/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the deleted certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_certificate(\n self,\n vault_base_url: str,\n certificate_name: str,\n **kwargs\n) -\u003e \"models.CertificateBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted certificate back to its current version under /certificates.\n\nThe RecoverDeletedCertificate operation performs the reversal of the Delete operation. The\noperation is applicable in vaults enabled for soft-delete, and must be issued during the\nretention interval (available in the deleted certificate\u0027s attributes). This operation requires\nthe certificates/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param certificate_name: The name of the deleted certificate.\n:type certificate_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CertificateBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.CertificateBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, certificate_name"
+ },
+ "get_storage_accounts" : {
+ "sync": {
+ "signature": "def get_storage_accounts(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List storage accounts managed by the specified key vault. This operation requires the\nstorage/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either StorageListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.StorageListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_storage_accounts(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.StorageListResult\"]:\n",
+ "doc": "\"\"\"List storage accounts managed by the specified key vault. This operation requires the\nstorage/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either StorageListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.StorageListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_deleted_storage_accounts" : {
+ "sync": {
+ "signature": "def get_deleted_storage_accounts(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists deleted storage accounts for the specified vault.\n\nThe Get Deleted Storage Accounts operation returns the storage accounts that have been deleted\nfor a vault enabled for soft-delete. This operation requires the storage/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedStorageListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedStorageListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_storage_accounts(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedStorageListResult\"]:\n",
+ "doc": "\"\"\"Lists deleted storage accounts for the specified vault.\n\nThe Get Deleted Storage Accounts operation returns the storage accounts that have been deleted\nfor a vault enabled for soft-delete. This operation requires the storage/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedStorageListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedStorageListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_deleted_storage_account" : {
+ "sync": {
+ "signature": "def get_deleted_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the specified deleted storage account.\n\nThe Get Deleted Storage Account operation returns the specified deleted storage account along\nwith its attributes. This operation requires the storage/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedStorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n **kwargs\n) -\u003e \"models.DeletedStorageBundle\":\n",
+ "doc": "\"\"\"Gets the specified deleted storage account.\n\nThe Get Deleted Storage Account operation returns the specified deleted storage account along\nwith its attributes. This operation requires the storage/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedStorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name"
+ },
+ "purge_deleted_storage_account" : {
+ "sync": {
+ "signature": "def purge_deleted_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Permanently deletes the specified storage account.\n\nThe purge deleted storage account operation removes the secret permanently, without the\npossibility of recovery. This operation can only be performed on a soft-delete enabled vault.\nThis operation requires the storage/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def purge_deleted_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n **kwargs\n) -\u003e None:\n",
+ "doc": "\"\"\"Permanently deletes the specified storage account.\n\nThe purge deleted storage account operation removes the secret permanently, without the\npossibility of recovery. This operation can only be performed on a soft-delete enabled vault.\nThis operation requires the storage/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name"
+ },
+ "recover_deleted_storage_account" : {
+ "sync": {
+ "signature": "def recover_deleted_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted storage account.\n\nRecovers the deleted storage account in the specified vault. This operation can only be\nperformed on a soft-delete enabled vault. This operation requires the storage/recover\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted storage account.\n\nRecovers the deleted storage account in the specified vault. This operation can only be\nperformed on a soft-delete enabled vault. This operation requires the storage/recover\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name"
+ },
+ "backup_storage_account" : {
+ "sync": {
+ "signature": "def backup_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Backs up the specified storage account.\n\nRequests that a backup of the specified storage account be downloaded to the client. This\noperation requires the storage/backup permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupStorageResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.BackupStorageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def backup_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n **kwargs\n) -\u003e \"models.BackupStorageResult\":\n",
+ "doc": "\"\"\"Backs up the specified storage account.\n\nRequests that a backup of the specified storage account be downloaded to the client. This\noperation requires the storage/backup permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupStorageResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.BackupStorageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name"
+ },
+ "restore_storage_account" : {
+ "sync": {
+ "signature": "def restore_storage_account(\n self,\n vault_base_url, # type: str\n parameters, # type: \"models.StorageRestoreParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Restores a backed up storage account to a vault.\n\nRestores a backed up storage account to a vault. This operation requires the storage/restore\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the storage account.\n:type parameters: ~azure.keyvault.v7_0.models.StorageRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def restore_storage_account(\n self,\n vault_base_url: str,\n parameters: \"models.StorageRestoreParameters\",\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Restores a backed up storage account to a vault.\n\nRestores a backed up storage account to a vault. This operation requires the storage/restore\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the storage account.\n:type parameters: ~azure.keyvault.v7_0.models.StorageRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, parameters"
+ },
+ "delete_storage_account" : {
+ "sync": {
+ "signature": "def delete_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a storage account. This operation requires the storage/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedStorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n **kwargs\n) -\u003e \"models.DeletedStorageBundle\":\n",
+ "doc": "\"\"\"Deletes a storage account. This operation requires the storage/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedStorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name"
+ },
+ "get_storage_account" : {
+ "sync": {
+ "signature": "def get_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets information about a specified storage account. This operation requires the storage/get\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Gets information about a specified storage account. This operation requires the storage/get\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name"
+ },
+ "set_storage_account" : {
+ "sync": {
+ "signature": "def set_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n parameters, # type: \"models.StorageAccountCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates or updates a new storage account. This operation requires the storage/set permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to create a storage account.\n:type parameters: ~azure.keyvault.v7_0.models.StorageAccountCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n parameters: \"models.StorageAccountCreateParameters\",\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Creates or updates a new storage account. This operation requires the storage/set permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to create a storage account.\n:type parameters: ~azure.keyvault.v7_0.models.StorageAccountCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, parameters"
+ },
+ "update_storage_account" : {
+ "sync": {
+ "signature": "def update_storage_account(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n parameters, # type: \"models.StorageAccountUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given storage account. This operation\nrequires the storage/set/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to update a storage account.\n:type parameters: ~azure.keyvault.v7_0.models.StorageAccountUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_storage_account(\n self,\n vault_base_url: str,\n storage_account_name: str,\n parameters: \"models.StorageAccountUpdateParameters\",\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given storage account. This operation\nrequires the storage/set/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to update a storage account.\n:type parameters: ~azure.keyvault.v7_0.models.StorageAccountUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, parameters"
+ },
+ "regenerate_storage_account_key" : {
+ "sync": {
+ "signature": "def regenerate_storage_account_key(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n parameters, # type: \"models.StorageAccountRegenerteKeyParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Regenerates the specified key value for the given storage account. This operation requires the\nstorage/regeneratekey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to regenerate storage account key.\n:type parameters: ~azure.keyvault.v7_0.models.StorageAccountRegenerteKeyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def regenerate_storage_account_key(\n self,\n vault_base_url: str,\n storage_account_name: str,\n parameters: \"models.StorageAccountRegenerteKeyParameters\",\n **kwargs\n) -\u003e \"models.StorageBundle\":\n",
+ "doc": "\"\"\"Regenerates the specified key value for the given storage account. This operation requires the\nstorage/regeneratekey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param parameters: The parameters to regenerate storage account key.\n:type parameters: ~azure.keyvault.v7_0.models.StorageAccountRegenerteKeyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: StorageBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.StorageBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, parameters"
+ },
+ "get_sas_definitions" : {
+ "sync": {
+ "signature": "def get_sas_definitions(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List storage SAS definitions for the given storage account. This operation requires the\nstorage/listsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SasDefinitionListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_sas_definitions(\n self,\n vault_base_url: str,\n storage_account_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.SasDefinitionListResult\"]:\n",
+ "doc": "\"\"\"List storage SAS definitions for the given storage account. This operation requires the\nstorage/listsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SasDefinitionListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, maxresults"
+ },
+ "get_deleted_sas_definitions" : {
+ "sync": {
+ "signature": "def get_deleted_sas_definitions(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists deleted SAS definitions for the specified vault and storage account.\n\nThe Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted\nfor a vault enabled for soft-delete. This operation requires the storage/listsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedSasDefinitionListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedSasDefinitionListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_sas_definitions(\n self,\n vault_base_url: str,\n storage_account_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedSasDefinitionListResult\"]:\n",
+ "doc": "\"\"\"Lists deleted SAS definitions for the specified vault and storage account.\n\nThe Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted\nfor a vault enabled for soft-delete. This operation requires the storage/listsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedSasDefinitionListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedSasDefinitionListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, maxresults"
+ },
+ "get_deleted_sas_definition" : {
+ "sync": {
+ "signature": "def get_deleted_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the specified deleted sas definition.\n\nThe Get Deleted SAS Definition operation returns the specified deleted SAS definition along\nwith its attributes. This operation requires the storage/getsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n **kwargs\n) -\u003e \"models.DeletedSasDefinitionBundle\":\n",
+ "doc": "\"\"\"Gets the specified deleted sas definition.\n\nThe Get Deleted SAS Definition operation returns the specified deleted SAS definition along\nwith its attributes. This operation requires the storage/getsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name"
+ },
+ "recover_deleted_sas_definition" : {
+ "sync": {
+ "signature": "def recover_deleted_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted SAS definition.\n\nRecovers the deleted SAS definition for the specified storage account. This operation can only\nbe performed on a soft-delete enabled vault. This operation requires the storage/recover\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n **kwargs\n) -\u003e \"models.SasDefinitionBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted SAS definition.\n\nRecovers the deleted SAS definition for the specified storage account. This operation can only\nbe performed on a soft-delete enabled vault. This operation requires the storage/recover\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name"
+ },
+ "delete_sas_definition" : {
+ "sync": {
+ "signature": "def delete_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a SAS definition from a specified storage account. This operation requires the\nstorage/deletesas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n **kwargs\n) -\u003e \"models.DeletedSasDefinitionBundle\":\n",
+ "doc": "\"\"\"Deletes a SAS definition from a specified storage account. This operation requires the\nstorage/deletesas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedSasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name"
+ },
+ "get_sas_definition" : {
+ "sync": {
+ "signature": "def get_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets information about a SAS definition for the specified storage account. This operation\nrequires the storage/getsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n **kwargs\n) -\u003e \"models.SasDefinitionBundle\":\n",
+ "doc": "\"\"\"Gets information about a SAS definition for the specified storage account. This operation\nrequires the storage/getsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name"
+ },
+ "set_sas_definition" : {
+ "sync": {
+ "signature": "def set_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n parameters, # type: \"models.SasDefinitionCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates or updates a new SAS definition for the specified storage account. This operation\nrequires the storage/setsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:param parameters: The parameters to create a SAS definition.\n:type parameters: ~azure.keyvault.v7_0.models.SasDefinitionCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def set_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n parameters: \"models.SasDefinitionCreateParameters\",\n **kwargs\n) -\u003e \"models.SasDefinitionBundle\":\n",
+ "doc": "\"\"\"Creates or updates a new SAS definition for the specified storage account. This operation\nrequires the storage/setsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:param parameters: The parameters to create a SAS definition.\n:type parameters: ~azure.keyvault.v7_0.models.SasDefinitionCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name, parameters"
+ },
+ "update_sas_definition" : {
+ "sync": {
+ "signature": "def update_sas_definition(\n self,\n vault_base_url, # type: str\n storage_account_name, # type: str\n sas_definition_name, # type: str\n parameters, # type: \"models.SasDefinitionUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given SAS definition. This operation\nrequires the storage/setsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:param parameters: The parameters to update a SAS definition.\n:type parameters: ~azure.keyvault.v7_0.models.SasDefinitionUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_sas_definition(\n self,\n vault_base_url: str,\n storage_account_name: str,\n sas_definition_name: str,\n parameters: \"models.SasDefinitionUpdateParameters\",\n **kwargs\n) -\u003e \"models.SasDefinitionBundle\":\n",
+ "doc": "\"\"\"Updates the specified attributes associated with the given SAS definition. This operation\nrequires the storage/setsas permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param storage_account_name: The name of the storage account.\n:type storage_account_name: str\n:param sas_definition_name: The name of the SAS definition.\n:type sas_definition_name: str\n:param parameters: The parameters to update a SAS definition.\n:type parameters: ~azure.keyvault.v7_0.models.SasDefinitionUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SasDefinitionBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, storage_account_name, sas_definition_name, parameters"
+ }
+ },
+ "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\"]}}}",
+ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}"
+}
\ No newline at end of file
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/__init__.py
similarity index 89%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/__init__.py
index fb2e6c3866fd..71ceadebe430 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_async import KeyVaultClient
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/_configuration_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/_configuration_async.py
similarity index 68%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/_configuration_async.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/_configuration_async.py
index fb961bb4bd2d..814bdc82fd31 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/_configuration_async.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/_configuration_async.py
@@ -1,47 +1,46 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+
+from typing import Any
+
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
-from ..version import VERSION
-
+VERSION = "unknown"
class KeyVaultClientConfiguration(Configuration):
- """Configuration for KeyVaultClient
+ """Configuration for KeyVaultClient.
+
Note that all parameters used to create this instance are saved as instance
attributes.
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
"""
- def __init__(self, credentials, **kwargs):
-
- if credentials is None:
- raise ValueError("Parameter 'credentials' must not be None.")
-
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
super(KeyVaultClientConfiguration, self).__init__(**kwargs)
- self._configure(**kwargs)
- self.user_agent_policy.add_user_agent('azsdk-python-azure-keyvault/{}'.format(VERSION))
- self.generate_client_request_id = True
-
- self.credentials = credentials
+ self.api_version = "7.0"
+ kwargs.setdefault('sdk_moniker', 'keyvault/{}'.format(VERSION))
+ self._configure(**kwargs)
- def _configure(self, **kwargs):
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/_key_vault_client_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/_key_vault_client_async.py
similarity index 69%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/_key_vault_client_async.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/_key_vault_client_async.py
index ad4b8a97754f..2d273c4e45f8 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/_key_vault_client_async.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/_key_vault_client_async.py
@@ -1,16 +1,15 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from typing import Any
+
from azure.core import AsyncPipelineClient
-from msrest import Serializer, Deserializer
+from msrest import Deserializer, Serializer
from ._configuration_async import KeyVaultClientConfiguration
from .operations_async import KeyVaultClientOperationsMixin
@@ -20,27 +19,28 @@
class KeyVaultClient(KeyVaultClientOperationsMixin):
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
-
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
def __init__(
- self, credentials, **kwargs):
-
+ self,
+ **kwargs: Any
+ ) -> None:
base_url = '{vaultBaseUrl}'
- self._config = KeyVaultClientConfiguration(credentials, **kwargs)
+ self._config = KeyVaultClientConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
- self.api_version = '2016-10-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
- async def __aenter__(self):
+ async def close(self) -> None:
+ await self._client.close()
+
+ async def __aenter__(self) -> "KeyVaultClient":
await self._client.__aenter__()
return self
- async def __aexit__(self, *exc_details):
+
+ async def __aexit__(self, *exc_details) -> None:
await self._client.__aexit__(*exc_details)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/operations_async/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/operations_async/__init__.py
similarity index 90%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/operations_async/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/operations_async/__init__.py
index 771a17ceb80d..b887c97a4206 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/operations_async/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/operations_async/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_operations_async import KeyVaultClientOperationsMixin
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/operations_async/_key_vault_client_operations_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/operations_async/_key_vault_client_operations_async.py
new file mode 100644
index 000000000000..5897008f9769
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/aio/operations_async/_key_vault_client_operations_async.py
@@ -0,0 +1,5232 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class KeyVaultClientOperationsMixin:
+
+ async def create_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ parameters: "models.KeyCreateParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Creates a new key, stores it, then returns key parameters and attributes to the client.
+
+ The create key operation can be used to create any key type in Azure Key Vault. If the named
+ key already exists, Azure Key Vault creates a new version of the key. It requires the
+ keys/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name for the new key. The system will generate the version name for the
+ new key.
+ :type key_name: str
+ :param parameters: The parameters to create a key.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_key.metadata = {'url': '/keys/{key-name}/create'} # type: ignore
+
+ async def import_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ parameters: "models.KeyImportParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Imports an externally created key, stores it, and returns key parameters and attributes to the client.
+
+ The import key operation may be used to import any key type into an Azure Key Vault. If the
+ named key already exists, Azure Key Vault creates a new version of the key. This operation
+ requires the keys/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: Name for the imported key.
+ :type key_name: str
+ :param parameters: The parameters to import a key.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ async def delete_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.DeletedKeyBundle":
+ """Deletes a key of any type from storage in Azure Key Vault.
+
+ The delete key operation cannot be used to remove individual versions of a key. This operation
+ removes the cryptographic material associated with the key, which means the key is not usable
+ for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
+ keys/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to delete.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ async def update_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyUpdateParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
+
+ In order to perform this operation, the key must already exist in the Key Vault. Note: The
+ cryptographic material of a key itself cannot be changed. This operation requires the
+ keys/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of key to update.
+ :type key_name: str
+ :param key_version: The version of the key to update.
+ :type key_version: str
+ :param parameters: The parameters of the key to update.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ async def get_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Gets the public part of a stored key.
+
+ The get key operation is applicable to all key types. If the requested key is symmetric, then
+ no key material is released in the response. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to get.
+ :type key_name: str
+ :param key_version: Adding the version parameter retrieves a specific version of a key. This
+ URI fragment is optional. If not specified, the latest version of the key is returned.
+ :type key_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key_versions(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.KeyListResult"]:
+ """Retrieves a list of individual key versions with the same key name.
+
+ The full key identifier, attributes, and tags are provided in the response. This operation
+ requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_key_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_key_versions.metadata = {'url': '/keys/{key-name}/versions'} # type: ignore
+
+ def get_keys(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.KeyListResult"]:
+ """List keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a stored key. The LIST operation is applicable to all key types, however only
+ the base key identifier, attributes, and tags are provided in the response. Individual versions
+ of a key are not listed in the response. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_keys.metadata = {'url': '/keys'} # type: ignore
+
+ async def backup_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.BackupKeyResult":
+ """Requests that a backup of the specified key be downloaded to the client.
+
+ The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this
+ operation does NOT return key material in a form that can be used outside the Azure Key Vault
+ system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key
+ Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
+ Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.
+ The BACKUP operation may be used to export, in protected form, any key type from Azure Key
+ Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed
+ within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be
+ restored to another geographical area. For example, a backup from the US geographical area
+ cannot be restored in an EU geographical area. This operation requires the key/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupKeyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupKeyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupKeyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.backup_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupKeyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_key.metadata = {'url': '/keys/{key-name}/backup'} # type: ignore
+
+ async def restore_key(
+ self,
+ vault_base_url: str,
+ parameters: "models.KeyRestoreParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Restores a backed up key to a vault.
+
+ Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
+ attributes and access control policies. The RESTORE operation may be used to import a
+ previously backed up key. Individual versions of a key cannot be restored. The key is restored
+ in its entirety with the same key name as it had when it was backed up. If the key name is not
+ available in the target Key Vault, the RESTORE operation will be rejected. While the key name
+ is retained during restore, the final key identifier will change if the key is restored to a
+ different vault. Restore will restore all versions and preserve version identifiers. The
+ RESTORE operation is subject to security constraints: The target Key Vault must be owned by the
+ same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission
+ in the target Key Vault. This operation requires the keys/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the key.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_key.metadata = {'url': '/keys/restore'} # type: ignore
+
+ async def encrypt(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
+
+ The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
+ stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of
+ data, the size of which is dependent on the target key and the encryption algorithm to be used.
+ The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
+ since protection with an asymmetric key can be performed using public portion of the key. This
+ operation is supported for asymmetric keys as a convenience for callers that have a key-
+ reference but do not have access to the public key material. This operation requires the
+ keys/encrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the encryption operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.encrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'} # type: ignore
+
+ async def decrypt(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Decrypts a single block of encrypted data.
+
+ The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption
+ key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a
+ single block of data may be decrypted, the size of this block is dependent on the target key
+ and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys
+ stored in Azure Key Vault since it uses the private portion of the key. This operation requires
+ the keys/decrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the decryption operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.decrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'} # type: ignore
+
+ async def sign(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeySignParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Creates a signature from a digest using the specified key.
+
+ The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault
+ since this operation uses the private portion of the key. This operation requires the keys/sign
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the signing operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeySignParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.sign.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeySignParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'} # type: ignore
+
+ async def verify(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyVerifyParameters",
+ **kwargs
+ ) -> "models.KeyVerifyResult":
+ """Verifies a signature using a specified key.
+
+ The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not
+ strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification
+ can be performed using the public portion of the key but this operation is supported as a
+ convenience for callers that only have a key-reference and not the public portion of the key.
+ This operation requires the keys/verify permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for verify operations.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyVerifyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyVerifyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyVerifyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyVerifyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.verify.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyVerifyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'} # type: ignore
+
+ async def wrap_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Wraps a symmetric key using a specified key.
+
+ The WRAP operation supports encryption of a symmetric key using a key encryption key that has
+ previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for
+ symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be
+ performed using the public portion of the key. This operation is supported for asymmetric keys
+ as a convenience for callers that have a key-reference but do not have access to the public key
+ material. This operation requires the keys/wrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for wrap operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.wrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'} # type: ignore
+
+ async def unwrap_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
+
+ The UNWRAP operation supports decryption of a symmetric key using the target key encryption
+ key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to
+ asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of
+ the key. This operation requires the keys/unwrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the key operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.unwrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'} # type: ignore
+
+ def get_deleted_keys(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedKeyListResult"]:
+ """Lists the deleted keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a deleted key. This operation includes deletion-specific information. The Get
+ Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedKeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedKeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_keys.metadata = {'url': '/deletedkeys'} # type: ignore
+
+ async def get_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.DeletedKeyBundle":
+ """Gets the public part of a deleted key.
+
+ The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ async def purge_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified key.
+
+ The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the
+ operation can be invoked on any vault, it will return an error if invoked on a non soft-delete
+ enabled vault. This operation requires the keys/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.purge_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ async def recover_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Recovers the deleted key to its latest version.
+
+ The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.
+ It recovers the deleted key back to its latest version under /keys. An attempt to recover an
+ non-deleted key will return an error. Consider this the inverse of the delete operation on
+ soft-delete enabled vaults. This operation requires the keys/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the deleted key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'} # type: ignore
+
+ async def set_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ parameters: "models.SecretSetParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Sets a secret in a specified key vault.
+
+ The SET operation adds a secret to the Azure Key Vault. If the named secret already exists,
+ Azure Key Vault creates a new version of that secret. This operation requires the secrets/set
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param parameters: The parameters for setting the secret.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretSetParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_secret.metadata = {'url': '/secrets/{secret-name}'} # type: ignore
+
+ async def delete_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.DeletedSecretBundle":
+ """Deletes a secret from a specified key vault.
+
+ The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied
+ to an individual version of a secret. This operation requires the secrets/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_secret.metadata = {'url': '/secrets/{secret-name}'} # type: ignore
+
+ async def update_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ secret_version: str,
+ parameters: "models.SecretUpdateParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Updates the attributes associated with a specified secret in a given key vault.
+
+ The UPDATE operation changes specified attributes of an existing stored secret. Attributes that
+ are not specified in the request are left unchanged. The value of a secret itself cannot be
+ changed. This operation requires the secrets/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret.
+ :type secret_version: str
+ :param parameters: The parameters for update secret operation.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ 'secret-version': self._serialize.url("secret_version", secret_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} # type: ignore
+
+ async def get_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ secret_version: str,
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Get a specified secret from a given key vault.
+
+ The GET operation is applicable to any secret stored in Azure Key Vault. This operation
+ requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret. This URI fragment is optional. If not
+ specified, the latest version of the secret is returned.
+ :type secret_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ 'secret-version': self._serialize.url("secret_version", secret_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} # type: ignore
+
+ def get_secrets(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.SecretListResult"]:
+ """List secrets in a specified key vault.
+
+ The Get Secrets operation is applicable to the entire vault. However, only the base secret
+ identifier and its attributes are provided in the response. Individual secret versions are not
+ listed in the response. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_secrets.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('SecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_secrets.metadata = {'url': '/secrets'} # type: ignore
+
+ def get_secret_versions(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.SecretListResult"]:
+ """List all versions of the specified secret.
+
+ The full secret identifier and attributes are provided in the response. No values are returned
+ for the secrets. This operations requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_secret_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('SecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_secret_versions.metadata = {'url': '/secrets/{secret-name}/versions'} # type: ignore
+
+ def get_deleted_secrets(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedSecretListResult"]:
+ """Lists deleted secrets for the specified vault.
+
+ The Get Deleted Secrets operation returns the secrets that have been deleted for a vault
+ enabled for soft-delete. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedSecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_secrets.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedSecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_secrets.metadata = {'url': '/deletedsecrets'} # type: ignore
+
+ async def get_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.DeletedSecretBundle":
+ """Gets the specified deleted secret.
+
+ The Get Deleted Secret operation returns the specified deleted secret along with its
+ attributes. This operation requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} # type: ignore
+
+ async def purge_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified secret.
+
+ The purge deleted secret operation removes the secret permanently, without the possibility of
+ recovery. This operation can only be enabled on a soft-delete enabled vault. This operation
+ requires the secrets/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.purge_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} # type: ignore
+
+ async def recover_deleted_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Recovers the deleted secret to the latest version.
+
+ Recovers the deleted secret in the specified vault. This operation can only be performed on a
+ soft-delete enabled vault. This operation requires the secrets/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the deleted secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}/recover'} # type: ignore
+
+ async def backup_secret(
+ self,
+ vault_base_url: str,
+ secret_name: str,
+ **kwargs
+ ) -> "models.BackupSecretResult":
+ """Backs up the specified secret.
+
+ Requests that a backup of the specified secret be downloaded to the client. All versions of the
+ secret will be downloaded. This operation requires the secrets/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupSecretResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupSecretResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupSecretResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.backup_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupSecretResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_secret.metadata = {'url': '/secrets/{secret-name}/backup'} # type: ignore
+
+ async def restore_secret(
+ self,
+ vault_base_url: str,
+ parameters: "models.SecretRestoreParameters",
+ **kwargs
+ ) -> "models.SecretBundle":
+ """Restores a backed up secret to a vault.
+
+ Restores a backed up secret, and all its versions, to a vault. This operation requires the
+ secrets/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the secret.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_secret.metadata = {'url': '/secrets/restore'} # type: ignore
+
+ def get_certificates(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ include_pending: Optional[bool] = None,
+ **kwargs
+ ) -> AsyncIterable["models.CertificateListResult"]:
+ """List certificates in a specified key vault.
+
+ The GetCertificates operation returns the set of certificates resources in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :param include_pending: Specifies whether to include certificates which are not completely
+ provisioned.
+ :type include_pending: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificates.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ if include_pending is not None:
+ query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool')
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_certificates.metadata = {'url': '/certificates'} # type: ignore
+
+ async def delete_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.DeletedCertificateBundle":
+ """Deletes a certificate from a specified key vault.
+
+ Deletes all versions of a certificate object along with its associated policy. Delete
+ certificate cannot be used to remove individual versions of a certificate object. This
+ operation requires the certificates/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedCertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate.metadata = {'url': '/certificates/{certificate-name}'} # type: ignore
+
+ async def set_certificate_contacts(
+ self,
+ vault_base_url: str,
+ contacts: "models.Contacts",
+ **kwargs
+ ) -> "models.Contacts":
+ """Sets the certificate contacts for the specified key vault.
+
+ Sets the certificate contacts for the specified key vault. This operation requires the
+ certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param contacts: The contacts for the key vault certificate.
+ :type contacts: ~azure.keyvault.v7_0.models.Contacts
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(contacts, 'Contacts')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ async def get_certificate_contacts(
+ self,
+ vault_base_url: str,
+ **kwargs
+ ) -> "models.Contacts":
+ """Lists the certificate contacts for a specified key vault.
+
+ The GetCertificateContacts operation returns the set of certificate contact resources in the
+ specified key vault. This operation requires the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ async def delete_certificate_contacts(
+ self,
+ vault_base_url: str,
+ **kwargs
+ ) -> "models.Contacts":
+ """Deletes the certificate contacts for a specified key vault.
+
+ Deletes the certificate contacts for a specified key vault certificate. This operation requires
+ the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ def get_certificate_issuers(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.CertificateIssuerListResult"]:
+ """List certificate issuers for a specified key vault.
+
+ The GetCertificateIssuers operation returns the set of certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateIssuerListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateIssuerListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificate_issuers.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateIssuerListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_certificate_issuers.metadata = {'url': '/certificates/issuers'} # type: ignore
+
+ async def set_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ parameter: "models.CertificateIssuerSetParameters",
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Sets the specified certificate issuer.
+
+ The SetCertificateIssuer operation adds or updates the specified certificate issuer. This
+ operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer set parameter.
+ :type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameter, 'CertificateIssuerSetParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ async def update_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ parameter: "models.CertificateIssuerUpdateParameters",
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Updates the specified certificate issuer.
+
+ The UpdateCertificateIssuer operation performs an update on the specified certificate issuer
+ entity. This operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer update parameter.
+ :type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameter, 'CertificateIssuerUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ async def get_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Lists the specified certificate issuer.
+
+ The GetCertificateIssuer operation returns the specified certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ async def delete_certificate_issuer(
+ self,
+ vault_base_url: str,
+ issuer_name: str,
+ **kwargs
+ ) -> "models.IssuerBundle":
+ """Deletes the specified certificate issuer.
+
+ The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from
+ the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ async def create_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateCreateParameters",
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Creates a new certificate.
+
+ If this is the first version, the certificate resource is created. This operation requires the
+ certificates/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to create a certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_certificate.metadata = {'url': '/certificates/{certificate-name}/create'} # type: ignore
+
+ async def import_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateImportParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Imports a certificate into a specified key vault.
+
+ Imports an existing valid certificate, containing a private key, into Azure Key Vault. The
+ certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM
+ format the PEM file must contain the key as well as x509 certificates. This operation requires
+ the certificates/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to import the certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_certificate.metadata = {'url': '/certificates/{certificate-name}/import'} # type: ignore
+
+ def get_certificate_versions(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.CertificateListResult"]:
+ """List the versions of a certificate.
+
+ The GetCertificateVersions operation returns the versions of a certificate in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificate_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_certificate_versions.metadata = {'url': '/certificates/{certificate-name}/versions'} # type: ignore
+
+ async def get_certificate_policy(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificatePolicy":
+ """Lists the policy for a certificate.
+
+ The GetCertificatePolicy operation returns the specified certificate policy resources in the
+ specified key vault. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in a given key vault.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificatePolicy"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificatePolicy', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} # type: ignore
+
+ async def update_certificate_policy(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_policy: "models.CertificatePolicy",
+ **kwargs
+ ) -> "models.CertificatePolicy":
+ """Updates the policy for a certificate.
+
+ Set specified members in the certificate policy. Leave others as null. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_policy: The policy for the certificate.
+ :type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificatePolicy"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(certificate_policy, 'CertificatePolicy')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificatePolicy', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} # type: ignore
+
+ async def update_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_version: str,
+ parameters: "models.CertificateUpdateParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Updates the specified attributes associated with the given certificate.
+
+ The UpdateCertificate operation applies the specified update on the given certificate; the only
+ elements updated are the certificate's attributes. This operation requires the
+ certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given key vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate.
+ :type certificate_version: str
+ :param parameters: The parameters for certificate update.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} # type: ignore
+
+ async def get_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_version: str,
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Gets information about a certificate.
+
+ Gets information about a specific certificate. This operation requires the certificates/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate. This URI fragment is optional. If
+ not specified, the latest version of the certificate is returned.
+ :type certificate_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} # type: ignore
+
+ async def update_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ certificate_operation: "models.CertificateOperationUpdateParameter",
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Updates a certificate operation.
+
+ Updates a certificate creation operation that is already in progress. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param certificate_operation: The certificate operation response.
+ :type certificate_operation: ~azure.keyvault.v7_0.models.CertificateOperationUpdateParameter
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(certificate_operation, 'CertificateOperationUpdateParameter')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ async def get_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Gets the creation operation of a certificate.
+
+ Gets the creation operation associated with a specified certificate. This operation requires
+ the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ async def delete_certificate_operation(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateOperation":
+ """Deletes the creation operation for a specific certificate.
+
+ Deletes the creation operation for a specified certificate that is in the process of being
+ created. The certificate is no longer created. This operation requires the certificates/update
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ async def merge_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ parameters: "models.CertificateMergeParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Merges a certificate or a certificate chain with a key pair existing on the server.
+
+ The MergeCertificate operation performs the merging of a certificate or certificate chain with
+ a key pair currently available in the service. This operation requires the certificates/create
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to merge certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateMergeParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.merge_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateMergeParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'} # type: ignore
+
+ async def backup_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.BackupCertificateResult":
+ """Backs up the specified certificate.
+
+ Requests that a backup of the specified certificate be downloaded to the client. All versions
+ of the certificate will be downloaded. This operation requires the certificates/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupCertificateResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupCertificateResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupCertificateResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.backup_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupCertificateResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_certificate.metadata = {'url': '/certificates/{certificate-name}/backup'} # type: ignore
+
+ async def restore_certificate(
+ self,
+ vault_base_url: str,
+ parameters: "models.CertificateRestoreParameters",
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Restores a backed up certificate to a vault.
+
+ Restores a backed up certificate, and all its versions, to a vault. This operation requires the
+ certificates/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_certificate.metadata = {'url': '/certificates/restore'} # type: ignore
+
+ def get_deleted_certificates(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ include_pending: Optional[bool] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedCertificateListResult"]:
+ """Lists the deleted certificates in the specified vault currently available for recovery.
+
+ The GetDeletedCertificates operation retrieves the certificates in the current vault which are
+ in a deleted state and ready for recovery or purging. This operation includes deletion-specific
+ information. This operation requires the certificates/get/list permission. This operation can
+ only be enabled on soft-delete enabled vaults.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :param include_pending: Specifies whether to include certificates which are not completely
+ provisioned.
+ :type include_pending: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedCertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_certificates.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ if include_pending is not None:
+ query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool')
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedCertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_certificates.metadata = {'url': '/deletedcertificates'} # type: ignore
+
+ async def get_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.DeletedCertificateBundle":
+ """Retrieves information about the specified deleted certificate.
+
+ The GetDeletedCertificate operation retrieves the deleted certificate information plus its
+ attributes, such as retention interval, scheduled permanent deletion and the current deletion
+ recovery level. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedCertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} # type: ignore
+
+ async def purge_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified deleted certificate.
+
+ The PurgeDeletedCertificate operation performs an irreversible deletion of the specified
+ certificate, without possibility for recovery. The operation is not available if the recovery
+ level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.purge_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} # type: ignore
+
+ async def recover_deleted_certificate(
+ self,
+ vault_base_url: str,
+ certificate_name: str,
+ **kwargs
+ ) -> "models.CertificateBundle":
+ """Recovers the deleted certificate back to its current version under /certificates.
+
+ The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The
+ operation is applicable in vaults enabled for soft-delete, and must be issued during the
+ retention interval (available in the deleted certificate's attributes). This operation requires
+ the certificates/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the deleted certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}/recover'} # type: ignore
+
+ def get_storage_accounts(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.StorageListResult"]:
+ """List storage accounts managed by the specified key vault. This operation requires the
+ storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either StorageListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.StorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_storage_accounts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('StorageListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_storage_accounts.metadata = {'url': '/storage'} # type: ignore
+
+ def get_deleted_storage_accounts(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedStorageListResult"]:
+ """Lists deleted storage accounts for the specified vault.
+
+ The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted
+ for a vault enabled for soft-delete. This operation requires the storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedStorageListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedStorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedStorageListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_storage_accounts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedStorageListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_storage_accounts.metadata = {'url': '/deletedstorage'} # type: ignore
+
+ async def get_deleted_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.DeletedStorageBundle":
+ """Gets the specified deleted storage account.
+
+ The Get Deleted Storage Account operation returns the specified deleted storage account along
+ with its attributes. This operation requires the storage/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedStorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedStorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedStorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} # type: ignore
+
+ async def purge_deleted_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified storage account.
+
+ The purge deleted storage account operation removes the secret permanently, without the
+ possibility of recovery. This operation can only be performed on a soft-delete enabled vault.
+ This operation requires the storage/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.purge_deleted_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} # type: ignore
+
+ async def recover_deleted_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Recovers the deleted storage account.
+
+ Recovers the deleted storage account in the specified vault. This operation can only be
+ performed on a soft-delete enabled vault. This operation requires the storage/recover
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}/recover'} # type: ignore
+
+ async def backup_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.BackupStorageResult":
+ """Backs up the specified storage account.
+
+ Requests that a backup of the specified storage account be downloaded to the client. This
+ operation requires the storage/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupStorageResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupStorageResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupStorageResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.backup_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupStorageResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_storage_account.metadata = {'url': '/storage/{storage-account-name}/backup'} # type: ignore
+
+ async def restore_storage_account(
+ self,
+ vault_base_url: str,
+ parameters: "models.StorageRestoreParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Restores a backed up storage account to a vault.
+
+ Restores a backed up storage account to a vault. This operation requires the storage/restore
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_storage_account.metadata = {'url': '/storage/restore'} # type: ignore
+
+ async def delete_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.DeletedStorageBundle":
+ """Deletes a storage account. This operation requires the storage/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedStorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedStorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedStorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ async def get_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Gets information about a specified storage account. This operation requires the storage/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ async def set_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountCreateParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Creates or updates a new storage account. This operation requires the storage/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to create a storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ async def update_storage_account(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountUpdateParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Updates the specified attributes associated with the given storage account. This operation
+ requires the storage/set/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to update a storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ async def regenerate_storage_account_key(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ parameters: "models.StorageAccountRegenerteKeyParameters",
+ **kwargs
+ ) -> "models.StorageBundle":
+ """Regenerates the specified key value for the given storage account. This operation requires the
+ storage/regeneratekey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to regenerate storage account key.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountRegenerteKeyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.regenerate_storage_account_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountRegenerteKeyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ regenerate_storage_account_key.metadata = {'url': '/storage/{storage-account-name}/regeneratekey'} # type: ignore
+
+ def get_sas_definitions(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.SasDefinitionListResult"]:
+ """List storage SAS definitions for the given storage account. This operation requires the
+ storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_sas_definitions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('SasDefinitionListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_sas_definitions.metadata = {'url': '/storage/{storage-account-name}/sas'} # type: ignore
+
+ def get_deleted_sas_definitions(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedSasDefinitionListResult"]:
+ """Lists deleted SAS definitions for the specified vault and storage account.
+
+ The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted
+ for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedSasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSasDefinitionListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_sas_definitions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedSasDefinitionListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_sas_definitions.metadata = {'url': '/deletedstorage/{storage-account-name}/sas'} # type: ignore
+
+ async def get_deleted_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.DeletedSasDefinitionBundle":
+ """Gets the specified deleted sas definition.
+
+ The Get Deleted SAS Definition operation returns the specified deleted SAS definition along
+ with its attributes. This operation requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_sas_definition.metadata = {'url': '/deletedstorage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ async def recover_deleted_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Recovers the deleted SAS definition.
+
+ Recovers the deleted SAS definition for the specified storage account. This operation can only
+ be performed on a soft-delete enabled vault. This operation requires the storage/recover
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_sas_definition.metadata = {'url': '/deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover'} # type: ignore
+
+ async def delete_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.DeletedSasDefinitionBundle":
+ """Deletes a SAS definition from a specified storage account. This operation requires the
+ storage/deletesas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ async def get_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Gets information about a SAS definition for the specified storage account. This operation
+ requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ async def set_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ parameters: "models.SasDefinitionCreateParameters",
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Creates or updates a new SAS definition for the specified storage account. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to create a SAS definition.
+ :type parameters: ~azure.keyvault.v7_0.models.SasDefinitionCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SasDefinitionCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ async def update_sas_definition(
+ self,
+ vault_base_url: str,
+ storage_account_name: str,
+ sas_definition_name: str,
+ parameters: "models.SasDefinitionUpdateParameters",
+ **kwargs
+ ) -> "models.SasDefinitionBundle":
+ """Updates the specified attributes associated with the given SAS definition. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to update a SAS definition.
+ :type parameters: ~azure.keyvault.v7_0.models.SasDefinitionUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SasDefinitionUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/__init__.py
similarity index 58%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/__init__.py
index 5e72f49a73f6..433900a34cfd 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
try:
@@ -68,7 +65,7 @@
from ._models_py3 import KeyRestoreParameters
from ._models_py3 import KeySignParameters
from ._models_py3 import KeyUpdateParameters
- from ._models_py3 import KeyVaultError, KeyVaultErrorException
+ from ._models_py3 import KeyVaultError
from ._models_py3 import KeyVerifyParameters
from ._models_py3 import KeyVerifyResult
from ._models_py3 import LifetimeAction
@@ -100,104 +97,105 @@
from ._models_py3 import Trigger
from ._models_py3 import X509CertificateProperties
except (SyntaxError, ImportError):
- from ._models import Action
- from ._models import AdministratorDetails
- from ._models import Attributes
- from ._models import BackupCertificateResult
- from ._models import BackupKeyResult
- from ._models import BackupSecretResult
- from ._models import BackupStorageResult
- from ._models import CertificateAttributes
- from ._models import CertificateBundle
- from ._models import CertificateCreateParameters
- from ._models import CertificateImportParameters
- from ._models import CertificateIssuerItem
- from ._models import CertificateIssuerListResult
- from ._models import CertificateIssuerSetParameters
- from ._models import CertificateIssuerUpdateParameters
- from ._models import CertificateItem
- from ._models import CertificateListResult
- from ._models import CertificateMergeParameters
- from ._models import CertificateOperation
- from ._models import CertificateOperationUpdateParameter
- from ._models import CertificatePolicy
- from ._models import CertificateRestoreParameters
- from ._models import CertificateUpdateParameters
- from ._models import Contact
- from ._models import Contacts
- from ._models import DeletedCertificateBundle
- from ._models import DeletedCertificateItem
- from ._models import DeletedCertificateListResult
- from ._models import DeletedKeyBundle
- from ._models import DeletedKeyItem
- from ._models import DeletedKeyListResult
- from ._models import DeletedSasDefinitionBundle
- from ._models import DeletedSasDefinitionItem
- from ._models import DeletedSasDefinitionListResult
- from ._models import DeletedSecretBundle
- from ._models import DeletedSecretItem
- from ._models import DeletedSecretListResult
- from ._models import DeletedStorageAccountItem
- from ._models import DeletedStorageBundle
- from ._models import DeletedStorageListResult
- from ._models import Error
- from ._models import IssuerAttributes
- from ._models import IssuerBundle
- from ._models import IssuerCredentials
- from ._models import IssuerParameters
- from ._models import JsonWebKey
- from ._models import KeyAttributes
- from ._models import KeyBundle
- from ._models import KeyCreateParameters
- from ._models import KeyImportParameters
- from ._models import KeyItem
- from ._models import KeyListResult
- from ._models import KeyOperationResult
- from ._models import KeyOperationsParameters
- from ._models import KeyProperties
- from ._models import KeyRestoreParameters
- from ._models import KeySignParameters
- from ._models import KeyUpdateParameters
- from ._models import KeyVaultError, KeyVaultErrorException
- from ._models import KeyVerifyParameters
- from ._models import KeyVerifyResult
- from ._models import LifetimeAction
- from ._models import OrganizationDetails
- from ._models import PendingCertificateSigningRequestResult
- from ._models import SasDefinitionAttributes
- from ._models import SasDefinitionBundle
- from ._models import SasDefinitionCreateParameters
- from ._models import SasDefinitionItem
- from ._models import SasDefinitionListResult
- from ._models import SasDefinitionUpdateParameters
- from ._models import SecretAttributes
- from ._models import SecretBundle
- from ._models import SecretItem
- from ._models import SecretListResult
- from ._models import SecretProperties
- from ._models import SecretRestoreParameters
- from ._models import SecretSetParameters
- from ._models import SecretUpdateParameters
- from ._models import StorageAccountAttributes
- from ._models import StorageAccountCreateParameters
- from ._models import StorageAccountItem
- from ._models import StorageAccountRegenerteKeyParameters
- from ._models import StorageAccountUpdateParameters
- from ._models import StorageBundle
- from ._models import StorageListResult
- from ._models import StorageRestoreParameters
- from ._models import SubjectAlternativeNames
- from ._models import Trigger
- from ._models import X509CertificateProperties
+ from ._models import Action # type: ignore
+ from ._models import AdministratorDetails # type: ignore
+ from ._models import Attributes # type: ignore
+ from ._models import BackupCertificateResult # type: ignore
+ from ._models import BackupKeyResult # type: ignore
+ from ._models import BackupSecretResult # type: ignore
+ from ._models import BackupStorageResult # type: ignore
+ from ._models import CertificateAttributes # type: ignore
+ from ._models import CertificateBundle # type: ignore
+ from ._models import CertificateCreateParameters # type: ignore
+ from ._models import CertificateImportParameters # type: ignore
+ from ._models import CertificateIssuerItem # type: ignore
+ from ._models import CertificateIssuerListResult # type: ignore
+ from ._models import CertificateIssuerSetParameters # type: ignore
+ from ._models import CertificateIssuerUpdateParameters # type: ignore
+ from ._models import CertificateItem # type: ignore
+ from ._models import CertificateListResult # type: ignore
+ from ._models import CertificateMergeParameters # type: ignore
+ from ._models import CertificateOperation # type: ignore
+ from ._models import CertificateOperationUpdateParameter # type: ignore
+ from ._models import CertificatePolicy # type: ignore
+ from ._models import CertificateRestoreParameters # type: ignore
+ from ._models import CertificateUpdateParameters # type: ignore
+ from ._models import Contact # type: ignore
+ from ._models import Contacts # type: ignore
+ from ._models import DeletedCertificateBundle # type: ignore
+ from ._models import DeletedCertificateItem # type: ignore
+ from ._models import DeletedCertificateListResult # type: ignore
+ from ._models import DeletedKeyBundle # type: ignore
+ from ._models import DeletedKeyItem # type: ignore
+ from ._models import DeletedKeyListResult # type: ignore
+ from ._models import DeletedSasDefinitionBundle # type: ignore
+ from ._models import DeletedSasDefinitionItem # type: ignore
+ from ._models import DeletedSasDefinitionListResult # type: ignore
+ from ._models import DeletedSecretBundle # type: ignore
+ from ._models import DeletedSecretItem # type: ignore
+ from ._models import DeletedSecretListResult # type: ignore
+ from ._models import DeletedStorageAccountItem # type: ignore
+ from ._models import DeletedStorageBundle # type: ignore
+ from ._models import DeletedStorageListResult # type: ignore
+ from ._models import Error # type: ignore
+ from ._models import IssuerAttributes # type: ignore
+ from ._models import IssuerBundle # type: ignore
+ from ._models import IssuerCredentials # type: ignore
+ from ._models import IssuerParameters # type: ignore
+ from ._models import JsonWebKey # type: ignore
+ from ._models import KeyAttributes # type: ignore
+ from ._models import KeyBundle # type: ignore
+ from ._models import KeyCreateParameters # type: ignore
+ from ._models import KeyImportParameters # type: ignore
+ from ._models import KeyItem # type: ignore
+ from ._models import KeyListResult # type: ignore
+ from ._models import KeyOperationResult # type: ignore
+ from ._models import KeyOperationsParameters # type: ignore
+ from ._models import KeyProperties # type: ignore
+ from ._models import KeyRestoreParameters # type: ignore
+ from ._models import KeySignParameters # type: ignore
+ from ._models import KeyUpdateParameters # type: ignore
+ from ._models import KeyVaultError # type: ignore
+ from ._models import KeyVerifyParameters # type: ignore
+ from ._models import KeyVerifyResult # type: ignore
+ from ._models import LifetimeAction # type: ignore
+ from ._models import OrganizationDetails # type: ignore
+ from ._models import PendingCertificateSigningRequestResult # type: ignore
+ from ._models import SasDefinitionAttributes # type: ignore
+ from ._models import SasDefinitionBundle # type: ignore
+ from ._models import SasDefinitionCreateParameters # type: ignore
+ from ._models import SasDefinitionItem # type: ignore
+ from ._models import SasDefinitionListResult # type: ignore
+ from ._models import SasDefinitionUpdateParameters # type: ignore
+ from ._models import SecretAttributes # type: ignore
+ from ._models import SecretBundle # type: ignore
+ from ._models import SecretItem # type: ignore
+ from ._models import SecretListResult # type: ignore
+ from ._models import SecretProperties # type: ignore
+ from ._models import SecretRestoreParameters # type: ignore
+ from ._models import SecretSetParameters # type: ignore
+ from ._models import SecretUpdateParameters # type: ignore
+ from ._models import StorageAccountAttributes # type: ignore
+ from ._models import StorageAccountCreateParameters # type: ignore
+ from ._models import StorageAccountItem # type: ignore
+ from ._models import StorageAccountRegenerteKeyParameters # type: ignore
+ from ._models import StorageAccountUpdateParameters # type: ignore
+ from ._models import StorageBundle # type: ignore
+ from ._models import StorageListResult # type: ignore
+ from ._models import StorageRestoreParameters # type: ignore
+ from ._models import SubjectAlternativeNames # type: ignore
+ from ._models import Trigger # type: ignore
+ from ._models import X509CertificateProperties # type: ignore
+
from ._key_vault_client_enums import (
- JsonWebKeyType,
- JsonWebKeyCurveName,
- DeletionRecoveryLevel,
- KeyUsageType,
ActionType,
- JsonWebKeyOperation,
+ DeletionRecoveryLevel,
+ JsonWebKeyCurveName,
JsonWebKeyEncryptionAlgorithm,
+ JsonWebKeyOperation,
JsonWebKeySignatureAlgorithm,
+ JsonWebKeyType,
+ KeyUsageType,
SasTokenType,
)
@@ -260,7 +258,7 @@
'KeyRestoreParameters',
'KeySignParameters',
'KeyUpdateParameters',
- 'KeyVaultError', 'KeyVaultErrorException',
+ 'KeyVaultError',
'KeyVerifyParameters',
'KeyVerifyResult',
'LifetimeAction',
@@ -291,13 +289,13 @@
'SubjectAlternativeNames',
'Trigger',
'X509CertificateProperties',
- 'JsonWebKeyType',
- 'JsonWebKeyCurveName',
- 'DeletionRecoveryLevel',
- 'KeyUsageType',
'ActionType',
- 'JsonWebKeyOperation',
+ 'DeletionRecoveryLevel',
+ 'JsonWebKeyCurveName',
'JsonWebKeyEncryptionAlgorithm',
+ 'JsonWebKeyOperation',
'JsonWebKeySignatureAlgorithm',
+ 'JsonWebKeyType',
+ 'KeyUsageType',
'SasTokenType',
]
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_key_vault_client_enums.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_key_vault_client_enums.py
new file mode 100644
index 000000000000..679bdead49e6
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_key_vault_client_enums.py
@@ -0,0 +1,123 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from enum import Enum, EnumMeta
+from six import with_metaclass
+
+class _CaseInsensitiveEnumMeta(EnumMeta):
+ def __getitem__(self, name):
+ return super().__getitem__(name.upper())
+
+ def __getattr__(cls, name):
+ """Return the enum member matching `name`
+ We use __getattr__ instead of descriptors or inserting into the enum
+ class' __dict__ in order to support `name` and `value` being both
+ properties for enum members (which live in the class' __dict__) and
+ enum members themselves.
+ """
+ try:
+ return cls._member_map_[name.upper()]
+ except KeyError:
+ raise AttributeError(name)
+
+
+class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The type of the action.
+ """
+
+ EMAIL_CONTACTS = "EmailContacts"
+ AUTO_RENEW = "AutoRenew"
+
+class DeletionRecoveryLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """Reflects the deletion recovery level currently in effect for keys in the current vault. If it
+ contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only
+ the system can purge the key, at the end of the retention interval.
+ """
+
+ PURGEABLE = "Purgeable" #: Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.).
+ RECOVERABLE_PURGEABLE = "Recoverable+Purgeable" #: Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered.
+ RECOVERABLE = "Recoverable" #: Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not recovered.
+ RECOVERABLE_PROTECTED_SUBSCRIPTION = "Recoverable+ProtectedSubscription" #: Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered.
+ CUSTOMIZED_RECOVERABLE_PURGEABLE = "CustomizedRecoverable+Purgeable" #: Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription is cancelled.
+ CUSTOMIZED_RECOVERABLE = "CustomizedRecoverable" #: Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval and while the subscription is still available.
+ CUSTOMIZED_RECOVERABLE_PROTECTED_SUBSCRIPTION = "CustomizedRecoverable+ProtectedSubscription" #: Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7<= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled.
+
+class JsonWebKeyCurveName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """Elliptic curve name. For valid values, see JsonWebKeyCurveName.
+ """
+
+ P256 = "P-256" #: The NIST P-256 elliptic curve, AKA SECG curve SECP256R1.
+ P384 = "P-384" #: The NIST P-384 elliptic curve, AKA SECG curve SECP384R1.
+ P521 = "P-521" #: The NIST P-521 elliptic curve, AKA SECG curve SECP521R1.
+ P256_K = "P-256K" #: The SECG SECP256K1 elliptic curve.
+
+class JsonWebKeyEncryptionAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """algorithm identifier
+ """
+
+ RSA_OAEP = "RSA-OAEP"
+ RSA_OAEP256 = "RSA-OAEP-256"
+ RSA1_5 = "RSA1_5"
+
+class JsonWebKeyOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """JSON web key operations. For more information, see JsonWebKeyOperation.
+ """
+
+ ENCRYPT = "encrypt"
+ DECRYPT = "decrypt"
+ SIGN = "sign"
+ VERIFY = "verify"
+ WRAP_KEY = "wrapKey"
+ UNWRAP_KEY = "unwrapKey"
+
+class JsonWebKeySignatureAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The signing/verification algorithm identifier. For more information on possible algorithm
+ types, see JsonWebKeySignatureAlgorithm.
+ """
+
+ PS256 = "PS256" #: RSASSA-PSS using SHA-256 and MGF1 with SHA-256, as described in https://tools.ietf.org/html/rfc7518.
+ PS384 = "PS384" #: RSASSA-PSS using SHA-384 and MGF1 with SHA-384, as described in https://tools.ietf.org/html/rfc7518.
+ PS512 = "PS512" #: RSASSA-PSS using SHA-512 and MGF1 with SHA-512, as described in https://tools.ietf.org/html/rfc7518.
+ RS256 = "RS256" #: RSASSA-PKCS1-v1_5 using SHA-256, as described in https://tools.ietf.org/html/rfc7518.
+ RS384 = "RS384" #: RSASSA-PKCS1-v1_5 using SHA-384, as described in https://tools.ietf.org/html/rfc7518.
+ RS512 = "RS512" #: RSASSA-PKCS1-v1_5 using SHA-512, as described in https://tools.ietf.org/html/rfc7518.
+ RSNULL = "RSNULL" #: Reserved.
+ ES256 = "ES256" #: ECDSA using P-256 and SHA-256, as described in https://tools.ietf.org/html/rfc7518.
+ ES384 = "ES384" #: ECDSA using P-384 and SHA-384, as described in https://tools.ietf.org/html/rfc7518.
+ ES512 = "ES512" #: ECDSA using P-521 and SHA-512, as described in https://tools.ietf.org/html/rfc7518.
+ ES256_K = "ES256K" #: ECDSA using P-256K and SHA-256, as described in https://tools.ietf.org/html/rfc7518.
+
+class JsonWebKeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-
+ algorithms-40.
+ """
+
+ EC = "EC" #: Elliptic Curve.
+ EC_HSM = "EC-HSM" #: Elliptic Curve with a private key which is not exportable from the HSM.
+ RSA = "RSA" #: RSA (https://tools.ietf.org/html/rfc3447).
+ RSA_HSM = "RSA-HSM" #: RSA with a private key which is not exportable from the HSM.
+ OCT = "oct" #: Octet sequence (used to represent symmetric keys).
+
+class KeyUsageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+
+ DIGITAL_SIGNATURE = "digitalSignature"
+ NON_REPUDIATION = "nonRepudiation"
+ KEY_ENCIPHERMENT = "keyEncipherment"
+ DATA_ENCIPHERMENT = "dataEncipherment"
+ KEY_AGREEMENT = "keyAgreement"
+ KEY_CERT_SIGN = "keyCertSign"
+ C_RL_SIGN = "cRLSign"
+ ENCIPHER_ONLY = "encipherOnly"
+ DECIPHER_ONLY = "decipherOnly"
+
+class SasTokenType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The type of SAS token the SAS definition will create.
+ """
+
+ ACCOUNT = "account"
+ SERVICE = "service"
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_models.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_models.py
similarity index 75%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_models.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_models.py
index 7ebc89403a3b..8eb695985210 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_models.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_models.py
@@ -1,36 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from msrest.serialization import Model
from azure.core.exceptions import HttpResponseError
+import msrest.serialization
-class Action(Model):
+class Action(msrest.serialization.Model):
"""The action that will be executed.
- :param action_type: The type of the action. Possible values include:
- 'EmailContacts', 'AutoRenew'
+ :param action_type: The type of the action. Possible values include: "EmailContacts",
+ "AutoRenew".
:type action_type: str or ~azure.keyvault.v7_0.models.ActionType
"""
_attribute_map = {
- 'action_type': {'key': 'action_type', 'type': 'ActionType'},
+ 'action_type': {'key': 'action_type', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Action, self).__init__(**kwargs)
self.action_type = kwargs.get('action_type', None)
-class AdministratorDetails(Model):
+class AdministratorDetails(msrest.serialization.Model):
"""Details of the organization administrator of the certificate issuer.
:param first_name: First name.
@@ -50,7 +50,10 @@ class AdministratorDetails(Model):
'phone': {'key': 'phone', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(AdministratorDetails, self).__init__(**kwargs)
self.first_name = kwargs.get('first_name', None)
self.last_name = kwargs.get('last_name', None)
@@ -58,22 +61,21 @@ def __init__(self, **kwargs):
self.phone = kwargs.get('phone', None)
-class Attributes(Model):
+class Attributes(msrest.serialization.Model):
"""The object attributes managed by the KeyVault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -89,7 +91,10 @@ class Attributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Attributes, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.not_before = kwargs.get('not_before', None)
@@ -98,11 +103,10 @@ def __init__(self, **kwargs):
self.updated = None
-class BackupCertificateResult(Model):
+class BackupCertificateResult(msrest.serialization.Model):
"""The backup certificate result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up certificate.
:vartype value: bytes
@@ -116,16 +120,18 @@ class BackupCertificateResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupCertificateResult, self).__init__(**kwargs)
self.value = None
-class BackupKeyResult(Model):
+class BackupKeyResult(msrest.serialization.Model):
"""The backup key result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up key.
:vartype value: bytes
@@ -139,16 +145,18 @@ class BackupKeyResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupKeyResult, self).__init__(**kwargs)
self.value = None
-class BackupSecretResult(Model):
+class BackupSecretResult(msrest.serialization.Model):
"""The backup secret result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up secret.
:vartype value: bytes
@@ -162,16 +170,18 @@ class BackupSecretResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupSecretResult, self).__init__(**kwargs)
self.value = None
-class BackupStorageResult(Model):
+class BackupStorageResult(msrest.serialization.Model):
"""The backup storage result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up storage account.
:vartype value: bytes
@@ -185,7 +195,10 @@ class BackupStorageResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupStorageResult, self).__init__(**kwargs)
self.value = None
@@ -193,28 +206,25 @@ def __init__(self, **kwargs):
class CertificateAttributes(Attributes):
"""The certificate management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for certificates in the current vault. If it contains 'Purgeable',
- the certificate can be permanently deleted by a privileged user;
- otherwise, only the system can purge the certificate, at the end of the
- retention interval. Possible values include: 'Purgeable',
- 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for certificates
+ in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by
+ a privileged user; otherwise, only the system can purge the certificate, at the end of the
+ retention interval. Possible values include: "Purgeable", "Recoverable+Purgeable",
+ "Recoverable", "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
+ "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -232,16 +242,18 @@ class CertificateAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateAttributes, self).__init__(**kwargs)
self.recovery_level = None
-class CertificateBundle(Model):
+class CertificateBundle(msrest.serialization.Model):
"""A certificate bundle consists of a certificate (X509) plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -259,7 +271,7 @@ class CertificateBundle(Model):
:type content_type: str
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -283,7 +295,10 @@ class CertificateBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateBundle, self).__init__(**kwargs)
self.id = None
self.kid = None
@@ -296,16 +311,14 @@ def __init__(self, **kwargs):
self.tags = kwargs.get('tags', None)
-class CertificateCreateParameters(Model):
+class CertificateCreateParameters(msrest.serialization.Model):
"""The certificate create parameters.
:param certificate_policy: The management policy for the certificate.
:type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -315,32 +328,32 @@ class CertificateCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateCreateParameters, self).__init__(**kwargs)
self.certificate_policy = kwargs.get('certificate_policy', None)
self.certificate_attributes = kwargs.get('certificate_attributes', None)
self.tags = kwargs.get('tags', None)
-class CertificateImportParameters(Model):
+class CertificateImportParameters(msrest.serialization.Model):
"""The certificate import parameters.
All required parameters must be populated in order to send to Azure.
- :param base64_encoded_certificate: Required. Base64 encoded representation
- of the certificate object to import. This certificate needs to contain the
- private key.
+ :param base64_encoded_certificate: Required. Base64 encoded representation of the certificate
+ object to import. This certificate needs to contain the private key.
:type base64_encoded_certificate: str
- :param password: If the private key in base64EncodedCertificate is
- encrypted, the password used for encryption.
+ :param password: If the private key in base64EncodedCertificate is encrypted, the password used
+ for encryption.
:type password: str
:param certificate_policy: The management policy for the certificate.
:type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -356,16 +369,19 @@ class CertificateImportParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateImportParameters, self).__init__(**kwargs)
- self.base64_encoded_certificate = kwargs.get('base64_encoded_certificate', None)
+ self.base64_encoded_certificate = kwargs['base64_encoded_certificate']
self.password = kwargs.get('password', None)
self.certificate_policy = kwargs.get('certificate_policy', None)
self.certificate_attributes = kwargs.get('certificate_attributes', None)
self.tags = kwargs.get('tags', None)
-class CertificateIssuerItem(Model):
+class CertificateIssuerItem(msrest.serialization.Model):
"""The certificate issuer item containing certificate issuer metadata.
:param id: Certificate Identifier.
@@ -379,21 +395,22 @@ class CertificateIssuerItem(Model):
'provider': {'key': 'provider', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerItem, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.provider = kwargs.get('provider', None)
-class CertificateIssuerListResult(Model):
+class CertificateIssuerListResult(msrest.serialization.Model):
"""The certificate issuer list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of certificate issuers
- in the key vault along with a link to the next page of certificate
- issuers.
+ :ivar value: A response message containing a list of certificate issuers in the key vault along
+ with a link to the next page of certificate issuers.
:vartype value: list[~azure.keyvault.v7_0.models.CertificateIssuerItem]
:ivar next_link: The URL to get the next set of certificate issuers.
:vartype next_link: str
@@ -409,13 +426,16 @@ class CertificateIssuerListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class CertificateIssuerSetParameters(Model):
+class CertificateIssuerSetParameters(msrest.serialization.Model):
"""The certificate issuer set parameters.
All required parameters must be populated in order to send to Azure.
@@ -424,10 +444,8 @@ class CertificateIssuerSetParameters(Model):
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v7_0.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v7_0.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v7_0.models.IssuerAttributes
"""
@@ -443,25 +461,26 @@ class CertificateIssuerSetParameters(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerSetParameters, self).__init__(**kwargs)
- self.provider = kwargs.get('provider', None)
+ self.provider = kwargs['provider']
self.credentials = kwargs.get('credentials', None)
self.organization_details = kwargs.get('organization_details', None)
self.attributes = kwargs.get('attributes', None)
-class CertificateIssuerUpdateParameters(Model):
+class CertificateIssuerUpdateParameters(msrest.serialization.Model):
"""The certificate issuer update parameters.
:param provider: The issuer provider.
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v7_0.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v7_0.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v7_0.models.IssuerAttributes
"""
@@ -473,7 +492,10 @@ class CertificateIssuerUpdateParameters(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerUpdateParameters, self).__init__(**kwargs)
self.provider = kwargs.get('provider', None)
self.credentials = kwargs.get('credentials', None)
@@ -481,14 +503,14 @@ def __init__(self, **kwargs):
self.attributes = kwargs.get('attributes', None)
-class CertificateItem(Model):
+class CertificateItem(msrest.serialization.Model):
"""The certificate item containing certificate metadata.
:param id: Certificate identifier.
:type id: str
:param attributes: The certificate management attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param x509_thumbprint: Thumbprint of the certificate.
:type x509_thumbprint: bytes
@@ -501,7 +523,10 @@ class CertificateItem(Model):
'x509_thumbprint': {'key': 'x5t', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateItem, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.attributes = kwargs.get('attributes', None)
@@ -509,14 +534,13 @@ def __init__(self, **kwargs):
self.x509_thumbprint = kwargs.get('x509_thumbprint', None)
-class CertificateListResult(Model):
+class CertificateListResult(msrest.serialization.Model):
"""The certificate list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of certificates in the
- key vault along with a link to the next page of certificates.
+ :ivar value: A response message containing a list of certificates in the key vault along with a
+ link to the next page of certificates.
:vartype value: list[~azure.keyvault.v7_0.models.CertificateItem]
:ivar next_link: The URL to get the next set of certificates.
:vartype next_link: str
@@ -532,25 +556,25 @@ class CertificateListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class CertificateMergeParameters(Model):
+class CertificateMergeParameters(msrest.serialization.Model):
"""The certificate merge parameters.
All required parameters must be populated in order to send to Azure.
- :param x509_certificates: Required. The certificate or the certificate
- chain to merge.
+ :param x509_certificates: Required. The certificate or the certificate chain to merge.
:type x509_certificates: list[bytearray]
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -564,29 +588,30 @@ class CertificateMergeParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateMergeParameters, self).__init__(**kwargs)
- self.x509_certificates = kwargs.get('x509_certificates', None)
+ self.x509_certificates = kwargs['x509_certificates']
self.certificate_attributes = kwargs.get('certificate_attributes', None)
self.tags = kwargs.get('tags', None)
-class CertificateOperation(Model):
+class CertificateOperation(msrest.serialization.Model):
"""A certificate operation is returned in case of asynchronous requests.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
- :param issuer_parameters: Parameters for the issuer of the X509 component
- of a certificate.
+ :param issuer_parameters: Parameters for the issuer of the X509 component of a certificate.
:type issuer_parameters: ~azure.keyvault.v7_0.models.IssuerParameters
- :param csr: The certificate signing request (CSR) that is being used in
- the certificate operation.
+ :param csr: The certificate signing request (CSR) that is being used in the certificate
+ operation.
:type csr: bytearray
- :param cancellation_requested: Indicates if cancellation was requested on
- the certificate operation.
+ :param cancellation_requested: Indicates if cancellation was requested on the certificate
+ operation.
:type cancellation_requested: bool
:param status: Status of the certificate operation.
:type status: str
@@ -594,8 +619,7 @@ class CertificateOperation(Model):
:type status_details: str
:param error: Error encountered, if any, during the certificate operation.
:type error: ~azure.keyvault.v7_0.models.Error
- :param target: Location which contains the result of the certificate
- operation.
+ :param target: Location which contains the result of the certificate operation.
:type target: str
:param request_id: Identifier for the certificate operation.
:type request_id: str
@@ -617,7 +641,10 @@ class CertificateOperation(Model):
'request_id': {'key': 'request_id', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateOperation, self).__init__(**kwargs)
self.id = None
self.issuer_parameters = kwargs.get('issuer_parameters', None)
@@ -630,13 +657,13 @@ def __init__(self, **kwargs):
self.request_id = kwargs.get('request_id', None)
-class CertificateOperationUpdateParameter(Model):
+class CertificateOperationUpdateParameter(msrest.serialization.Model):
"""The certificate operation update parameters.
All required parameters must be populated in order to send to Azure.
- :param cancellation_requested: Required. Indicates if cancellation was
- requested on the certificate operation.
+ :param cancellation_requested: Required. Indicates if cancellation was requested on the
+ certificate operation.
:type cancellation_requested: bool
"""
@@ -648,16 +675,18 @@ class CertificateOperationUpdateParameter(Model):
'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateOperationUpdateParameter, self).__init__(**kwargs)
- self.cancellation_requested = kwargs.get('cancellation_requested', None)
+ self.cancellation_requested = kwargs['cancellation_requested']
-class CertificatePolicy(Model):
+class CertificatePolicy(msrest.serialization.Model):
"""Management policy for a certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -665,15 +694,12 @@ class CertificatePolicy(Model):
:type key_properties: ~azure.keyvault.v7_0.models.KeyProperties
:param secret_properties: Properties of the secret backing a certificate.
:type secret_properties: ~azure.keyvault.v7_0.models.SecretProperties
- :param x509_certificate_properties: Properties of the X509 component of a
+ :param x509_certificate_properties: Properties of the X509 component of a certificate.
+ :type x509_certificate_properties: ~azure.keyvault.v7_0.models.X509CertificateProperties
+ :param lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a
certificate.
- :type x509_certificate_properties:
- ~azure.keyvault.v7_0.models.X509CertificateProperties
- :param lifetime_actions: Actions that will be performed by Key Vault over
- the lifetime of a certificate.
:type lifetime_actions: list[~azure.keyvault.v7_0.models.LifetimeAction]
- :param issuer_parameters: Parameters for the issuer of the X509 component
- of a certificate.
+ :param issuer_parameters: Parameters for the issuer of the X509 component of a certificate.
:type issuer_parameters: ~azure.keyvault.v7_0.models.IssuerParameters
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
@@ -693,7 +719,10 @@ class CertificatePolicy(Model):
'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificatePolicy, self).__init__(**kwargs)
self.id = None
self.key_properties = kwargs.get('key_properties', None)
@@ -704,13 +733,13 @@ def __init__(self, **kwargs):
self.attributes = kwargs.get('attributes', None)
-class CertificateRestoreParameters(Model):
+class CertificateRestoreParameters(msrest.serialization.Model):
"""The certificate restore parameters.
All required parameters must be populated in order to send to Azure.
- :param certificate_bundle_backup: Required. The backup blob associated
- with a certificate bundle.
+ :param certificate_bundle_backup: Required. The backup blob associated with a certificate
+ bundle.
:type certificate_bundle_backup: bytes
"""
@@ -722,21 +751,22 @@ class CertificateRestoreParameters(Model):
'certificate_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateRestoreParameters, self).__init__(**kwargs)
- self.certificate_bundle_backup = kwargs.get('certificate_bundle_backup', None)
+ self.certificate_bundle_backup = kwargs['certificate_bundle_backup']
-class CertificateUpdateParameters(Model):
+class CertificateUpdateParameters(msrest.serialization.Model):
"""The certificate update parameters.
:param certificate_policy: The management policy for the certificate.
:type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -746,14 +776,17 @@ class CertificateUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateUpdateParameters, self).__init__(**kwargs)
self.certificate_policy = kwargs.get('certificate_policy', None)
self.certificate_attributes = kwargs.get('certificate_attributes', None)
self.tags = kwargs.get('tags', None)
-class Contact(Model):
+class Contact(msrest.serialization.Model):
"""The contact information for the vault certificates.
:param email_address: Email address.
@@ -770,18 +803,20 @@ class Contact(Model):
'phone': {'key': 'phone', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Contact, self).__init__(**kwargs)
self.email_address = kwargs.get('email_address', None)
self.name = kwargs.get('name', None)
self.phone = kwargs.get('phone', None)
-class Contacts(Model):
+class Contacts(msrest.serialization.Model):
"""The contacts for the vault certificates.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Identifier for the contacts collection.
:vartype id: str
@@ -798,18 +833,19 @@ class Contacts(Model):
'contact_list': {'key': 'contacts', 'type': '[Contact]'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Contacts, self).__init__(**kwargs)
self.id = None
self.contact_list = kwargs.get('contact_list', None)
class DeletedCertificateBundle(CertificateBundle):
- """A Deleted Certificate consisting of its previous id, attributes and its
- tags, as well as information on when it will be purged.
+ """A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -827,16 +863,15 @@ class DeletedCertificateBundle(CertificateBundle):
:type content_type: str
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted certificate.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ certificate.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the certificate is scheduled to
- be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the certificate was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the certificate is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the certificate was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -864,7 +899,10 @@ class DeletedCertificateBundle(CertificateBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedCertificateBundle, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
@@ -872,28 +910,25 @@ def __init__(self, **kwargs):
class DeletedCertificateItem(CertificateItem):
- """The deleted certificate item containing metadata about the deleted
- certificate.
+ """The deleted certificate item containing metadata about the deleted certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Certificate identifier.
:type id: str
:param attributes: The certificate management attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param x509_thumbprint: Thumbprint of the certificate.
:type x509_thumbprint: bytes
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted certificate.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ certificate.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the certificate is scheduled to
- be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the certificate was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the certificate is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the certificate was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -911,21 +946,23 @@ class DeletedCertificateItem(CertificateItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedCertificateItem, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedCertificateListResult(Model):
+class DeletedCertificateListResult(msrest.serialization.Model):
"""A list of certificates that have been deleted in this vault.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of deleted certificates
- in the vault along with a link to the next page of deleted certificates
+ :ivar value: A response message containing a list of deleted certificates in the vault along
+ with a link to the next page of deleted certificates.
:vartype value: list[~azure.keyvault.v7_0.models.DeletedCertificateItem]
:ivar next_link: The URL to get the next set of deleted certificates.
:vartype next_link: str
@@ -941,26 +978,28 @@ class DeletedCertificateListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedCertificateListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class KeyBundle(Model):
+class KeyBundle(msrest.serialization.Model):
"""A KeyBundle consisting of a WebKey plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param key: The Json web key.
:type key: ~azure.keyvault.v7_0.models.JsonWebKey
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
"""
@@ -975,7 +1014,10 @@ class KeyBundle(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyBundle, self).__init__(**kwargs)
self.key = kwargs.get('key', None)
self.attributes = kwargs.get('attributes', None)
@@ -984,29 +1026,26 @@ def __init__(self, **kwargs):
class DeletedKeyBundle(KeyBundle):
- """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion
- info.
+ """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param key: The Json web key.
:type key: ~azure.keyvault.v7_0.models.JsonWebKey
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted key.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the key is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the key was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1025,27 +1064,29 @@ class DeletedKeyBundle(KeyBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedKeyBundle, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class KeyItem(Model):
+class KeyItem(msrest.serialization.Model):
"""The key item containing key metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param kid: Key identifier.
:type kid: str
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1060,7 +1101,10 @@ class KeyItem(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyItem, self).__init__(**kwargs)
self.kid = kwargs.get('kid', None)
self.attributes = kwargs.get('attributes', None)
@@ -1069,29 +1113,26 @@ def __init__(self, **kwargs):
class DeletedKeyItem(KeyItem):
- """The deleted key item containing the deleted key metadata and information
- about deletion.
+ """The deleted key item containing the deleted key metadata and information about deletion.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param kid: Key identifier.
:type kid: str
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted key.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the key is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the key was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1110,21 +1151,23 @@ class DeletedKeyItem(KeyItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedKeyItem, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedKeyListResult(Model):
+class DeletedKeyListResult(msrest.serialization.Model):
"""A list of keys that have been deleted in this vault.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of deleted keys in the
- vault along with a link to the next page of deleted keys
+ :ivar value: A response message containing a list of deleted keys in the vault along with a
+ link to the next page of deleted keys.
:vartype value: list[~azure.keyvault.v7_0.models.DeletedKeyItem]
:ivar next_link: The URL to get the next set of deleted keys.
:vartype next_link: str
@@ -1140,36 +1183,36 @@ class DeletedKeyListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedKeyListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SasDefinitionBundle(Model):
- """A SAS definition bundle consists of key vault SAS definition details plus
- its attributes.
+class SasDefinitionBundle(msrest.serialization.Model):
+ """A SAS definition bundle consists of key vault SAS definition details plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The SAS definition id.
:vartype id: str
:ivar secret_id: Storage account SAS definition secret id.
:vartype secret_id: str
- :ivar template_uri: The SAS definition token template signed with an
- arbitrary key. Tokens created according to the SAS definition will have
- the same properties as the template.
+ :ivar template_uri: The SAS definition token template signed with an arbitrary key. Tokens
+ created according to the SAS definition will have the same properties as the template.
:vartype template_uri: str
- :ivar sas_type: The type of SAS token the SAS definition will create.
- Possible values include: 'account', 'service'
+ :ivar sas_type: The type of SAS token the SAS definition will create. Possible values include:
+ "account", "service".
:vartype sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :ivar validity_period: The validity period of SAS tokens created according
- to the SAS definition.
+ :ivar validity_period: The validity period of SAS tokens created according to the SAS
+ definition.
:vartype validity_period: str
:ivar attributes: The SAS definition attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -1193,7 +1236,10 @@ class SasDefinitionBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionBundle, self).__init__(**kwargs)
self.id = None
self.secret_id = None
@@ -1205,38 +1251,34 @@ def __init__(self, **kwargs):
class DeletedSasDefinitionBundle(SasDefinitionBundle):
- """A deleted SAS definition bundle consisting of its previous id, attributes
- and its tags, as well as information on when it will be purged.
+ """A deleted SAS definition bundle consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The SAS definition id.
:vartype id: str
:ivar secret_id: Storage account SAS definition secret id.
:vartype secret_id: str
- :ivar template_uri: The SAS definition token template signed with an
- arbitrary key. Tokens created according to the SAS definition will have
- the same properties as the template.
+ :ivar template_uri: The SAS definition token template signed with an arbitrary key. Tokens
+ created according to the SAS definition will have the same properties as the template.
:vartype template_uri: str
- :ivar sas_type: The type of SAS token the SAS definition will create.
- Possible values include: 'account', 'service'
+ :ivar sas_type: The type of SAS token the SAS definition will create. Possible values include:
+ "account", "service".
:vartype sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :ivar validity_period: The validity period of SAS tokens created according
- to the SAS definition.
+ :ivar validity_period: The validity period of SAS tokens created according to the SAS
+ definition.
:vartype validity_period: str
:ivar attributes: The SAS definition attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted SAS definition.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ SAS definition.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the SAS definition is scheduled
- to be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the SAS definition was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the SAS definition is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the SAS definition was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1264,18 +1306,20 @@ class DeletedSasDefinitionBundle(SasDefinitionBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSasDefinitionBundle, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class SasDefinitionItem(Model):
+class SasDefinitionItem(msrest.serialization.Model):
"""The SAS definition item containing storage SAS definition metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage SAS identifier.
:vartype id: str
@@ -1283,7 +1327,7 @@ class SasDefinitionItem(Model):
:vartype secret_id: str
:ivar attributes: The SAS definition management attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -1301,7 +1345,10 @@ class SasDefinitionItem(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionItem, self).__init__(**kwargs)
self.id = None
self.secret_id = None
@@ -1310,11 +1357,9 @@ def __init__(self, **kwargs):
class DeletedSasDefinitionItem(SasDefinitionItem):
- """The deleted SAS definition item containing metadata about the deleted SAS
- definition.
+ """The deleted SAS definition item containing metadata about the deleted SAS definition.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage SAS identifier.
:vartype id: str
@@ -1322,16 +1367,15 @@ class DeletedSasDefinitionItem(SasDefinitionItem):
:vartype secret_id: str
:ivar attributes: The SAS definition management attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted SAS definition.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ SAS definition.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the SAS definition is scheduled
- to be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the SAS definition was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the SAS definition is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the SAS definition was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1353,22 +1397,23 @@ class DeletedSasDefinitionItem(SasDefinitionItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSasDefinitionItem, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedSasDefinitionListResult(Model):
+class DeletedSasDefinitionListResult(msrest.serialization.Model):
"""The deleted SAS definition list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of the deleted SAS
- definitions in the vault along with a link to the next page of deleted sas
- definitions
+ :ivar value: A response message containing a list of the deleted SAS definitions in the vault
+ along with a link to the next page of deleted sas definitions.
:vartype value: list[~azure.keyvault.v7_0.models.DeletedSasDefinitionItem]
:ivar next_link: The URL to get the next set of deleted SAS definitions.
:vartype next_link: str
@@ -1384,17 +1429,19 @@ class DeletedSasDefinitionListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSasDefinitionListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SecretBundle(Model):
+class SecretBundle(msrest.serialization.Model):
"""A secret consisting of a value, id and its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param value: The secret value.
:type value: str
@@ -1404,13 +1451,13 @@ class SecretBundle(Model):
:type content_type: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar kid: If this is a secret backing a KV certificate, then this field
- specifies the corresponding key backing the KV certificate.
+ :ivar kid: If this is a secret backing a KV certificate, then this field specifies the
+ corresponding key backing the KV certificate.
:vartype kid: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a secret backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a secret
+ backing a certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1429,7 +1476,10 @@ class SecretBundle(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretBundle, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.id = kwargs.get('id', None)
@@ -1441,11 +1491,9 @@ def __init__(self, **kwargs):
class DeletedSecretBundle(SecretBundle):
- """A Deleted Secret consisting of its previous id, attributes and its tags, as
- well as information on when it will be purged.
+ """A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param value: The secret value.
:type value: str
@@ -1455,22 +1503,21 @@ class DeletedSecretBundle(SecretBundle):
:type content_type: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar kid: If this is a secret backing a KV certificate, then this field
- specifies the corresponding key backing the KV certificate.
+ :ivar kid: If this is a secret backing a KV certificate, then this field specifies the
+ corresponding key backing the KV certificate.
:vartype kid: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a secret backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a secret
+ backing a certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted secret.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ secret.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the secret is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the secret was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the secret is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the secret was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1493,29 +1540,31 @@ class DeletedSecretBundle(SecretBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSecretBundle, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class SecretItem(Model):
+class SecretItem(msrest.serialization.Model):
"""The secret item containing secret metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Secret identifier.
:type id: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a key backing
+ a certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1531,7 +1580,10 @@ class SecretItem(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretItem, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.attributes = kwargs.get('attributes', None)
@@ -1543,28 +1595,26 @@ def __init__(self, **kwargs):
class DeletedSecretItem(SecretItem):
"""The deleted secret item containing metadata about the deleted secret.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Secret identifier.
:type id: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a key backing
+ a certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted secret.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ secret.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the secret is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the secret was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the secret is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the secret was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1584,21 +1634,23 @@ class DeletedSecretItem(SecretItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSecretItem, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedSecretListResult(Model):
+class DeletedSecretListResult(msrest.serialization.Model):
"""The deleted secret list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of the deleted secrets
- in the vault along with a link to the next page of deleted secrets
+ :ivar value: A response message containing a list of the deleted secrets in the vault along
+ with a link to the next page of deleted secrets.
:vartype value: list[~azure.keyvault.v7_0.models.DeletedSecretItem]
:ivar next_link: The URL to get the next set of deleted secrets.
:vartype next_link: str
@@ -1614,17 +1666,19 @@ class DeletedSecretListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSecretListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class StorageAccountItem(Model):
+class StorageAccountItem(msrest.serialization.Model):
"""The storage account item containing storage account metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Storage identifier.
:vartype id: str
@@ -1632,7 +1686,7 @@ class StorageAccountItem(Model):
:vartype resource_id: str
:ivar attributes: The storage account management attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -1650,7 +1704,10 @@ class StorageAccountItem(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountItem, self).__init__(**kwargs)
self.id = None
self.resource_id = None
@@ -1659,11 +1716,9 @@ def __init__(self, **kwargs):
class DeletedStorageAccountItem(StorageAccountItem):
- """The deleted storage account item containing metadata about the deleted
- storage account.
+ """The deleted storage account item containing metadata about the deleted storage account.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Storage identifier.
:vartype id: str
@@ -1671,16 +1726,16 @@ class DeletedStorageAccountItem(StorageAccountItem):
:vartype resource_id: str
:ivar attributes: The storage account management attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted storage account.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ storage account.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the storage account is scheduled
- to be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the storage account was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the storage account is scheduled to be purged, in
+ UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the storage account was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1702,19 +1757,20 @@ class DeletedStorageAccountItem(StorageAccountItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedStorageAccountItem, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class StorageBundle(Model):
- """A Storage account bundle consists of key vault storage account details plus
- its attributes.
+class StorageBundle(msrest.serialization.Model):
+ """A Storage account bundle consists of key vault storage account details plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage account id.
:vartype id: str
@@ -1722,15 +1778,13 @@ class StorageBundle(Model):
:vartype resource_id: str
:ivar active_key_name: The current active storage account key name.
:vartype active_key_name: str
- :ivar auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :ivar auto_regenerate_key: whether keyvault should manage the storage account for the user.
:vartype auto_regenerate_key: bool
- :ivar regeneration_period: The key regeneration time duration specified in
- ISO-8601 format.
+ :ivar regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:vartype regeneration_period: str
:ivar attributes: The storage account attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -1754,7 +1808,10 @@ class StorageBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageBundle, self).__init__(**kwargs)
self.id = None
self.resource_id = None
@@ -1766,11 +1823,9 @@ def __init__(self, **kwargs):
class DeletedStorageBundle(StorageBundle):
- """A deleted storage account bundle consisting of its previous id, attributes
- and its tags, as well as information on when it will be purged.
+ """A deleted storage account bundle consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage account id.
:vartype id: str
@@ -1778,24 +1833,22 @@ class DeletedStorageBundle(StorageBundle):
:vartype resource_id: str
:ivar active_key_name: The current active storage account key name.
:vartype active_key_name: str
- :ivar auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :ivar auto_regenerate_key: whether keyvault should manage the storage account for the user.
:vartype auto_regenerate_key: bool
- :ivar regeneration_period: The key regeneration time duration specified in
- ISO-8601 format.
+ :ivar regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:vartype regeneration_period: str
:ivar attributes: The storage account attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted storage account.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ storage account.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the storage account is scheduled
- to be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the storage account was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the storage account is scheduled to be purged, in
+ UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the storage account was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1823,24 +1876,24 @@ class DeletedStorageBundle(StorageBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedStorageBundle, self).__init__(**kwargs)
self.recovery_id = kwargs.get('recovery_id', None)
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedStorageListResult(Model):
+class DeletedStorageListResult(msrest.serialization.Model):
"""The deleted storage account list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of the deleted storage
- accounts in the vault along with a link to the next page of deleted
- storage accounts
- :vartype value:
- list[~azure.keyvault.v7_0.models.DeletedStorageAccountItem]
+ :ivar value: A response message containing a list of the deleted storage accounts in the vault
+ along with a link to the next page of deleted storage accounts.
+ :vartype value: list[~azure.keyvault.v7_0.models.DeletedStorageAccountItem]
:ivar next_link: The URL to get the next set of deleted storage accounts.
:vartype next_link: str
"""
@@ -1855,23 +1908,25 @@ class DeletedStorageListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedStorageListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class Error(Model):
+class Error(msrest.serialization.Model):
"""The key vault server error.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: The error code.
:vartype code: str
:ivar message: The error message.
:vartype message: str
- :ivar inner_error:
+ :ivar inner_error: The key vault server error.
:vartype inner_error: ~azure.keyvault.v7_0.models.Error
"""
@@ -1887,25 +1942,27 @@ class Error(Model):
'inner_error': {'key': 'innererror', 'type': 'Error'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Error, self).__init__(**kwargs)
self.code = None
self.message = None
self.inner_error = None
-class IssuerAttributes(Model):
+class IssuerAttributes(msrest.serialization.Model):
"""The attributes of an issuer managed by the Key Vault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the issuer is enabled.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -1919,18 +1976,20 @@ class IssuerAttributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(IssuerAttributes, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.created = None
self.updated = None
-class IssuerBundle(Model):
+class IssuerBundle(msrest.serialization.Model):
"""The issuer for Key Vault certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Identifier for the issuer object.
:vartype id: str
@@ -1938,10 +1997,8 @@ class IssuerBundle(Model):
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v7_0.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v7_0.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v7_0.models.IssuerAttributes
"""
@@ -1958,7 +2015,10 @@ class IssuerBundle(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(IssuerBundle, self).__init__(**kwargs)
self.id = None
self.provider = kwargs.get('provider', None)
@@ -1967,7 +2027,7 @@ def __init__(self, **kwargs):
self.attributes = kwargs.get('attributes', None)
-class IssuerCredentials(Model):
+class IssuerCredentials(msrest.serialization.Model):
"""The credentials to be used for the certificate issuer.
:param account_id: The user name/account name/account id.
@@ -1981,23 +2041,26 @@ class IssuerCredentials(Model):
'password': {'key': 'pwd', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(IssuerCredentials, self).__init__(**kwargs)
self.account_id = kwargs.get('account_id', None)
self.password = kwargs.get('password', None)
-class IssuerParameters(Model):
+class IssuerParameters(msrest.serialization.Model):
"""Parameters for the issuer of the X509 component of a certificate.
- :param name: Name of the referenced issuer object or reserved names; for
- example, 'Self' or 'Unknown'.
+ :param name: Name of the referenced issuer object or reserved names; for example, 'Self' or
+ 'Unknown'.
:type name: str
- :param certificate_type: Type of certificate to be requested from the
- issuer provider.
+ :param certificate_type: Certificate type as supported by the provider (optional); for example
+ 'OV-SSL', 'EV-SSL'.
:type certificate_type: str
- :param certificate_transparency: Indicates if the certificates generated
- under this policy should be published to certificate transparency logs.
+ :param certificate_transparency: Indicates if the certificates generated under this policy
+ should be published to certificate transparency logs.
:type certificate_transparency: bool
"""
@@ -2007,21 +2070,23 @@ class IssuerParameters(Model):
'certificate_transparency': {'key': 'cert_transparency', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(IssuerParameters, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.certificate_type = kwargs.get('certificate_type', None)
self.certificate_transparency = kwargs.get('certificate_transparency', None)
-class JsonWebKey(Model):
+class JsonWebKey(msrest.serialization.Model):
"""As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18.
:param kid: Key identifier.
:type kid: str
- :param kty: JsonWebKey Key Type (kty), as defined in
- https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40.
- Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'
+ :param kty: JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-
+ jose-json-web-algorithms-40. Possible values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
:type kty: str or ~azure.keyvault.v7_0.models.JsonWebKeyType
:param key_ops:
:type key_ops: list[str]
@@ -2045,9 +2110,8 @@ class JsonWebKey(Model):
:type k: bytes
:param t: HSM Token, used with 'Bring Your Own Key'.
:type t: bytes
- :param crv: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'P-256K'
+ :param crv: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
:type crv: str or ~azure.keyvault.v7_0.models.JsonWebKeyCurveName
:param x: X component of an EC public key.
:type x: bytes
@@ -2074,7 +2138,10 @@ class JsonWebKey(Model):
'y': {'key': 'y', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(JsonWebKey, self).__init__(**kwargs)
self.kid = kwargs.get('kid', None)
self.kty = kwargs.get('kty', None)
@@ -2097,27 +2164,25 @@ def __init__(self, **kwargs):
class KeyAttributes(Attributes):
"""The attributes of a key managed by the key vault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for keys in the current vault. If it contains 'Purgeable' the key
- can be permanently deleted by a privileged user; otherwise, only the
- system can purge the key, at the end of the retention interval. Possible
- values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for keys in the
+ current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged
+ user; otherwise, only the system can purge the key, at the end of the retention interval.
+ Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
+ "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2135,38 +2200,37 @@ class KeyAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyAttributes, self).__init__(**kwargs)
self.recovery_level = None
-class KeyCreateParameters(Model):
+class KeyCreateParameters(msrest.serialization.Model):
"""The key create parameters.
All required parameters must be populated in order to send to Azure.
- :param kty: Required. The type of key to create. For valid values, see
- JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM',
- 'oct'
+ :param kty: Required. The type of key to create. For valid values, see JsonWebKeyType. Possible
+ values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
:type kty: str or ~azure.keyvault.v7_0.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or 4096
- for RSA.
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
:type key_size: int
:param key_ops:
- :type key_ops: list[str or
- ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
- :param key_attributes:
+ :type key_ops: list[str or ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
:type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'P-256K'
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
:type curve: str or ~azure.keyvault.v7_0.models.JsonWebKeyCurveName
"""
_validation = {
- 'kty': {'required': True, 'min_length': 1},
+ 'kty': {'required': True},
}
_attribute_map = {
@@ -2178,9 +2242,12 @@ class KeyCreateParameters(Model):
'curve': {'key': 'crv', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyCreateParameters, self).__init__(**kwargs)
- self.kty = kwargs.get('kty', None)
+ self.kty = kwargs['kty']
self.key_size = kwargs.get('key_size', None)
self.key_ops = kwargs.get('key_ops', None)
self.key_attributes = kwargs.get('key_attributes', None)
@@ -2188,18 +2255,18 @@ def __init__(self, **kwargs):
self.curve = kwargs.get('curve', None)
-class KeyImportParameters(Model):
+class KeyImportParameters(msrest.serialization.Model):
"""The key import parameters.
All required parameters must be populated in order to send to Azure.
:param hsm: Whether to import as a hardware key (HSM) or software key.
:type hsm: bool
- :param key: Required. The Json web key
+ :param key: Required. The Json web key.
:type key: ~azure.keyvault.v7_0.models.JsonWebKey
:param key_attributes: The key management attributes.
:type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2214,22 +2281,24 @@ class KeyImportParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyImportParameters, self).__init__(**kwargs)
self.hsm = kwargs.get('hsm', None)
- self.key = kwargs.get('key', None)
+ self.key = kwargs['key']
self.key_attributes = kwargs.get('key_attributes', None)
self.tags = kwargs.get('tags', None)
-class KeyListResult(Model):
+class KeyListResult(msrest.serialization.Model):
"""The key list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of keys in the key vault
- along with a link to the next page of keys.
+ :ivar value: A response message containing a list of keys in the key vault along with a link to
+ the next page of keys.
:vartype value: list[~azure.keyvault.v7_0.models.KeyItem]
:ivar next_link: The URL to get the next set of keys.
:vartype next_link: str
@@ -2245,19 +2314,21 @@ class KeyListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class KeyOperationResult(Model):
+class KeyOperationResult(msrest.serialization.Model):
"""The key operation result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar kid: Key identifier
+ :ivar kid: Key identifier.
:vartype kid: str
:ivar result:
:vartype result: bytes
@@ -2273,27 +2344,29 @@ class KeyOperationResult(Model):
'result': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyOperationResult, self).__init__(**kwargs)
self.kid = None
self.result = None
-class KeyOperationsParameters(Model):
+class KeyOperationsParameters(msrest.serialization.Model):
"""The key operations parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeyEncryptionAlgorithm
+ :param algorithm: Required. algorithm identifier. Possible values include: "RSA-OAEP", "RSA-
+ OAEP-256", "RSA1_5".
+ :type algorithm: str or ~azure.keyvault.v7_0.models.JsonWebKeyEncryptionAlgorithm
:param value: Required.
:type value: bytes
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'value': {'required': True},
}
@@ -2302,29 +2375,29 @@ class KeyOperationsParameters(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyOperationsParameters, self).__init__(**kwargs)
- self.algorithm = kwargs.get('algorithm', None)
- self.value = kwargs.get('value', None)
+ self.algorithm = kwargs['algorithm']
+ self.value = kwargs['value']
-class KeyProperties(Model):
+class KeyProperties(msrest.serialization.Model):
"""Properties of the key pair backing a certificate.
:param exportable: Indicates if the private key can be exported.
:type exportable: bool
- :param key_type: The type of key pair to be used for the certificate.
- Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'
+ :param key_type: The type of key pair to be used for the certificate. Possible values include:
+ "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
:type key_type: str or ~azure.keyvault.v7_0.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or 4096
- for RSA.
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
:type key_size: int
- :param reuse_key: Indicates if the same key pair will be used on
- certificate renewal.
+ :param reuse_key: Indicates if the same key pair will be used on certificate renewal.
:type reuse_key: bool
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'P-256K'
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
:type curve: str or ~azure.keyvault.v7_0.models.JsonWebKeyCurveName
"""
@@ -2336,7 +2409,10 @@ class KeyProperties(Model):
'curve': {'key': 'crv', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyProperties, self).__init__(**kwargs)
self.exportable = kwargs.get('exportable', None)
self.key_type = kwargs.get('key_type', None)
@@ -2345,13 +2421,12 @@ def __init__(self, **kwargs):
self.curve = kwargs.get('curve', None)
-class KeyRestoreParameters(Model):
+class KeyRestoreParameters(msrest.serialization.Model):
"""The key restore parameters.
All required parameters must be populated in order to send to Azure.
- :param key_bundle_backup: Required. The backup blob associated with a key
- bundle.
+ :param key_bundle_backup: Required. The backup blob associated with a key bundle.
:type key_bundle_backup: bytes
"""
@@ -2363,29 +2438,30 @@ class KeyRestoreParameters(Model):
'key_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyRestoreParameters, self).__init__(**kwargs)
- self.key_bundle_backup = kwargs.get('key_bundle_backup', None)
+ self.key_bundle_backup = kwargs['key_bundle_backup']
-class KeySignParameters(Model):
+class KeySignParameters(msrest.serialization.Model):
"""The key operations parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. The signing/verification algorithm identifier.
- For more information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384',
- 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512',
- 'ES256K'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
+ :param algorithm: Required. The signing/verification algorithm identifier. For more information
+ on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include:
+ "PS256", "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512",
+ "ES256K".
+ :type algorithm: str or ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
:param value: Required.
:type value: bytes
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'value': {'required': True},
}
@@ -2394,22 +2470,24 @@ class KeySignParameters(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeySignParameters, self).__init__(**kwargs)
- self.algorithm = kwargs.get('algorithm', None)
- self.value = kwargs.get('value', None)
+ self.algorithm = kwargs['algorithm']
+ self.value = kwargs['value']
-class KeyUpdateParameters(Model):
+class KeyUpdateParameters(msrest.serialization.Model):
"""The key update parameters.
- :param key_ops: Json web key operations. For more information on possible
- key operations, see JsonWebKeyOperation.
- :type key_ops: list[str or
- ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
- :param key_attributes:
+ :param key_ops: Json web key operations. For more information on possible key operations, see
+ JsonWebKeyOperation.
+ :type key_ops: list[str or ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
:type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2419,20 +2497,22 @@ class KeyUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyUpdateParameters, self).__init__(**kwargs)
self.key_ops = kwargs.get('key_ops', None)
self.key_attributes = kwargs.get('key_attributes', None)
self.tags = kwargs.get('tags', None)
-class KeyVaultError(Model):
+class KeyVaultError(msrest.serialization.Model):
"""The key vault error exception.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar error:
+ :ivar error: The key vault server error.
:vartype error: ~azure.keyvault.v7_0.models.Error
"""
@@ -2444,38 +2524,23 @@ class KeyVaultError(Model):
'error': {'key': 'error', 'type': 'Error'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVaultError, self).__init__(**kwargs)
self.error = None
-class KeyVaultErrorException(HttpResponseError):
- """Server responsed with exception of type: 'KeyVaultError'.
-
- :param deserialize: A deserializer
- :param response: Server response to be deserialized.
- """
-
- def __init__(self, response, deserialize, *args):
-
- model_name = 'KeyVaultError'
- self.error = deserialize(model_name, response)
- if self.error is None:
- self.error = deserialize.dependencies[model_name]()
- super(KeyVaultErrorException, self).__init__(response=response)
-
-
-class KeyVerifyParameters(Model):
+class KeyVerifyParameters(msrest.serialization.Model):
"""The key verify parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. The signing/verification algorithm. For more
- information on possible algorithm types, see JsonWebKeySignatureAlgorithm.
- Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384',
- 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
+ :param algorithm: Required. The signing/verification algorithm. For more information on
+ possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: "PS256",
+ "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512", "ES256K".
+ :type algorithm: str or ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
:param digest: Required. The digest used for signing.
:type digest: bytes
:param signature: Required. The signature to be verified.
@@ -2483,7 +2548,7 @@ class KeyVerifyParameters(Model):
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'digest': {'required': True},
'signature': {'required': True},
}
@@ -2494,18 +2559,20 @@ class KeyVerifyParameters(Model):
'signature': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVerifyParameters, self).__init__(**kwargs)
- self.algorithm = kwargs.get('algorithm', None)
- self.digest = kwargs.get('digest', None)
- self.signature = kwargs.get('signature', None)
+ self.algorithm = kwargs['algorithm']
+ self.digest = kwargs['digest']
+ self.signature = kwargs['signature']
-class KeyVerifyResult(Model):
+class KeyVerifyResult(msrest.serialization.Model):
"""The key verify result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: True if the signature is verified, otherwise false.
:vartype value: bool
@@ -2519,14 +2586,16 @@ class KeyVerifyResult(Model):
'value': {'key': 'value', 'type': 'bool'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVerifyResult, self).__init__(**kwargs)
self.value = None
-class LifetimeAction(Model):
- """Action and its trigger that will be performed by Key Vault over the
- lifetime of a certificate.
+class LifetimeAction(msrest.serialization.Model):
+ """Action and its trigger that will be performed by Key Vault over the lifetime of a certificate.
:param trigger: The condition that will execute the action.
:type trigger: ~azure.keyvault.v7_0.models.Trigger
@@ -2539,20 +2608,22 @@ class LifetimeAction(Model):
'action': {'key': 'action', 'type': 'Action'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(LifetimeAction, self).__init__(**kwargs)
self.trigger = kwargs.get('trigger', None)
self.action = kwargs.get('action', None)
-class OrganizationDetails(Model):
+class OrganizationDetails(msrest.serialization.Model):
"""Details of the organization of the certificate issuer.
:param id: Id of the organization.
:type id: str
:param admin_details: Details of the organization administrator.
- :type admin_details:
- list[~azure.keyvault.v7_0.models.AdministratorDetails]
+ :type admin_details: list[~azure.keyvault.v7_0.models.AdministratorDetails]
"""
_attribute_map = {
@@ -2560,20 +2631,21 @@ class OrganizationDetails(Model):
'admin_details': {'key': 'admin_details', 'type': '[AdministratorDetails]'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(OrganizationDetails, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.admin_details = kwargs.get('admin_details', None)
-class PendingCertificateSigningRequestResult(Model):
+class PendingCertificateSigningRequestResult(msrest.serialization.Model):
"""The pending certificate signing request result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: The pending certificate signing request as Base64 encoded
- string.
+ :ivar value: The pending certificate signing request as Base64 encoded string.
:vartype value: str
"""
@@ -2585,32 +2657,33 @@ class PendingCertificateSigningRequestResult(Model):
'value': {'key': 'value', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(PendingCertificateSigningRequestResult, self).__init__(**kwargs)
self.value = None
-class SasDefinitionAttributes(Model):
+class SasDefinitionAttributes(msrest.serialization.Model):
"""The SAS definition management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: the enabled state of the object.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for SAS definitions in the current vault. If it contains
- 'Purgeable' the SAS definition can be permanently deleted by a privileged
- user; otherwise, only the system can purge the SAS definition, at the end
- of the retention interval. Possible values include: 'Purgeable',
- 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for SAS
+ definitions in the current vault. If it contains 'Purgeable' the SAS definition can be
+ permanently deleted by a privileged user; otherwise, only the system can purge the SAS
+ definition, at the end of the retention interval. Possible values include: "Purgeable",
+ "Recoverable+Purgeable", "Recoverable", "Recoverable+ProtectedSubscription",
+ "CustomizedRecoverable+Purgeable", "CustomizedRecoverable",
+ "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2626,7 +2699,10 @@ class SasDefinitionAttributes(Model):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionAttributes, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.created = None
@@ -2634,25 +2710,23 @@ def __init__(self, **kwargs):
self.recovery_level = None
-class SasDefinitionCreateParameters(Model):
+class SasDefinitionCreateParameters(msrest.serialization.Model):
"""The SAS definition create parameters.
All required parameters must be populated in order to send to Azure.
- :param template_uri: Required. The SAS definition token template signed
- with an arbitrary key. Tokens created according to the SAS definition
- will have the same properties as the template.
+ :param template_uri: Required. The SAS definition token template signed with an arbitrary key.
+ Tokens created according to the SAS definition will have the same properties as the template.
:type template_uri: str
- :param sas_type: Required. The type of SAS token the SAS definition will
- create. Possible values include: 'account', 'service'
+ :param sas_type: Required. The type of SAS token the SAS definition will create. Possible
+ values include: "account", "service".
:type sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :param validity_period: Required. The validity period of SAS tokens
- created according to the SAS definition.
+ :param validity_period: Required. The validity period of SAS tokens created according to the
+ SAS definition.
:type validity_period: str
:param sas_definition_attributes: The attributes of the SAS definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type sas_definition_attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2670,23 +2744,25 @@ class SasDefinitionCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionCreateParameters, self).__init__(**kwargs)
- self.template_uri = kwargs.get('template_uri', None)
- self.sas_type = kwargs.get('sas_type', None)
- self.validity_period = kwargs.get('validity_period', None)
+ self.template_uri = kwargs['template_uri']
+ self.sas_type = kwargs['sas_type']
+ self.validity_period = kwargs['validity_period']
self.sas_definition_attributes = kwargs.get('sas_definition_attributes', None)
self.tags = kwargs.get('tags', None)
-class SasDefinitionListResult(Model):
+class SasDefinitionListResult(msrest.serialization.Model):
"""The storage account SAS definition list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of SAS definitions along
- with a link to the next page of SAS definitions.
+ :ivar value: A response message containing a list of SAS definitions along with a link to the
+ next page of SAS definitions.
:vartype value: list[~azure.keyvault.v7_0.models.SasDefinitionItem]
:ivar next_link: The URL to get the next set of SAS definitions.
:vartype next_link: str
@@ -2702,29 +2778,30 @@ class SasDefinitionListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SasDefinitionUpdateParameters(Model):
+class SasDefinitionUpdateParameters(msrest.serialization.Model):
"""The SAS definition update parameters.
- :param template_uri: The SAS definition token template signed with an
- arbitrary key. Tokens created according to the SAS definition will have
- the same properties as the template.
+ :param template_uri: The SAS definition token template signed with an arbitrary key. Tokens
+ created according to the SAS definition will have the same properties as the template.
:type template_uri: str
- :param sas_type: The type of SAS token the SAS definition will create.
- Possible values include: 'account', 'service'
+ :param sas_type: The type of SAS token the SAS definition will create. Possible values include:
+ "account", "service".
:type sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :param validity_period: The validity period of SAS tokens created
- according to the SAS definition.
+ :param validity_period: The validity period of SAS tokens created according to the SAS
+ definition.
:type validity_period: str
:param sas_definition_attributes: The attributes of the SAS definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type sas_definition_attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2736,7 +2813,10 @@ class SasDefinitionUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionUpdateParameters, self).__init__(**kwargs)
self.template_uri = kwargs.get('template_uri', None)
self.sas_type = kwargs.get('sas_type', None)
@@ -2748,27 +2828,25 @@ def __init__(self, **kwargs):
class SecretAttributes(Attributes):
"""The secret management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for secrets in the current vault. If it contains 'Purgeable', the
- secret can be permanently deleted by a privileged user; otherwise, only
- the system can purge the secret, at the end of the retention interval.
- Possible values include: 'Purgeable', 'Recoverable+Purgeable',
- 'Recoverable', 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for secrets in
+ the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a
+ privileged user; otherwise, only the system can purge the secret, at the end of the retention
+ interval. Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
+ "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2786,19 +2864,21 @@ class SecretAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretAttributes, self).__init__(**kwargs)
self.recovery_level = None
-class SecretListResult(Model):
+class SecretListResult(msrest.serialization.Model):
"""The secret list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of secrets in the key
- vault along with a link to the next page of secrets.
+ :ivar value: A response message containing a list of secrets in the key vault along with a link
+ to the next page of secrets.
:vartype value: list[~azure.keyvault.v7_0.models.SecretItem]
:ivar next_link: The URL to get the next set of secrets.
:vartype next_link: str
@@ -2814,13 +2894,16 @@ class SecretListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SecretProperties(Model):
+class SecretProperties(msrest.serialization.Model):
"""Properties of the key backing a certificate.
:param content_type: The media type (MIME type).
@@ -2831,18 +2914,20 @@ class SecretProperties(Model):
'content_type': {'key': 'contentType', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretProperties, self).__init__(**kwargs)
self.content_type = kwargs.get('content_type', None)
-class SecretRestoreParameters(Model):
+class SecretRestoreParameters(msrest.serialization.Model):
"""The secret restore parameters.
All required parameters must be populated in order to send to Azure.
- :param secret_bundle_backup: Required. The backup blob associated with a
- secret bundle.
+ :param secret_bundle_backup: Required. The backup blob associated with a secret bundle.
:type secret_bundle_backup: bytes
"""
@@ -2854,19 +2939,22 @@ class SecretRestoreParameters(Model):
'secret_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretRestoreParameters, self).__init__(**kwargs)
- self.secret_bundle_backup = kwargs.get('secret_bundle_backup', None)
+ self.secret_bundle_backup = kwargs['secret_bundle_backup']
-class SecretSetParameters(Model):
+class SecretSetParameters(msrest.serialization.Model):
"""The secret set parameters.
All required parameters must be populated in order to send to Azure.
:param value: Required. The value of the secret.
:type value: str
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
@@ -2885,22 +2973,25 @@ class SecretSetParameters(Model):
'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretSetParameters, self).__init__(**kwargs)
- self.value = kwargs.get('value', None)
+ self.value = kwargs['value']
self.tags = kwargs.get('tags', None)
self.content_type = kwargs.get('content_type', None)
self.secret_attributes = kwargs.get('secret_attributes', None)
-class SecretUpdateParameters(Model):
+class SecretUpdateParameters(msrest.serialization.Model):
"""The secret update parameters.
:param content_type: Type of the secret value such as a password.
:type content_type: str
:param secret_attributes: The secret management attributes.
:type secret_attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2910,34 +3001,35 @@ class SecretUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretUpdateParameters, self).__init__(**kwargs)
self.content_type = kwargs.get('content_type', None)
self.secret_attributes = kwargs.get('secret_attributes', None)
self.tags = kwargs.get('tags', None)
-class StorageAccountAttributes(Model):
+class StorageAccountAttributes(msrest.serialization.Model):
"""The storage account management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: the enabled state of the object.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for storage accounts in the current vault. If it contains
- 'Purgeable' the storage account can be permanently deleted by a privileged
- user; otherwise, only the system can purge the storage account, at the end
- of the retention interval. Possible values include: 'Purgeable',
- 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for storage
+ accounts in the current vault. If it contains 'Purgeable' the storage account can be
+ permanently deleted by a privileged user; otherwise, only the system can purge the storage
+ account, at the end of the retention interval. Possible values include: "Purgeable",
+ "Recoverable+Purgeable", "Recoverable", "Recoverable+ProtectedSubscription",
+ "CustomizedRecoverable+Purgeable", "CustomizedRecoverable",
+ "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2953,7 +3045,10 @@ class StorageAccountAttributes(Model):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountAttributes, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.created = None
@@ -2961,7 +3056,7 @@ def __init__(self, **kwargs):
self.recovery_level = None
-class StorageAccountCreateParameters(Model):
+class StorageAccountCreateParameters(msrest.serialization.Model):
"""The storage account create parameters.
All required parameters must be populated in order to send to Azure.
@@ -2970,16 +3065,14 @@ class StorageAccountCreateParameters(Model):
:type resource_id: str
:param active_key_name: Required. Current active storage account key name.
:type active_key_name: str
- :param auto_regenerate_key: Required. whether keyvault should manage the
- storage account for the user.
+ :param auto_regenerate_key: Required. whether keyvault should manage the storage account for
+ the user.
:type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration specified
- in ISO-8601 format.
+ :param regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:type regeneration_period: str
:param storage_account_attributes: The attributes of the storage account.
- :type storage_account_attributes:
- ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type storage_account_attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2998,17 +3091,20 @@ class StorageAccountCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountCreateParameters, self).__init__(**kwargs)
- self.resource_id = kwargs.get('resource_id', None)
- self.active_key_name = kwargs.get('active_key_name', None)
- self.auto_regenerate_key = kwargs.get('auto_regenerate_key', None)
+ self.resource_id = kwargs['resource_id']
+ self.active_key_name = kwargs['active_key_name']
+ self.auto_regenerate_key = kwargs['auto_regenerate_key']
self.regeneration_period = kwargs.get('regeneration_period', None)
self.storage_account_attributes = kwargs.get('storage_account_attributes', None)
self.tags = kwargs.get('tags', None)
-class StorageAccountRegenerteKeyParameters(Model):
+class StorageAccountRegenerteKeyParameters(msrest.serialization.Model):
"""The storage account key regenerate parameters.
All required parameters must be populated in order to send to Azure.
@@ -3025,26 +3121,26 @@ class StorageAccountRegenerteKeyParameters(Model):
'key_name': {'key': 'keyName', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountRegenerteKeyParameters, self).__init__(**kwargs)
- self.key_name = kwargs.get('key_name', None)
+ self.key_name = kwargs['key_name']
-class StorageAccountUpdateParameters(Model):
+class StorageAccountUpdateParameters(msrest.serialization.Model):
"""The storage account update parameters.
:param active_key_name: The current active storage account key name.
:type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :param auto_regenerate_key: whether keyvault should manage the storage account for the user.
:type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration specified
- in ISO-8601 format.
+ :param regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:type regeneration_period: str
:param storage_account_attributes: The attributes of the storage account.
- :type storage_account_attributes:
- ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type storage_account_attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -3056,7 +3152,10 @@ class StorageAccountUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountUpdateParameters, self).__init__(**kwargs)
self.active_key_name = kwargs.get('active_key_name', None)
self.auto_regenerate_key = kwargs.get('auto_regenerate_key', None)
@@ -3065,14 +3164,13 @@ def __init__(self, **kwargs):
self.tags = kwargs.get('tags', None)
-class StorageListResult(Model):
+class StorageListResult(msrest.serialization.Model):
"""The storage accounts list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of storage accounts in
- the key vault along with a link to the next page of storage accounts.
+ :ivar value: A response message containing a list of storage accounts in the key vault along
+ with a link to the next page of storage accounts.
:vartype value: list[~azure.keyvault.v7_0.models.StorageAccountItem]
:ivar next_link: The URL to get the next set of storage accounts.
:vartype next_link: str
@@ -3088,19 +3186,21 @@ class StorageListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class StorageRestoreParameters(Model):
+class StorageRestoreParameters(msrest.serialization.Model):
"""The secret restore parameters.
All required parameters must be populated in order to send to Azure.
- :param storage_bundle_backup: Required. The backup blob associated with a
- storage account.
+ :param storage_bundle_backup: Required. The backup blob associated with a storage account.
:type storage_bundle_backup: bytes
"""
@@ -3112,12 +3212,15 @@ class StorageRestoreParameters(Model):
'storage_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageRestoreParameters, self).__init__(**kwargs)
- self.storage_bundle_backup = kwargs.get('storage_bundle_backup', None)
+ self.storage_bundle_backup = kwargs['storage_bundle_backup']
-class SubjectAlternativeNames(Model):
+class SubjectAlternativeNames(msrest.serialization.Model):
"""The subject alternate names of a X509 object.
:param emails: Email addresses.
@@ -3134,23 +3237,25 @@ class SubjectAlternativeNames(Model):
'upns': {'key': 'upns', 'type': '[str]'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SubjectAlternativeNames, self).__init__(**kwargs)
self.emails = kwargs.get('emails', None)
self.dns_names = kwargs.get('dns_names', None)
self.upns = kwargs.get('upns', None)
-class Trigger(Model):
+class Trigger(msrest.serialization.Model):
"""A condition to be satisfied for an action to be executed.
- :param lifetime_percentage: Percentage of lifetime at which to trigger.
- Value should be between 1 and 99.
+ :param lifetime_percentage: Percentage of lifetime at which to trigger. Value should be between
+ 1 and 99.
:type lifetime_percentage: int
- :param days_before_expiry: Days before expiry to attempt renewal. Value
- should be between 1 and validity_in_months multiplied by 27. If
- validity_in_months is 36, then value should be between 1 and 972 (36 *
- 27).
+ :param days_before_expiry: Days before expiry to attempt renewal. Value should be between 1 and
+ validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between
+ 1 and 972 (36 * 27).
:type days_before_expiry: int
"""
@@ -3163,27 +3268,27 @@ class Trigger(Model):
'days_before_expiry': {'key': 'days_before_expiry', 'type': 'int'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Trigger, self).__init__(**kwargs)
self.lifetime_percentage = kwargs.get('lifetime_percentage', None)
self.days_before_expiry = kwargs.get('days_before_expiry', None)
-class X509CertificateProperties(Model):
+class X509CertificateProperties(msrest.serialization.Model):
"""Properties of the X509 component of a certificate.
- :param subject: The subject name. Should be a valid X509 distinguished
- Name.
+ :param subject: The subject name. Should be a valid X509 distinguished Name.
:type subject: str
:param ekus: The enhanced key usage.
:type ekus: list[str]
:param subject_alternative_names: The subject alternative names.
- :type subject_alternative_names:
- ~azure.keyvault.v7_0.models.SubjectAlternativeNames
+ :type subject_alternative_names: ~azure.keyvault.v7_0.models.SubjectAlternativeNames
:param key_usage: List of key usages.
:type key_usage: list[str or ~azure.keyvault.v7_0.models.KeyUsageType]
- :param validity_in_months: The duration that the certificate is valid in
- months.
+ :param validity_in_months: The duration that the certificate is valid in months.
:type validity_in_months: int
"""
@@ -3199,7 +3304,10 @@ class X509CertificateProperties(Model):
'validity_in_months': {'key': 'validity_months', 'type': 'int'},
}
- def __init__(self, **kwargs):
+ def __init__(
+ self,
+ **kwargs
+ ):
super(X509CertificateProperties, self).__init__(**kwargs)
self.subject = kwargs.get('subject', None)
self.ekus = kwargs.get('ekus', None)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_models_py3.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_models_py3.py
similarity index 69%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_models_py3.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_models_py3.py
index dffe1b2a4ce8..1ac5ee97e359 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_models_py3.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/models/_models_py3.py
@@ -1,36 +1,43 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from msrest.serialization import Model
+import datetime
+from typing import Dict, List, Optional, Union
+
from azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+from ._key_vault_client_enums import *
-class Action(Model):
+class Action(msrest.serialization.Model):
"""The action that will be executed.
- :param action_type: The type of the action. Possible values include:
- 'EmailContacts', 'AutoRenew'
+ :param action_type: The type of the action. Possible values include: "EmailContacts",
+ "AutoRenew".
:type action_type: str or ~azure.keyvault.v7_0.models.ActionType
"""
_attribute_map = {
- 'action_type': {'key': 'action_type', 'type': 'ActionType'},
+ 'action_type': {'key': 'action_type', 'type': 'str'},
}
- def __init__(self, *, action_type=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ action_type: Optional[Union[str, "ActionType"]] = None,
+ **kwargs
+ ):
super(Action, self).__init__(**kwargs)
self.action_type = action_type
-class AdministratorDetails(Model):
+class AdministratorDetails(msrest.serialization.Model):
"""Details of the organization administrator of the certificate issuer.
:param first_name: First name.
@@ -50,7 +57,15 @@ class AdministratorDetails(Model):
'phone': {'key': 'phone', 'type': 'str'},
}
- def __init__(self, *, first_name: str=None, last_name: str=None, email_address: str=None, phone: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ first_name: Optional[str] = None,
+ last_name: Optional[str] = None,
+ email_address: Optional[str] = None,
+ phone: Optional[str] = None,
+ **kwargs
+ ):
super(AdministratorDetails, self).__init__(**kwargs)
self.first_name = first_name
self.last_name = last_name
@@ -58,22 +73,21 @@ def __init__(self, *, first_name: str=None, last_name: str=None, email_address:
self.phone = phone
-class Attributes(Model):
+class Attributes(msrest.serialization.Model):
"""The object attributes managed by the KeyVault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -89,7 +103,14 @@ class Attributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
super(Attributes, self).__init__(**kwargs)
self.enabled = enabled
self.not_before = not_before
@@ -98,11 +119,10 @@ def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwarg
self.updated = None
-class BackupCertificateResult(Model):
+class BackupCertificateResult(msrest.serialization.Model):
"""The backup certificate result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up certificate.
:vartype value: bytes
@@ -116,16 +136,18 @@ class BackupCertificateResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupCertificateResult, self).__init__(**kwargs)
self.value = None
-class BackupKeyResult(Model):
+class BackupKeyResult(msrest.serialization.Model):
"""The backup key result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up key.
:vartype value: bytes
@@ -139,16 +161,18 @@ class BackupKeyResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupKeyResult, self).__init__(**kwargs)
self.value = None
-class BackupSecretResult(Model):
+class BackupSecretResult(msrest.serialization.Model):
"""The backup secret result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up secret.
:vartype value: bytes
@@ -162,16 +186,18 @@ class BackupSecretResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupSecretResult, self).__init__(**kwargs)
self.value = None
-class BackupStorageResult(Model):
+class BackupStorageResult(msrest.serialization.Model):
"""The backup storage result, containing the backup blob.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The backup blob containing the backed up storage account.
:vartype value: bytes
@@ -185,7 +211,10 @@ class BackupStorageResult(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(BackupStorageResult, self).__init__(**kwargs)
self.value = None
@@ -193,28 +222,25 @@ def __init__(self, **kwargs) -> None:
class CertificateAttributes(Attributes):
"""The certificate management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for certificates in the current vault. If it contains 'Purgeable',
- the certificate can be permanently deleted by a privileged user;
- otherwise, only the system can purge the certificate, at the end of the
- retention interval. Possible values include: 'Purgeable',
- 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for certificates
+ in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by
+ a privileged user; otherwise, only the system can purge the certificate, at the end of the
+ retention interval. Possible values include: "Purgeable", "Recoverable+Purgeable",
+ "Recoverable", "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
+ "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -232,16 +258,22 @@ class CertificateAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
super(CertificateAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs)
self.recovery_level = None
-class CertificateBundle(Model):
+class CertificateBundle(msrest.serialization.Model):
"""A certificate bundle consists of a certificate (X509) plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -259,7 +291,7 @@ class CertificateBundle(Model):
:type content_type: str
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -283,7 +315,15 @@ class CertificateBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ cer: Optional[bytearray] = None,
+ content_type: Optional[str] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateBundle, self).__init__(**kwargs)
self.id = None
self.kid = None
@@ -296,16 +336,14 @@ def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=No
self.tags = tags
-class CertificateCreateParameters(Model):
+class CertificateCreateParameters(msrest.serialization.Model):
"""The certificate create parameters.
:param certificate_policy: The management policy for the certificate.
:type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -315,32 +353,36 @@ class CertificateCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ certificate_policy: Optional["CertificatePolicy"] = None,
+ certificate_attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateCreateParameters, self).__init__(**kwargs)
self.certificate_policy = certificate_policy
self.certificate_attributes = certificate_attributes
self.tags = tags
-class CertificateImportParameters(Model):
+class CertificateImportParameters(msrest.serialization.Model):
"""The certificate import parameters.
All required parameters must be populated in order to send to Azure.
- :param base64_encoded_certificate: Required. Base64 encoded representation
- of the certificate object to import. This certificate needs to contain the
- private key.
+ :param base64_encoded_certificate: Required. Base64 encoded representation of the certificate
+ object to import. This certificate needs to contain the private key.
:type base64_encoded_certificate: str
- :param password: If the private key in base64EncodedCertificate is
- encrypted, the password used for encryption.
+ :param password: If the private key in base64EncodedCertificate is encrypted, the password used
+ for encryption.
:type password: str
:param certificate_policy: The management policy for the certificate.
:type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -356,7 +398,16 @@ class CertificateImportParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, base64_encoded_certificate: str, password: str=None, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ base64_encoded_certificate: str,
+ password: Optional[str] = None,
+ certificate_policy: Optional["CertificatePolicy"] = None,
+ certificate_attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateImportParameters, self).__init__(**kwargs)
self.base64_encoded_certificate = base64_encoded_certificate
self.password = password
@@ -365,7 +416,7 @@ def __init__(self, *, base64_encoded_certificate: str, password: str=None, certi
self.tags = tags
-class CertificateIssuerItem(Model):
+class CertificateIssuerItem(msrest.serialization.Model):
"""The certificate issuer item containing certificate issuer metadata.
:param id: Certificate Identifier.
@@ -379,21 +430,25 @@ class CertificateIssuerItem(Model):
'provider': {'key': 'provider', 'type': 'str'},
}
- def __init__(self, *, id: str=None, provider: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ provider: Optional[str] = None,
+ **kwargs
+ ):
super(CertificateIssuerItem, self).__init__(**kwargs)
self.id = id
self.provider = provider
-class CertificateIssuerListResult(Model):
+class CertificateIssuerListResult(msrest.serialization.Model):
"""The certificate issuer list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of certificate issuers
- in the key vault along with a link to the next page of certificate
- issuers.
+ :ivar value: A response message containing a list of certificate issuers in the key vault along
+ with a link to the next page of certificate issuers.
:vartype value: list[~azure.keyvault.v7_0.models.CertificateIssuerItem]
:ivar next_link: The URL to get the next set of certificate issuers.
:vartype next_link: str
@@ -409,13 +464,16 @@ class CertificateIssuerListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateIssuerListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class CertificateIssuerSetParameters(Model):
+class CertificateIssuerSetParameters(msrest.serialization.Model):
"""The certificate issuer set parameters.
All required parameters must be populated in order to send to Azure.
@@ -424,10 +482,8 @@ class CertificateIssuerSetParameters(Model):
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v7_0.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v7_0.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v7_0.models.IssuerAttributes
"""
@@ -443,7 +499,15 @@ class CertificateIssuerSetParameters(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, *, provider: str, credentials=None, organization_details=None, attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ provider: str,
+ credentials: Optional["IssuerCredentials"] = None,
+ organization_details: Optional["OrganizationDetails"] = None,
+ attributes: Optional["IssuerAttributes"] = None,
+ **kwargs
+ ):
super(CertificateIssuerSetParameters, self).__init__(**kwargs)
self.provider = provider
self.credentials = credentials
@@ -451,17 +515,15 @@ def __init__(self, *, provider: str, credentials=None, organization_details=None
self.attributes = attributes
-class CertificateIssuerUpdateParameters(Model):
+class CertificateIssuerUpdateParameters(msrest.serialization.Model):
"""The certificate issuer update parameters.
:param provider: The issuer provider.
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v7_0.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v7_0.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v7_0.models.IssuerAttributes
"""
@@ -473,7 +535,15 @@ class CertificateIssuerUpdateParameters(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, *, provider: str=None, credentials=None, organization_details=None, attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ provider: Optional[str] = None,
+ credentials: Optional["IssuerCredentials"] = None,
+ organization_details: Optional["OrganizationDetails"] = None,
+ attributes: Optional["IssuerAttributes"] = None,
+ **kwargs
+ ):
super(CertificateIssuerUpdateParameters, self).__init__(**kwargs)
self.provider = provider
self.credentials = credentials
@@ -481,14 +551,14 @@ def __init__(self, *, provider: str=None, credentials=None, organization_details
self.attributes = attributes
-class CertificateItem(Model):
+class CertificateItem(msrest.serialization.Model):
"""The certificate item containing certificate metadata.
:param id: Certificate identifier.
:type id: str
:param attributes: The certificate management attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param x509_thumbprint: Thumbprint of the certificate.
:type x509_thumbprint: bytes
@@ -501,7 +571,15 @@ class CertificateItem(Model):
'x509_thumbprint': {'key': 'x5t', 'type': 'base64'},
}
- def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint: bytes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ x509_thumbprint: Optional[bytes] = None,
+ **kwargs
+ ):
super(CertificateItem, self).__init__(**kwargs)
self.id = id
self.attributes = attributes
@@ -509,14 +587,13 @@ def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint:
self.x509_thumbprint = x509_thumbprint
-class CertificateListResult(Model):
+class CertificateListResult(msrest.serialization.Model):
"""The certificate list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of certificates in the
- key vault along with a link to the next page of certificates.
+ :ivar value: A response message containing a list of certificates in the key vault along with a
+ link to the next page of certificates.
:vartype value: list[~azure.keyvault.v7_0.models.CertificateItem]
:ivar next_link: The URL to get the next set of certificates.
:vartype next_link: str
@@ -532,25 +609,25 @@ class CertificateListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(CertificateListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class CertificateMergeParameters(Model):
+class CertificateMergeParameters(msrest.serialization.Model):
"""The certificate merge parameters.
All required parameters must be populated in order to send to Azure.
- :param x509_certificates: Required. The certificate or the certificate
- chain to merge.
+ :param x509_certificates: Required. The certificate or the certificate chain to merge.
:type x509_certificates: list[bytearray]
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -564,29 +641,34 @@ class CertificateMergeParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, x509_certificates, certificate_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ x509_certificates: List[bytearray],
+ certificate_attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateMergeParameters, self).__init__(**kwargs)
self.x509_certificates = x509_certificates
self.certificate_attributes = certificate_attributes
self.tags = tags
-class CertificateOperation(Model):
+class CertificateOperation(msrest.serialization.Model):
"""A certificate operation is returned in case of asynchronous requests.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
- :param issuer_parameters: Parameters for the issuer of the X509 component
- of a certificate.
+ :param issuer_parameters: Parameters for the issuer of the X509 component of a certificate.
:type issuer_parameters: ~azure.keyvault.v7_0.models.IssuerParameters
- :param csr: The certificate signing request (CSR) that is being used in
- the certificate operation.
+ :param csr: The certificate signing request (CSR) that is being used in the certificate
+ operation.
:type csr: bytearray
- :param cancellation_requested: Indicates if cancellation was requested on
- the certificate operation.
+ :param cancellation_requested: Indicates if cancellation was requested on the certificate
+ operation.
:type cancellation_requested: bool
:param status: Status of the certificate operation.
:type status: str
@@ -594,8 +676,7 @@ class CertificateOperation(Model):
:type status_details: str
:param error: Error encountered, if any, during the certificate operation.
:type error: ~azure.keyvault.v7_0.models.Error
- :param target: Location which contains the result of the certificate
- operation.
+ :param target: Location which contains the result of the certificate operation.
:type target: str
:param request_id: Identifier for the certificate operation.
:type request_id: str
@@ -617,7 +698,19 @@ class CertificateOperation(Model):
'request_id': {'key': 'request_id', 'type': 'str'},
}
- def __init__(self, *, issuer_parameters=None, csr: bytearray=None, cancellation_requested: bool=None, status: str=None, status_details: str=None, error=None, target: str=None, request_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ issuer_parameters: Optional["IssuerParameters"] = None,
+ csr: Optional[bytearray] = None,
+ cancellation_requested: Optional[bool] = None,
+ status: Optional[str] = None,
+ status_details: Optional[str] = None,
+ error: Optional["Error"] = None,
+ target: Optional[str] = None,
+ request_id: Optional[str] = None,
+ **kwargs
+ ):
super(CertificateOperation, self).__init__(**kwargs)
self.id = None
self.issuer_parameters = issuer_parameters
@@ -630,13 +723,13 @@ def __init__(self, *, issuer_parameters=None, csr: bytearray=None, cancellation_
self.request_id = request_id
-class CertificateOperationUpdateParameter(Model):
+class CertificateOperationUpdateParameter(msrest.serialization.Model):
"""The certificate operation update parameters.
All required parameters must be populated in order to send to Azure.
- :param cancellation_requested: Required. Indicates if cancellation was
- requested on the certificate operation.
+ :param cancellation_requested: Required. Indicates if cancellation was requested on the
+ certificate operation.
:type cancellation_requested: bool
"""
@@ -648,16 +741,20 @@ class CertificateOperationUpdateParameter(Model):
'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'},
}
- def __init__(self, *, cancellation_requested: bool, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ cancellation_requested: bool,
+ **kwargs
+ ):
super(CertificateOperationUpdateParameter, self).__init__(**kwargs)
self.cancellation_requested = cancellation_requested
-class CertificatePolicy(Model):
+class CertificatePolicy(msrest.serialization.Model):
"""Management policy for a certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -665,15 +762,12 @@ class CertificatePolicy(Model):
:type key_properties: ~azure.keyvault.v7_0.models.KeyProperties
:param secret_properties: Properties of the secret backing a certificate.
:type secret_properties: ~azure.keyvault.v7_0.models.SecretProperties
- :param x509_certificate_properties: Properties of the X509 component of a
+ :param x509_certificate_properties: Properties of the X509 component of a certificate.
+ :type x509_certificate_properties: ~azure.keyvault.v7_0.models.X509CertificateProperties
+ :param lifetime_actions: Actions that will be performed by Key Vault over the lifetime of a
certificate.
- :type x509_certificate_properties:
- ~azure.keyvault.v7_0.models.X509CertificateProperties
- :param lifetime_actions: Actions that will be performed by Key Vault over
- the lifetime of a certificate.
:type lifetime_actions: list[~azure.keyvault.v7_0.models.LifetimeAction]
- :param issuer_parameters: Parameters for the issuer of the X509 component
- of a certificate.
+ :param issuer_parameters: Parameters for the issuer of the X509 component of a certificate.
:type issuer_parameters: ~azure.keyvault.v7_0.models.IssuerParameters
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
@@ -693,7 +787,17 @@ class CertificatePolicy(Model):
'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'},
}
- def __init__(self, *, key_properties=None, secret_properties=None, x509_certificate_properties=None, lifetime_actions=None, issuer_parameters=None, attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key_properties: Optional["KeyProperties"] = None,
+ secret_properties: Optional["SecretProperties"] = None,
+ x509_certificate_properties: Optional["X509CertificateProperties"] = None,
+ lifetime_actions: Optional[List["LifetimeAction"]] = None,
+ issuer_parameters: Optional["IssuerParameters"] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ **kwargs
+ ):
super(CertificatePolicy, self).__init__(**kwargs)
self.id = None
self.key_properties = key_properties
@@ -704,13 +808,13 @@ def __init__(self, *, key_properties=None, secret_properties=None, x509_certific
self.attributes = attributes
-class CertificateRestoreParameters(Model):
+class CertificateRestoreParameters(msrest.serialization.Model):
"""The certificate restore parameters.
All required parameters must be populated in order to send to Azure.
- :param certificate_bundle_backup: Required. The backup blob associated
- with a certificate bundle.
+ :param certificate_bundle_backup: Required. The backup blob associated with a certificate
+ bundle.
:type certificate_bundle_backup: bytes
"""
@@ -722,21 +826,24 @@ class CertificateRestoreParameters(Model):
'certificate_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, certificate_bundle_backup: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ certificate_bundle_backup: bytes,
+ **kwargs
+ ):
super(CertificateRestoreParameters, self).__init__(**kwargs)
self.certificate_bundle_backup = certificate_bundle_backup
-class CertificateUpdateParameters(Model):
+class CertificateUpdateParameters(msrest.serialization.Model):
"""The certificate update parameters.
:param certificate_policy: The management policy for the certificate.
:type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param certificate_attributes: The attributes of the certificate (optional).
+ :type certificate_attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -746,14 +853,21 @@ class CertificateUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ certificate_policy: Optional["CertificatePolicy"] = None,
+ certificate_attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(CertificateUpdateParameters, self).__init__(**kwargs)
self.certificate_policy = certificate_policy
self.certificate_attributes = certificate_attributes
self.tags = tags
-class Contact(Model):
+class Contact(msrest.serialization.Model):
"""The contact information for the vault certificates.
:param email_address: Email address.
@@ -770,18 +884,24 @@ class Contact(Model):
'phone': {'key': 'phone', 'type': 'str'},
}
- def __init__(self, *, email_address: str=None, name: str=None, phone: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ email_address: Optional[str] = None,
+ name: Optional[str] = None,
+ phone: Optional[str] = None,
+ **kwargs
+ ):
super(Contact, self).__init__(**kwargs)
self.email_address = email_address
self.name = name
self.phone = phone
-class Contacts(Model):
+class Contacts(msrest.serialization.Model):
"""The contacts for the vault certificates.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Identifier for the contacts collection.
:vartype id: str
@@ -798,18 +918,21 @@ class Contacts(Model):
'contact_list': {'key': 'contacts', 'type': '[Contact]'},
}
- def __init__(self, *, contact_list=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ contact_list: Optional[List["Contact"]] = None,
+ **kwargs
+ ):
super(Contacts, self).__init__(**kwargs)
self.id = None
self.contact_list = contact_list
class DeletedCertificateBundle(CertificateBundle):
- """A Deleted Certificate consisting of its previous id, attributes and its
- tags, as well as information on when it will be purged.
+ """A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The certificate id.
:vartype id: str
@@ -827,16 +950,15 @@ class DeletedCertificateBundle(CertificateBundle):
:type content_type: str
:param attributes: The certificate attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted certificate.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ certificate.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the certificate is scheduled to
- be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the certificate was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the certificate is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the certificate was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -864,7 +986,16 @@ class DeletedCertificateBundle(CertificateBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ cer: Optional[bytearray] = None,
+ content_type: Optional[str] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedCertificateBundle, self).__init__(cer=cer, content_type=content_type, attributes=attributes, tags=tags, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
@@ -872,28 +1003,25 @@ def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=No
class DeletedCertificateItem(CertificateItem):
- """The deleted certificate item containing metadata about the deleted
- certificate.
+ """The deleted certificate item containing metadata about the deleted certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Certificate identifier.
:type id: str
:param attributes: The certificate management attributes.
:type attributes: ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param x509_thumbprint: Thumbprint of the certificate.
:type x509_thumbprint: bytes
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted certificate.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ certificate.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the certificate is scheduled to
- be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the certificate was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the certificate is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the certificate was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -911,21 +1039,29 @@ class DeletedCertificateItem(CertificateItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint: bytes=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ attributes: Optional["CertificateAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ x509_thumbprint: Optional[bytes] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedCertificateItem, self).__init__(id=id, attributes=attributes, tags=tags, x509_thumbprint=x509_thumbprint, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedCertificateListResult(Model):
+class DeletedCertificateListResult(msrest.serialization.Model):
"""A list of certificates that have been deleted in this vault.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of deleted certificates
- in the vault along with a link to the next page of deleted certificates
+ :ivar value: A response message containing a list of deleted certificates in the vault along
+ with a link to the next page of deleted certificates.
:vartype value: list[~azure.keyvault.v7_0.models.DeletedCertificateItem]
:ivar next_link: The URL to get the next set of deleted certificates.
:vartype next_link: str
@@ -941,26 +1077,28 @@ class DeletedCertificateListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedCertificateListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class KeyBundle(Model):
+class KeyBundle(msrest.serialization.Model):
"""A KeyBundle consisting of a WebKey plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param key: The Json web key.
:type key: ~azure.keyvault.v7_0.models.JsonWebKey
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
"""
@@ -975,7 +1113,14 @@ class KeyBundle(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, *, key=None, attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key: Optional["JsonWebKey"] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(KeyBundle, self).__init__(**kwargs)
self.key = key
self.attributes = attributes
@@ -984,29 +1129,26 @@ def __init__(self, *, key=None, attributes=None, tags=None, **kwargs) -> None:
class DeletedKeyBundle(KeyBundle):
- """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion
- info.
+ """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param key: The Json web key.
:type key: ~azure.keyvault.v7_0.models.JsonWebKey
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted key.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the key is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the key was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1025,27 +1167,34 @@ class DeletedKeyBundle(KeyBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, key=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key: Optional["JsonWebKey"] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedKeyBundle, self).__init__(key=key, attributes=attributes, tags=tags, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class KeyItem(Model):
+class KeyItem(msrest.serialization.Model):
"""The key item containing key metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param kid: Key identifier.
:type kid: str
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1060,7 +1209,14 @@ class KeyItem(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, *, kid: str=None, attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(KeyItem, self).__init__(**kwargs)
self.kid = kid
self.attributes = attributes
@@ -1069,29 +1225,26 @@ def __init__(self, *, kid: str=None, attributes=None, tags=None, **kwargs) -> No
class DeletedKeyItem(KeyItem):
- """The deleted key item containing the deleted key metadata and information
- about deletion.
+ """The deleted key item containing the deleted key metadata and information about deletion.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param kid: Key identifier.
:type kid: str
:param attributes: The key management attributes.
:type attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar managed: True if the key's lifetime is managed by key vault. If this
- is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted key.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the key is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the key was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1110,21 +1263,28 @@ class DeletedKeyItem(KeyItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, kid: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedKeyItem, self).__init__(kid=kid, attributes=attributes, tags=tags, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedKeyListResult(Model):
+class DeletedKeyListResult(msrest.serialization.Model):
"""A list of keys that have been deleted in this vault.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of deleted keys in the
- vault along with a link to the next page of deleted keys
+ :ivar value: A response message containing a list of deleted keys in the vault along with a
+ link to the next page of deleted keys.
:vartype value: list[~azure.keyvault.v7_0.models.DeletedKeyItem]
:ivar next_link: The URL to get the next set of deleted keys.
:vartype next_link: str
@@ -1140,36 +1300,36 @@ class DeletedKeyListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedKeyListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SasDefinitionBundle(Model):
- """A SAS definition bundle consists of key vault SAS definition details plus
- its attributes.
+class SasDefinitionBundle(msrest.serialization.Model):
+ """A SAS definition bundle consists of key vault SAS definition details plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The SAS definition id.
:vartype id: str
:ivar secret_id: Storage account SAS definition secret id.
:vartype secret_id: str
- :ivar template_uri: The SAS definition token template signed with an
- arbitrary key. Tokens created according to the SAS definition will have
- the same properties as the template.
+ :ivar template_uri: The SAS definition token template signed with an arbitrary key. Tokens
+ created according to the SAS definition will have the same properties as the template.
:vartype template_uri: str
- :ivar sas_type: The type of SAS token the SAS definition will create.
- Possible values include: 'account', 'service'
+ :ivar sas_type: The type of SAS token the SAS definition will create. Possible values include:
+ "account", "service".
:vartype sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :ivar validity_period: The validity period of SAS tokens created according
- to the SAS definition.
+ :ivar validity_period: The validity period of SAS tokens created according to the SAS
+ definition.
:vartype validity_period: str
:ivar attributes: The SAS definition attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -1193,7 +1353,10 @@ class SasDefinitionBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionBundle, self).__init__(**kwargs)
self.id = None
self.secret_id = None
@@ -1205,38 +1368,34 @@ def __init__(self, **kwargs) -> None:
class DeletedSasDefinitionBundle(SasDefinitionBundle):
- """A deleted SAS definition bundle consisting of its previous id, attributes
- and its tags, as well as information on when it will be purged.
+ """A deleted SAS definition bundle consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The SAS definition id.
:vartype id: str
:ivar secret_id: Storage account SAS definition secret id.
:vartype secret_id: str
- :ivar template_uri: The SAS definition token template signed with an
- arbitrary key. Tokens created according to the SAS definition will have
- the same properties as the template.
+ :ivar template_uri: The SAS definition token template signed with an arbitrary key. Tokens
+ created according to the SAS definition will have the same properties as the template.
:vartype template_uri: str
- :ivar sas_type: The type of SAS token the SAS definition will create.
- Possible values include: 'account', 'service'
+ :ivar sas_type: The type of SAS token the SAS definition will create. Possible values include:
+ "account", "service".
:vartype sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :ivar validity_period: The validity period of SAS tokens created according
- to the SAS definition.
+ :ivar validity_period: The validity period of SAS tokens created according to the SAS
+ definition.
:vartype validity_period: str
:ivar attributes: The SAS definition attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted SAS definition.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ SAS definition.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the SAS definition is scheduled
- to be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the SAS definition was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the SAS definition is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the SAS definition was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1264,18 +1423,22 @@ class DeletedSasDefinitionBundle(SasDefinitionBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedSasDefinitionBundle, self).__init__(**kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class SasDefinitionItem(Model):
+class SasDefinitionItem(msrest.serialization.Model):
"""The SAS definition item containing storage SAS definition metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage SAS identifier.
:vartype id: str
@@ -1283,7 +1446,7 @@ class SasDefinitionItem(Model):
:vartype secret_id: str
:ivar attributes: The SAS definition management attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -1301,7 +1464,10 @@ class SasDefinitionItem(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionItem, self).__init__(**kwargs)
self.id = None
self.secret_id = None
@@ -1310,11 +1476,9 @@ def __init__(self, **kwargs) -> None:
class DeletedSasDefinitionItem(SasDefinitionItem):
- """The deleted SAS definition item containing metadata about the deleted SAS
- definition.
+ """The deleted SAS definition item containing metadata about the deleted SAS definition.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage SAS identifier.
:vartype id: str
@@ -1322,16 +1486,15 @@ class DeletedSasDefinitionItem(SasDefinitionItem):
:vartype secret_id: str
:ivar attributes: The SAS definition management attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted SAS definition.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ SAS definition.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the SAS definition is scheduled
- to be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the SAS definition was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the SAS definition is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the SAS definition was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1353,22 +1516,25 @@ class DeletedSasDefinitionItem(SasDefinitionItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedSasDefinitionItem, self).__init__(**kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedSasDefinitionListResult(Model):
+class DeletedSasDefinitionListResult(msrest.serialization.Model):
"""The deleted SAS definition list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of the deleted SAS
- definitions in the vault along with a link to the next page of deleted sas
- definitions
+ :ivar value: A response message containing a list of the deleted SAS definitions in the vault
+ along with a link to the next page of deleted sas definitions.
:vartype value: list[~azure.keyvault.v7_0.models.DeletedSasDefinitionItem]
:ivar next_link: The URL to get the next set of deleted SAS definitions.
:vartype next_link: str
@@ -1384,17 +1550,19 @@ class DeletedSasDefinitionListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSasDefinitionListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SecretBundle(Model):
+class SecretBundle(msrest.serialization.Model):
"""A secret consisting of a value, id and its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param value: The secret value.
:type value: str
@@ -1404,13 +1572,13 @@ class SecretBundle(Model):
:type content_type: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar kid: If this is a secret backing a KV certificate, then this field
- specifies the corresponding key backing the KV certificate.
+ :ivar kid: If this is a secret backing a KV certificate, then this field specifies the
+ corresponding key backing the KV certificate.
:vartype kid: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a secret backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a secret
+ backing a certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1429,7 +1597,16 @@ class SecretBundle(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, *, value: str=None, id: str=None, content_type: str=None, attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ value: Optional[str] = None,
+ id: Optional[str] = None,
+ content_type: Optional[str] = None,
+ attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(SecretBundle, self).__init__(**kwargs)
self.value = value
self.id = id
@@ -1441,11 +1618,9 @@ def __init__(self, *, value: str=None, id: str=None, content_type: str=None, att
class DeletedSecretBundle(SecretBundle):
- """A Deleted Secret consisting of its previous id, attributes and its tags, as
- well as information on when it will be purged.
+ """A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param value: The secret value.
:type value: str
@@ -1455,22 +1630,21 @@ class DeletedSecretBundle(SecretBundle):
:type content_type: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :ivar kid: If this is a secret backing a KV certificate, then this field
- specifies the corresponding key backing the KV certificate.
+ :ivar kid: If this is a secret backing a KV certificate, then this field specifies the
+ corresponding key backing the KV certificate.
:vartype kid: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a secret backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a secret
+ backing a certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted secret.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ secret.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the secret is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the secret was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the secret is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the secret was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1493,29 +1667,38 @@ class DeletedSecretBundle(SecretBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, value: str=None, id: str=None, content_type: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ value: Optional[str] = None,
+ id: Optional[str] = None,
+ content_type: Optional[str] = None,
+ attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedSecretBundle, self).__init__(value=value, id=id, content_type=content_type, attributes=attributes, tags=tags, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class SecretItem(Model):
+class SecretItem(msrest.serialization.Model):
"""The secret item containing secret metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Secret identifier.
:type id: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a key backing
+ a certificate, then managed will be true.
:vartype managed: bool
"""
@@ -1531,7 +1714,15 @@ class SecretItem(Model):
'managed': {'key': 'managed', 'type': 'bool'},
}
- def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ content_type: Optional[str] = None,
+ **kwargs
+ ):
super(SecretItem, self).__init__(**kwargs)
self.id = id
self.attributes = attributes
@@ -1543,28 +1734,26 @@ def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: st
class DeletedSecretItem(SecretItem):
"""The deleted secret item containing metadata about the deleted secret.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param id: Secret identifier.
:type id: str
:param attributes: The secret management attributes.
:type attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
- :ivar managed: True if the secret's lifetime is managed by key vault. If
- this is a key backing a certificate, then managed will be true.
+ :ivar managed: True if the secret's lifetime is managed by key vault. If this is a key backing
+ a certificate, then managed will be true.
:vartype managed: bool
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted secret.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ secret.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the secret is scheduled to be
- purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the secret was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the secret is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the secret was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1584,21 +1773,29 @@ class DeletedSecretItem(SecretItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: str=None, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ content_type: Optional[str] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedSecretItem, self).__init__(id=id, attributes=attributes, tags=tags, content_type=content_type, **kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedSecretListResult(Model):
+class DeletedSecretListResult(msrest.serialization.Model):
"""The deleted secret list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of the deleted secrets
- in the vault along with a link to the next page of deleted secrets
+ :ivar value: A response message containing a list of the deleted secrets in the vault along
+ with a link to the next page of deleted secrets.
:vartype value: list[~azure.keyvault.v7_0.models.DeletedSecretItem]
:ivar next_link: The URL to get the next set of deleted secrets.
:vartype next_link: str
@@ -1614,17 +1811,19 @@ class DeletedSecretListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedSecretListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class StorageAccountItem(Model):
+class StorageAccountItem(msrest.serialization.Model):
"""The storage account item containing storage account metadata.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Storage identifier.
:vartype id: str
@@ -1632,7 +1831,7 @@ class StorageAccountItem(Model):
:vartype resource_id: str
:ivar attributes: The storage account management attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -1650,7 +1849,10 @@ class StorageAccountItem(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageAccountItem, self).__init__(**kwargs)
self.id = None
self.resource_id = None
@@ -1659,11 +1861,9 @@ def __init__(self, **kwargs) -> None:
class DeletedStorageAccountItem(StorageAccountItem):
- """The deleted storage account item containing metadata about the deleted
- storage account.
+ """The deleted storage account item containing metadata about the deleted storage account.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Storage identifier.
:vartype id: str
@@ -1671,16 +1871,16 @@ class DeletedStorageAccountItem(StorageAccountItem):
:vartype resource_id: str
:ivar attributes: The storage account management attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs.
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted storage account.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ storage account.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the storage account is scheduled
- to be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the storage account was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the storage account is scheduled to be purged, in
+ UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the storage account was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1702,19 +1902,22 @@ class DeletedStorageAccountItem(StorageAccountItem):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedStorageAccountItem, self).__init__(**kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class StorageBundle(Model):
- """A Storage account bundle consists of key vault storage account details plus
- its attributes.
+class StorageBundle(msrest.serialization.Model):
+ """A Storage account bundle consists of key vault storage account details plus its attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage account id.
:vartype id: str
@@ -1722,15 +1925,13 @@ class StorageBundle(Model):
:vartype resource_id: str
:ivar active_key_name: The current active storage account key name.
:vartype active_key_name: str
- :ivar auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :ivar auto_regenerate_key: whether keyvault should manage the storage account for the user.
:vartype auto_regenerate_key: bool
- :ivar regeneration_period: The key regeneration time duration specified in
- ISO-8601 format.
+ :ivar regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:vartype regeneration_period: str
:ivar attributes: The storage account attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
"""
@@ -1754,7 +1955,10 @@ class StorageBundle(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageBundle, self).__init__(**kwargs)
self.id = None
self.resource_id = None
@@ -1766,11 +1970,9 @@ def __init__(self, **kwargs) -> None:
class DeletedStorageBundle(StorageBundle):
- """A deleted storage account bundle consisting of its previous id, attributes
- and its tags, as well as information on when it will be purged.
+ """A deleted storage account bundle consisting of its previous id, attributes and its tags, as well as information on when it will be purged.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The storage account id.
:vartype id: str
@@ -1778,24 +1980,22 @@ class DeletedStorageBundle(StorageBundle):
:vartype resource_id: str
:ivar active_key_name: The current active storage account key name.
:vartype active_key_name: str
- :ivar auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :ivar auto_regenerate_key: whether keyvault should manage the storage account for the user.
:vartype auto_regenerate_key: bool
- :ivar regeneration_period: The key regeneration time duration specified in
- ISO-8601 format.
+ :ivar regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:vartype regeneration_period: str
:ivar attributes: The storage account attributes.
:vartype attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :ivar tags: Application specific metadata in the form of key-value pairs
+ :ivar tags: A set of tags. Application specific metadata in the form of key-value pairs.
:vartype tags: dict[str, str]
- :param recovery_id: The url of the recovery object, used to identify and
- recover the deleted storage account.
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ storage account.
:type recovery_id: str
- :ivar scheduled_purge_date: The time when the storage account is scheduled
- to be purged, in UTC
- :vartype scheduled_purge_date: datetime
- :ivar deleted_date: The time when the storage account was deleted, in UTC
- :vartype deleted_date: datetime
+ :ivar scheduled_purge_date: The time when the storage account is scheduled to be purged, in
+ UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the storage account was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
"""
_validation = {
@@ -1823,24 +2023,26 @@ class DeletedStorageBundle(StorageBundle):
'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
}
- def __init__(self, *, recovery_id: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
super(DeletedStorageBundle, self).__init__(**kwargs)
self.recovery_id = recovery_id
self.scheduled_purge_date = None
self.deleted_date = None
-class DeletedStorageListResult(Model):
+class DeletedStorageListResult(msrest.serialization.Model):
"""The deleted storage account list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of the deleted storage
- accounts in the vault along with a link to the next page of deleted
- storage accounts
- :vartype value:
- list[~azure.keyvault.v7_0.models.DeletedStorageAccountItem]
+ :ivar value: A response message containing a list of the deleted storage accounts in the vault
+ along with a link to the next page of deleted storage accounts.
+ :vartype value: list[~azure.keyvault.v7_0.models.DeletedStorageAccountItem]
:ivar next_link: The URL to get the next set of deleted storage accounts.
:vartype next_link: str
"""
@@ -1855,23 +2057,25 @@ class DeletedStorageListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(DeletedStorageListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class Error(Model):
+class Error(msrest.serialization.Model):
"""The key vault server error.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: The error code.
:vartype code: str
:ivar message: The error message.
:vartype message: str
- :ivar inner_error:
+ :ivar inner_error: The key vault server error.
:vartype inner_error: ~azure.keyvault.v7_0.models.Error
"""
@@ -1887,25 +2091,27 @@ class Error(Model):
'inner_error': {'key': 'innererror', 'type': 'Error'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(Error, self).__init__(**kwargs)
self.code = None
self.message = None
self.inner_error = None
-class IssuerAttributes(Model):
+class IssuerAttributes(msrest.serialization.Model):
"""The attributes of an issuer managed by the Key Vault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the issuer is enabled.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
+ :vartype updated: ~datetime.datetime
"""
_validation = {
@@ -1919,18 +2125,22 @@ class IssuerAttributes(Model):
'updated': {'key': 'updated', 'type': 'unix-time'},
}
- def __init__(self, *, enabled: bool=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ **kwargs
+ ):
super(IssuerAttributes, self).__init__(**kwargs)
self.enabled = enabled
self.created = None
self.updated = None
-class IssuerBundle(Model):
+class IssuerBundle(msrest.serialization.Model):
"""The issuer for Key Vault certificate.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Identifier for the issuer object.
:vartype id: str
@@ -1938,10 +2148,8 @@ class IssuerBundle(Model):
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials
- :param organization_details: Details of the organization as provided to
- the issuer.
- :type organization_details:
- ~azure.keyvault.v7_0.models.OrganizationDetails
+ :param organization_details: Details of the organization as provided to the issuer.
+ :type organization_details: ~azure.keyvault.v7_0.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v7_0.models.IssuerAttributes
"""
@@ -1958,7 +2166,15 @@ class IssuerBundle(Model):
'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'},
}
- def __init__(self, *, provider: str=None, credentials=None, organization_details=None, attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ provider: Optional[str] = None,
+ credentials: Optional["IssuerCredentials"] = None,
+ organization_details: Optional["OrganizationDetails"] = None,
+ attributes: Optional["IssuerAttributes"] = None,
+ **kwargs
+ ):
super(IssuerBundle, self).__init__(**kwargs)
self.id = None
self.provider = provider
@@ -1967,7 +2183,7 @@ def __init__(self, *, provider: str=None, credentials=None, organization_details
self.attributes = attributes
-class IssuerCredentials(Model):
+class IssuerCredentials(msrest.serialization.Model):
"""The credentials to be used for the certificate issuer.
:param account_id: The user name/account name/account id.
@@ -1981,23 +2197,29 @@ class IssuerCredentials(Model):
'password': {'key': 'pwd', 'type': 'str'},
}
- def __init__(self, *, account_id: str=None, password: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ account_id: Optional[str] = None,
+ password: Optional[str] = None,
+ **kwargs
+ ):
super(IssuerCredentials, self).__init__(**kwargs)
self.account_id = account_id
self.password = password
-class IssuerParameters(Model):
+class IssuerParameters(msrest.serialization.Model):
"""Parameters for the issuer of the X509 component of a certificate.
- :param name: Name of the referenced issuer object or reserved names; for
- example, 'Self' or 'Unknown'.
+ :param name: Name of the referenced issuer object or reserved names; for example, 'Self' or
+ 'Unknown'.
:type name: str
- :param certificate_type: Type of certificate to be requested from the
- issuer provider.
+ :param certificate_type: Certificate type as supported by the provider (optional); for example
+ 'OV-SSL', 'EV-SSL'.
:type certificate_type: str
- :param certificate_transparency: Indicates if the certificates generated
- under this policy should be published to certificate transparency logs.
+ :param certificate_transparency: Indicates if the certificates generated under this policy
+ should be published to certificate transparency logs.
:type certificate_transparency: bool
"""
@@ -2007,21 +2229,27 @@ class IssuerParameters(Model):
'certificate_transparency': {'key': 'cert_transparency', 'type': 'bool'},
}
- def __init__(self, *, name: str=None, certificate_type: str=None, certificate_transparency: bool=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ certificate_type: Optional[str] = None,
+ certificate_transparency: Optional[bool] = None,
+ **kwargs
+ ):
super(IssuerParameters, self).__init__(**kwargs)
self.name = name
self.certificate_type = certificate_type
self.certificate_transparency = certificate_transparency
-class JsonWebKey(Model):
+class JsonWebKey(msrest.serialization.Model):
"""As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18.
:param kid: Key identifier.
:type kid: str
- :param kty: JsonWebKey Key Type (kty), as defined in
- https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40.
- Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'
+ :param kty: JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-
+ jose-json-web-algorithms-40. Possible values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
:type kty: str or ~azure.keyvault.v7_0.models.JsonWebKeyType
:param key_ops:
:type key_ops: list[str]
@@ -2045,9 +2273,8 @@ class JsonWebKey(Model):
:type k: bytes
:param t: HSM Token, used with 'Bring Your Own Key'.
:type t: bytes
- :param crv: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'P-256K'
+ :param crv: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
:type crv: str or ~azure.keyvault.v7_0.models.JsonWebKeyCurveName
:param x: X component of an EC public key.
:type x: bytes
@@ -2074,7 +2301,27 @@ class JsonWebKey(Model):
'y': {'key': 'y', 'type': 'base64'},
}
- def __init__(self, *, kid: str=None, kty=None, key_ops=None, n: bytes=None, e: bytes=None, d: bytes=None, dp: bytes=None, dq: bytes=None, qi: bytes=None, p: bytes=None, q: bytes=None, k: bytes=None, t: bytes=None, crv=None, x: bytes=None, y: bytes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ kty: Optional[Union[str, "JsonWebKeyType"]] = None,
+ key_ops: Optional[List[str]] = None,
+ n: Optional[bytes] = None,
+ e: Optional[bytes] = None,
+ d: Optional[bytes] = None,
+ dp: Optional[bytes] = None,
+ dq: Optional[bytes] = None,
+ qi: Optional[bytes] = None,
+ p: Optional[bytes] = None,
+ q: Optional[bytes] = None,
+ k: Optional[bytes] = None,
+ t: Optional[bytes] = None,
+ crv: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
+ x: Optional[bytes] = None,
+ y: Optional[bytes] = None,
+ **kwargs
+ ):
super(JsonWebKey, self).__init__(**kwargs)
self.kid = kid
self.kty = kty
@@ -2097,27 +2344,25 @@ def __init__(self, *, kid: str=None, kty=None, key_ops=None, n: bytes=None, e: b
class KeyAttributes(Attributes):
"""The attributes of a key managed by the key vault service.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for keys in the current vault. If it contains 'Purgeable' the key
- can be permanently deleted by a privileged user; otherwise, only the
- system can purge the key, at the end of the retention interval. Possible
- values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for keys in the
+ current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged
+ user; otherwise, only the system can purge the key, at the end of the retention interval.
+ Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
+ "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2135,38 +2380,41 @@ class KeyAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
super(KeyAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs)
self.recovery_level = None
-class KeyCreateParameters(Model):
+class KeyCreateParameters(msrest.serialization.Model):
"""The key create parameters.
All required parameters must be populated in order to send to Azure.
- :param kty: Required. The type of key to create. For valid values, see
- JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM',
- 'oct'
+ :param kty: Required. The type of key to create. For valid values, see JsonWebKeyType. Possible
+ values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
:type kty: str or ~azure.keyvault.v7_0.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or 4096
- for RSA.
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
:type key_size: int
:param key_ops:
- :type key_ops: list[str or
- ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
- :param key_attributes:
+ :type key_ops: list[str or ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
:type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'P-256K'
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
:type curve: str or ~azure.keyvault.v7_0.models.JsonWebKeyCurveName
"""
_validation = {
- 'kty': {'required': True, 'min_length': 1},
+ 'kty': {'required': True},
}
_attribute_map = {
@@ -2178,7 +2426,17 @@ class KeyCreateParameters(Model):
'curve': {'key': 'crv', 'type': 'str'},
}
- def __init__(self, *, kty, key_size: int=None, key_ops=None, key_attributes=None, tags=None, curve=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ kty: Union[str, "JsonWebKeyType"],
+ key_size: Optional[int] = None,
+ key_ops: Optional[List[Union[str, "JsonWebKeyOperation"]]] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ curve: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
+ **kwargs
+ ):
super(KeyCreateParameters, self).__init__(**kwargs)
self.kty = kty
self.key_size = key_size
@@ -2188,18 +2446,18 @@ def __init__(self, *, kty, key_size: int=None, key_ops=None, key_attributes=None
self.curve = curve
-class KeyImportParameters(Model):
+class KeyImportParameters(msrest.serialization.Model):
"""The key import parameters.
All required parameters must be populated in order to send to Azure.
:param hsm: Whether to import as a hardware key (HSM) or software key.
:type hsm: bool
- :param key: Required. The Json web key
+ :param key: Required. The Json web key.
:type key: ~azure.keyvault.v7_0.models.JsonWebKey
:param key_attributes: The key management attributes.
:type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2214,7 +2472,15 @@ class KeyImportParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, key, hsm: bool=None, key_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key: "JsonWebKey",
+ hsm: Optional[bool] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(KeyImportParameters, self).__init__(**kwargs)
self.hsm = hsm
self.key = key
@@ -2222,14 +2488,13 @@ def __init__(self, *, key, hsm: bool=None, key_attributes=None, tags=None, **kwa
self.tags = tags
-class KeyListResult(Model):
+class KeyListResult(msrest.serialization.Model):
"""The key list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of keys in the key vault
- along with a link to the next page of keys.
+ :ivar value: A response message containing a list of keys in the key vault along with a link to
+ the next page of keys.
:vartype value: list[~azure.keyvault.v7_0.models.KeyItem]
:ivar next_link: The URL to get the next set of keys.
:vartype next_link: str
@@ -2245,19 +2510,21 @@ class KeyListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class KeyOperationResult(Model):
+class KeyOperationResult(msrest.serialization.Model):
"""The key operation result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar kid: Key identifier
+ :ivar kid: Key identifier.
:vartype kid: str
:ivar result:
:vartype result: bytes
@@ -2273,27 +2540,29 @@ class KeyOperationResult(Model):
'result': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyOperationResult, self).__init__(**kwargs)
self.kid = None
self.result = None
-class KeyOperationsParameters(Model):
+class KeyOperationsParameters(msrest.serialization.Model):
"""The key operations parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeyEncryptionAlgorithm
+ :param algorithm: Required. algorithm identifier. Possible values include: "RSA-OAEP", "RSA-
+ OAEP-256", "RSA1_5".
+ :type algorithm: str or ~azure.keyvault.v7_0.models.JsonWebKeyEncryptionAlgorithm
:param value: Required.
:type value: bytes
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'value': {'required': True},
}
@@ -2302,29 +2571,32 @@ class KeyOperationsParameters(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, algorithm, value: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeyEncryptionAlgorithm"],
+ value: bytes,
+ **kwargs
+ ):
super(KeyOperationsParameters, self).__init__(**kwargs)
self.algorithm = algorithm
self.value = value
-class KeyProperties(Model):
+class KeyProperties(msrest.serialization.Model):
"""Properties of the key pair backing a certificate.
:param exportable: Indicates if the private key can be exported.
:type exportable: bool
- :param key_type: The type of key pair to be used for the certificate.
- Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'
+ :param key_type: The type of key pair to be used for the certificate. Possible values include:
+ "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
:type key_type: str or ~azure.keyvault.v7_0.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or 4096
- for RSA.
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
:type key_size: int
- :param reuse_key: Indicates if the same key pair will be used on
- certificate renewal.
+ :param reuse_key: Indicates if the same key pair will be used on certificate renewal.
:type reuse_key: bool
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521',
- 'P-256K'
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
:type curve: str or ~azure.keyvault.v7_0.models.JsonWebKeyCurveName
"""
@@ -2336,7 +2608,16 @@ class KeyProperties(Model):
'curve': {'key': 'crv', 'type': 'str'},
}
- def __init__(self, *, exportable: bool=None, key_type=None, key_size: int=None, reuse_key: bool=None, curve=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ exportable: Optional[bool] = None,
+ key_type: Optional[Union[str, "JsonWebKeyType"]] = None,
+ key_size: Optional[int] = None,
+ reuse_key: Optional[bool] = None,
+ curve: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
+ **kwargs
+ ):
super(KeyProperties, self).__init__(**kwargs)
self.exportable = exportable
self.key_type = key_type
@@ -2345,13 +2626,12 @@ def __init__(self, *, exportable: bool=None, key_type=None, key_size: int=None,
self.curve = curve
-class KeyRestoreParameters(Model):
+class KeyRestoreParameters(msrest.serialization.Model):
"""The key restore parameters.
All required parameters must be populated in order to send to Azure.
- :param key_bundle_backup: Required. The backup blob associated with a key
- bundle.
+ :param key_bundle_backup: Required. The backup blob associated with a key bundle.
:type key_bundle_backup: bytes
"""
@@ -2363,29 +2643,32 @@ class KeyRestoreParameters(Model):
'key_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, key_bundle_backup: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key_bundle_backup: bytes,
+ **kwargs
+ ):
super(KeyRestoreParameters, self).__init__(**kwargs)
self.key_bundle_backup = key_bundle_backup
-class KeySignParameters(Model):
+class KeySignParameters(msrest.serialization.Model):
"""The key operations parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. The signing/verification algorithm identifier.
- For more information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384',
- 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512',
- 'ES256K'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
+ :param algorithm: Required. The signing/verification algorithm identifier. For more information
+ on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include:
+ "PS256", "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512",
+ "ES256K".
+ :type algorithm: str or ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
:param value: Required.
:type value: bytes
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'value': {'required': True},
}
@@ -2394,22 +2677,27 @@ class KeySignParameters(Model):
'value': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, algorithm, value: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeySignatureAlgorithm"],
+ value: bytes,
+ **kwargs
+ ):
super(KeySignParameters, self).__init__(**kwargs)
self.algorithm = algorithm
self.value = value
-class KeyUpdateParameters(Model):
+class KeyUpdateParameters(msrest.serialization.Model):
"""The key update parameters.
- :param key_ops: Json web key operations. For more information on possible
- key operations, see JsonWebKeyOperation.
- :type key_ops: list[str or
- ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
- :param key_attributes:
+ :param key_ops: Json web key operations. For more information on possible key operations, see
+ JsonWebKeyOperation.
+ :type key_ops: list[str or ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
:type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2419,20 +2707,26 @@ class KeyUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, key_ops=None, key_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key_ops: Optional[List[Union[str, "JsonWebKeyOperation"]]] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(KeyUpdateParameters, self).__init__(**kwargs)
self.key_ops = key_ops
self.key_attributes = key_attributes
self.tags = tags
-class KeyVaultError(Model):
+class KeyVaultError(msrest.serialization.Model):
"""The key vault error exception.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar error:
+ :ivar error: The key vault server error.
:vartype error: ~azure.keyvault.v7_0.models.Error
"""
@@ -2444,38 +2738,23 @@ class KeyVaultError(Model):
'error': {'key': 'error', 'type': 'Error'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVaultError, self).__init__(**kwargs)
self.error = None
-class KeyVaultErrorException(HttpResponseError):
- """Server responsed with exception of type: 'KeyVaultError'.
-
- :param deserialize: A deserializer
- :param response: Server response to be deserialized.
- """
-
- def __init__(self, response, deserialize, *args):
-
- model_name = 'KeyVaultError'
- self.error = deserialize(model_name, response)
- if self.error is None:
- self.error = deserialize.dependencies[model_name]()
- super(KeyVaultErrorException, self).__init__(response=response)
-
-
-class KeyVerifyParameters(Model):
+class KeyVerifyParameters(msrest.serialization.Model):
"""The key verify parameters.
All required parameters must be populated in order to send to Azure.
- :param algorithm: Required. The signing/verification algorithm. For more
- information on possible algorithm types, see JsonWebKeySignatureAlgorithm.
- Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384',
- 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
+ :param algorithm: Required. The signing/verification algorithm. For more information on
+ possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: "PS256",
+ "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512", "ES256K".
+ :type algorithm: str or ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
:param digest: Required. The digest used for signing.
:type digest: bytes
:param signature: Required. The signature to be verified.
@@ -2483,7 +2762,7 @@ class KeyVerifyParameters(Model):
"""
_validation = {
- 'algorithm': {'required': True, 'min_length': 1},
+ 'algorithm': {'required': True},
'digest': {'required': True},
'signature': {'required': True},
}
@@ -2494,18 +2773,24 @@ class KeyVerifyParameters(Model):
'signature': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, algorithm, digest: bytes, signature: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeySignatureAlgorithm"],
+ digest: bytes,
+ signature: bytes,
+ **kwargs
+ ):
super(KeyVerifyParameters, self).__init__(**kwargs)
self.algorithm = algorithm
self.digest = digest
self.signature = signature
-class KeyVerifyResult(Model):
+class KeyVerifyResult(msrest.serialization.Model):
"""The key verify result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: True if the signature is verified, otherwise false.
:vartype value: bool
@@ -2519,14 +2804,16 @@ class KeyVerifyResult(Model):
'value': {'key': 'value', 'type': 'bool'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(KeyVerifyResult, self).__init__(**kwargs)
self.value = None
-class LifetimeAction(Model):
- """Action and its trigger that will be performed by Key Vault over the
- lifetime of a certificate.
+class LifetimeAction(msrest.serialization.Model):
+ """Action and its trigger that will be performed by Key Vault over the lifetime of a certificate.
:param trigger: The condition that will execute the action.
:type trigger: ~azure.keyvault.v7_0.models.Trigger
@@ -2539,20 +2826,25 @@ class LifetimeAction(Model):
'action': {'key': 'action', 'type': 'Action'},
}
- def __init__(self, *, trigger=None, action=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ trigger: Optional["Trigger"] = None,
+ action: Optional["Action"] = None,
+ **kwargs
+ ):
super(LifetimeAction, self).__init__(**kwargs)
self.trigger = trigger
self.action = action
-class OrganizationDetails(Model):
+class OrganizationDetails(msrest.serialization.Model):
"""Details of the organization of the certificate issuer.
:param id: Id of the organization.
:type id: str
:param admin_details: Details of the organization administrator.
- :type admin_details:
- list[~azure.keyvault.v7_0.models.AdministratorDetails]
+ :type admin_details: list[~azure.keyvault.v7_0.models.AdministratorDetails]
"""
_attribute_map = {
@@ -2560,20 +2852,24 @@ class OrganizationDetails(Model):
'admin_details': {'key': 'admin_details', 'type': '[AdministratorDetails]'},
}
- def __init__(self, *, id: str=None, admin_details=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None,
+ admin_details: Optional[List["AdministratorDetails"]] = None,
+ **kwargs
+ ):
super(OrganizationDetails, self).__init__(**kwargs)
self.id = id
self.admin_details = admin_details
-class PendingCertificateSigningRequestResult(Model):
+class PendingCertificateSigningRequestResult(msrest.serialization.Model):
"""The pending certificate signing request result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: The pending certificate signing request as Base64 encoded
- string.
+ :ivar value: The pending certificate signing request as Base64 encoded string.
:vartype value: str
"""
@@ -2585,32 +2881,33 @@ class PendingCertificateSigningRequestResult(Model):
'value': {'key': 'value', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(PendingCertificateSigningRequestResult, self).__init__(**kwargs)
self.value = None
-class SasDefinitionAttributes(Model):
+class SasDefinitionAttributes(msrest.serialization.Model):
"""The SAS definition management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: the enabled state of the object.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for SAS definitions in the current vault. If it contains
- 'Purgeable' the SAS definition can be permanently deleted by a privileged
- user; otherwise, only the system can purge the SAS definition, at the end
- of the retention interval. Possible values include: 'Purgeable',
- 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for SAS
+ definitions in the current vault. If it contains 'Purgeable' the SAS definition can be
+ permanently deleted by a privileged user; otherwise, only the system can purge the SAS
+ definition, at the end of the retention interval. Possible values include: "Purgeable",
+ "Recoverable+Purgeable", "Recoverable", "Recoverable+ProtectedSubscription",
+ "CustomizedRecoverable+Purgeable", "CustomizedRecoverable",
+ "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2626,7 +2923,12 @@ class SasDefinitionAttributes(Model):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, *, enabled: bool=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ **kwargs
+ ):
super(SasDefinitionAttributes, self).__init__(**kwargs)
self.enabled = enabled
self.created = None
@@ -2634,25 +2936,23 @@ def __init__(self, *, enabled: bool=None, **kwargs) -> None:
self.recovery_level = None
-class SasDefinitionCreateParameters(Model):
+class SasDefinitionCreateParameters(msrest.serialization.Model):
"""The SAS definition create parameters.
All required parameters must be populated in order to send to Azure.
- :param template_uri: Required. The SAS definition token template signed
- with an arbitrary key. Tokens created according to the SAS definition
- will have the same properties as the template.
+ :param template_uri: Required. The SAS definition token template signed with an arbitrary key.
+ Tokens created according to the SAS definition will have the same properties as the template.
:type template_uri: str
- :param sas_type: Required. The type of SAS token the SAS definition will
- create. Possible values include: 'account', 'service'
+ :param sas_type: Required. The type of SAS token the SAS definition will create. Possible
+ values include: "account", "service".
:type sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :param validity_period: Required. The validity period of SAS tokens
- created according to the SAS definition.
+ :param validity_period: Required. The validity period of SAS tokens created according to the
+ SAS definition.
:type validity_period: str
:param sas_definition_attributes: The attributes of the SAS definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type sas_definition_attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2670,7 +2970,16 @@ class SasDefinitionCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, template_uri: str, sas_type, validity_period: str, sas_definition_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ template_uri: str,
+ sas_type: Union[str, "SasTokenType"],
+ validity_period: str,
+ sas_definition_attributes: Optional["SasDefinitionAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(SasDefinitionCreateParameters, self).__init__(**kwargs)
self.template_uri = template_uri
self.sas_type = sas_type
@@ -2679,14 +2988,13 @@ def __init__(self, *, template_uri: str, sas_type, validity_period: str, sas_def
self.tags = tags
-class SasDefinitionListResult(Model):
+class SasDefinitionListResult(msrest.serialization.Model):
"""The storage account SAS definition list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of SAS definitions along
- with a link to the next page of SAS definitions.
+ :ivar value: A response message containing a list of SAS definitions along with a link to the
+ next page of SAS definitions.
:vartype value: list[~azure.keyvault.v7_0.models.SasDefinitionItem]
:ivar next_link: The URL to get the next set of SAS definitions.
:vartype next_link: str
@@ -2702,29 +3010,30 @@ class SasDefinitionListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SasDefinitionListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SasDefinitionUpdateParameters(Model):
+class SasDefinitionUpdateParameters(msrest.serialization.Model):
"""The SAS definition update parameters.
- :param template_uri: The SAS definition token template signed with an
- arbitrary key. Tokens created according to the SAS definition will have
- the same properties as the template.
+ :param template_uri: The SAS definition token template signed with an arbitrary key. Tokens
+ created according to the SAS definition will have the same properties as the template.
:type template_uri: str
- :param sas_type: The type of SAS token the SAS definition will create.
- Possible values include: 'account', 'service'
+ :param sas_type: The type of SAS token the SAS definition will create. Possible values include:
+ "account", "service".
:type sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :param validity_period: The validity period of SAS tokens created
- according to the SAS definition.
+ :param validity_period: The validity period of SAS tokens created according to the SAS
+ definition.
:type validity_period: str
:param sas_definition_attributes: The attributes of the SAS definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type sas_definition_attributes: ~azure.keyvault.v7_0.models.SasDefinitionAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2736,7 +3045,16 @@ class SasDefinitionUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, template_uri: str=None, sas_type=None, validity_period: str=None, sas_definition_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ template_uri: Optional[str] = None,
+ sas_type: Optional[Union[str, "SasTokenType"]] = None,
+ validity_period: Optional[str] = None,
+ sas_definition_attributes: Optional["SasDefinitionAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(SasDefinitionUpdateParameters, self).__init__(**kwargs)
self.template_uri = template_uri
self.sas_type = sas_type
@@ -2748,27 +3066,25 @@ def __init__(self, *, template_uri: str=None, sas_type=None, validity_period: st
class SecretAttributes(Attributes):
"""The secret management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param not_before: Not before date in UTC.
- :type not_before: datetime
+ :type not_before: ~datetime.datetime
:param expires: Expiry date in UTC.
- :type expires: datetime
+ :type expires: ~datetime.datetime
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for secrets in the current vault. If it contains 'Purgeable', the
- secret can be permanently deleted by a privileged user; otherwise, only
- the system can purge the secret, at the end of the retention interval.
- Possible values include: 'Purgeable', 'Recoverable+Purgeable',
- 'Recoverable', 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for secrets in
+ the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a
+ privileged user; otherwise, only the system can purge the secret, at the end of the retention
+ interval. Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
+ "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2786,19 +3102,25 @@ class SecretAttributes(Attributes):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
super(SecretAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs)
self.recovery_level = None
-class SecretListResult(Model):
+class SecretListResult(msrest.serialization.Model):
"""The secret list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of secrets in the key
- vault along with a link to the next page of secrets.
+ :ivar value: A response message containing a list of secrets in the key vault along with a link
+ to the next page of secrets.
:vartype value: list[~azure.keyvault.v7_0.models.SecretItem]
:ivar next_link: The URL to get the next set of secrets.
:vartype next_link: str
@@ -2814,13 +3136,16 @@ class SecretListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(SecretListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class SecretProperties(Model):
+class SecretProperties(msrest.serialization.Model):
"""Properties of the key backing a certificate.
:param content_type: The media type (MIME type).
@@ -2831,18 +3156,22 @@ class SecretProperties(Model):
'content_type': {'key': 'contentType', 'type': 'str'},
}
- def __init__(self, *, content_type: str=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ content_type: Optional[str] = None,
+ **kwargs
+ ):
super(SecretProperties, self).__init__(**kwargs)
self.content_type = content_type
-class SecretRestoreParameters(Model):
+class SecretRestoreParameters(msrest.serialization.Model):
"""The secret restore parameters.
All required parameters must be populated in order to send to Azure.
- :param secret_bundle_backup: Required. The backup blob associated with a
- secret bundle.
+ :param secret_bundle_backup: Required. The backup blob associated with a secret bundle.
:type secret_bundle_backup: bytes
"""
@@ -2854,19 +3183,24 @@ class SecretRestoreParameters(Model):
'secret_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, secret_bundle_backup: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ secret_bundle_backup: bytes,
+ **kwargs
+ ):
super(SecretRestoreParameters, self).__init__(**kwargs)
self.secret_bundle_backup = secret_bundle_backup
-class SecretSetParameters(Model):
+class SecretSetParameters(msrest.serialization.Model):
"""The secret set parameters.
All required parameters must be populated in order to send to Azure.
:param value: Required. The value of the secret.
:type value: str
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
@@ -2885,7 +3219,15 @@ class SecretSetParameters(Model):
'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'},
}
- def __init__(self, *, value: str, tags=None, content_type: str=None, secret_attributes=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ value: str,
+ tags: Optional[Dict[str, str]] = None,
+ content_type: Optional[str] = None,
+ secret_attributes: Optional["SecretAttributes"] = None,
+ **kwargs
+ ):
super(SecretSetParameters, self).__init__(**kwargs)
self.value = value
self.tags = tags
@@ -2893,14 +3235,14 @@ def __init__(self, *, value: str, tags=None, content_type: str=None, secret_attr
self.secret_attributes = secret_attributes
-class SecretUpdateParameters(Model):
+class SecretUpdateParameters(msrest.serialization.Model):
"""The secret update parameters.
:param content_type: Type of the secret value such as a password.
:type content_type: str
:param secret_attributes: The secret management attributes.
:type secret_attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2910,34 +3252,39 @@ class SecretUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, content_type: str=None, secret_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ content_type: Optional[str] = None,
+ secret_attributes: Optional["SecretAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(SecretUpdateParameters, self).__init__(**kwargs)
self.content_type = content_type
self.secret_attributes = secret_attributes
self.tags = tags
-class StorageAccountAttributes(Model):
+class StorageAccountAttributes(msrest.serialization.Model):
"""The storage account management attributes.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
:param enabled: the enabled state of the object.
:type enabled: bool
:ivar created: Creation time in UTC.
- :vartype created: datetime
+ :vartype created: ~datetime.datetime
:ivar updated: Last updated time in UTC.
- :vartype updated: datetime
- :ivar recovery_level: Reflects the deletion recovery level currently in
- effect for storage accounts in the current vault. If it contains
- 'Purgeable' the storage account can be permanently deleted by a privileged
- user; otherwise, only the system can purge the storage account, at the end
- of the retention interval. Possible values include: 'Purgeable',
- 'Recoverable+Purgeable', 'Recoverable',
- 'Recoverable+ProtectedSubscription'
- :vartype recovery_level: str or
- ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
+ :vartype updated: ~datetime.datetime
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for storage
+ accounts in the current vault. If it contains 'Purgeable' the storage account can be
+ permanently deleted by a privileged user; otherwise, only the system can purge the storage
+ account, at the end of the retention interval. Possible values include: "Purgeable",
+ "Recoverable+Purgeable", "Recoverable", "Recoverable+ProtectedSubscription",
+ "CustomizedRecoverable+Purgeable", "CustomizedRecoverable",
+ "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_0.models.DeletionRecoveryLevel
"""
_validation = {
@@ -2953,7 +3300,12 @@ class StorageAccountAttributes(Model):
'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
}
- def __init__(self, *, enabled: bool=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ **kwargs
+ ):
super(StorageAccountAttributes, self).__init__(**kwargs)
self.enabled = enabled
self.created = None
@@ -2961,7 +3313,7 @@ def __init__(self, *, enabled: bool=None, **kwargs) -> None:
self.recovery_level = None
-class StorageAccountCreateParameters(Model):
+class StorageAccountCreateParameters(msrest.serialization.Model):
"""The storage account create parameters.
All required parameters must be populated in order to send to Azure.
@@ -2970,16 +3322,14 @@ class StorageAccountCreateParameters(Model):
:type resource_id: str
:param active_key_name: Required. Current active storage account key name.
:type active_key_name: str
- :param auto_regenerate_key: Required. whether keyvault should manage the
- storage account for the user.
+ :param auto_regenerate_key: Required. whether keyvault should manage the storage account for
+ the user.
:type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration specified
- in ISO-8601 format.
+ :param regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:type regeneration_period: str
:param storage_account_attributes: The attributes of the storage account.
- :type storage_account_attributes:
- ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type storage_account_attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -2998,7 +3348,17 @@ class StorageAccountCreateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, resource_id: str, active_key_name: str, auto_regenerate_key: bool, regeneration_period: str=None, storage_account_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ resource_id: str,
+ active_key_name: str,
+ auto_regenerate_key: bool,
+ regeneration_period: Optional[str] = None,
+ storage_account_attributes: Optional["StorageAccountAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(StorageAccountCreateParameters, self).__init__(**kwargs)
self.resource_id = resource_id
self.active_key_name = active_key_name
@@ -3008,7 +3368,7 @@ def __init__(self, *, resource_id: str, active_key_name: str, auto_regenerate_ke
self.tags = tags
-class StorageAccountRegenerteKeyParameters(Model):
+class StorageAccountRegenerteKeyParameters(msrest.serialization.Model):
"""The storage account key regenerate parameters.
All required parameters must be populated in order to send to Azure.
@@ -3025,26 +3385,28 @@ class StorageAccountRegenerteKeyParameters(Model):
'key_name': {'key': 'keyName', 'type': 'str'},
}
- def __init__(self, *, key_name: str, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ key_name: str,
+ **kwargs
+ ):
super(StorageAccountRegenerteKeyParameters, self).__init__(**kwargs)
self.key_name = key_name
-class StorageAccountUpdateParameters(Model):
+class StorageAccountUpdateParameters(msrest.serialization.Model):
"""The storage account update parameters.
:param active_key_name: The current active storage account key name.
:type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
+ :param auto_regenerate_key: whether keyvault should manage the storage account for the user.
:type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration specified
- in ISO-8601 format.
+ :param regeneration_period: The key regeneration time duration specified in ISO-8601 format.
:type regeneration_period: str
:param storage_account_attributes: The attributes of the storage account.
- :type storage_account_attributes:
- ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value pairs.
+ :type storage_account_attributes: ~azure.keyvault.v7_0.models.StorageAccountAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
@@ -3056,7 +3418,16 @@ class StorageAccountUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
- def __init__(self, *, active_key_name: str=None, auto_regenerate_key: bool=None, regeneration_period: str=None, storage_account_attributes=None, tags=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ active_key_name: Optional[str] = None,
+ auto_regenerate_key: Optional[bool] = None,
+ regeneration_period: Optional[str] = None,
+ storage_account_attributes: Optional["StorageAccountAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
super(StorageAccountUpdateParameters, self).__init__(**kwargs)
self.active_key_name = active_key_name
self.auto_regenerate_key = auto_regenerate_key
@@ -3065,14 +3436,13 @@ def __init__(self, *, active_key_name: str=None, auto_regenerate_key: bool=None,
self.tags = tags
-class StorageListResult(Model):
+class StorageListResult(msrest.serialization.Model):
"""The storage accounts list result.
- Variables are only populated by the server, and will be ignored when
- sending a request.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: A response message containing a list of storage accounts in
- the key vault along with a link to the next page of storage accounts.
+ :ivar value: A response message containing a list of storage accounts in the key vault along
+ with a link to the next page of storage accounts.
:vartype value: list[~azure.keyvault.v7_0.models.StorageAccountItem]
:ivar next_link: The URL to get the next set of storage accounts.
:vartype next_link: str
@@ -3088,19 +3458,21 @@ class StorageListResult(Model):
'next_link': {'key': 'nextLink', 'type': 'str'},
}
- def __init__(self, **kwargs) -> None:
+ def __init__(
+ self,
+ **kwargs
+ ):
super(StorageListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
-class StorageRestoreParameters(Model):
+class StorageRestoreParameters(msrest.serialization.Model):
"""The secret restore parameters.
All required parameters must be populated in order to send to Azure.
- :param storage_bundle_backup: Required. The backup blob associated with a
- storage account.
+ :param storage_bundle_backup: Required. The backup blob associated with a storage account.
:type storage_bundle_backup: bytes
"""
@@ -3112,12 +3484,17 @@ class StorageRestoreParameters(Model):
'storage_bundle_backup': {'key': 'value', 'type': 'base64'},
}
- def __init__(self, *, storage_bundle_backup: bytes, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ storage_bundle_backup: bytes,
+ **kwargs
+ ):
super(StorageRestoreParameters, self).__init__(**kwargs)
self.storage_bundle_backup = storage_bundle_backup
-class SubjectAlternativeNames(Model):
+class SubjectAlternativeNames(msrest.serialization.Model):
"""The subject alternate names of a X509 object.
:param emails: Email addresses.
@@ -3134,23 +3511,29 @@ class SubjectAlternativeNames(Model):
'upns': {'key': 'upns', 'type': '[str]'},
}
- def __init__(self, *, emails=None, dns_names=None, upns=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ emails: Optional[List[str]] = None,
+ dns_names: Optional[List[str]] = None,
+ upns: Optional[List[str]] = None,
+ **kwargs
+ ):
super(SubjectAlternativeNames, self).__init__(**kwargs)
self.emails = emails
self.dns_names = dns_names
self.upns = upns
-class Trigger(Model):
+class Trigger(msrest.serialization.Model):
"""A condition to be satisfied for an action to be executed.
- :param lifetime_percentage: Percentage of lifetime at which to trigger.
- Value should be between 1 and 99.
+ :param lifetime_percentage: Percentage of lifetime at which to trigger. Value should be between
+ 1 and 99.
:type lifetime_percentage: int
- :param days_before_expiry: Days before expiry to attempt renewal. Value
- should be between 1 and validity_in_months multiplied by 27. If
- validity_in_months is 36, then value should be between 1 and 972 (36 *
- 27).
+ :param days_before_expiry: Days before expiry to attempt renewal. Value should be between 1 and
+ validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between
+ 1 and 972 (36 * 27).
:type days_before_expiry: int
"""
@@ -3163,27 +3546,30 @@ class Trigger(Model):
'days_before_expiry': {'key': 'days_before_expiry', 'type': 'int'},
}
- def __init__(self, *, lifetime_percentage: int=None, days_before_expiry: int=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ lifetime_percentage: Optional[int] = None,
+ days_before_expiry: Optional[int] = None,
+ **kwargs
+ ):
super(Trigger, self).__init__(**kwargs)
self.lifetime_percentage = lifetime_percentage
self.days_before_expiry = days_before_expiry
-class X509CertificateProperties(Model):
+class X509CertificateProperties(msrest.serialization.Model):
"""Properties of the X509 component of a certificate.
- :param subject: The subject name. Should be a valid X509 distinguished
- Name.
+ :param subject: The subject name. Should be a valid X509 distinguished Name.
:type subject: str
:param ekus: The enhanced key usage.
:type ekus: list[str]
:param subject_alternative_names: The subject alternative names.
- :type subject_alternative_names:
- ~azure.keyvault.v7_0.models.SubjectAlternativeNames
+ :type subject_alternative_names: ~azure.keyvault.v7_0.models.SubjectAlternativeNames
:param key_usage: List of key usages.
:type key_usage: list[str or ~azure.keyvault.v7_0.models.KeyUsageType]
- :param validity_in_months: The duration that the certificate is valid in
- months.
+ :param validity_in_months: The duration that the certificate is valid in months.
:type validity_in_months: int
"""
@@ -3199,7 +3585,16 @@ class X509CertificateProperties(Model):
'validity_in_months': {'key': 'validity_months', 'type': 'int'},
}
- def __init__(self, *, subject: str=None, ekus=None, subject_alternative_names=None, key_usage=None, validity_in_months: int=None, **kwargs) -> None:
+ def __init__(
+ self,
+ *,
+ subject: Optional[str] = None,
+ ekus: Optional[List[str]] = None,
+ subject_alternative_names: Optional["SubjectAlternativeNames"] = None,
+ key_usage: Optional[List[Union[str, "KeyUsageType"]]] = None,
+ validity_in_months: Optional[int] = None,
+ **kwargs
+ ):
super(X509CertificateProperties, self).__init__(**kwargs)
self.subject = subject
self.ekus = ekus
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/operations/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/operations/__init__.py
similarity index 90%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/operations/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/operations/__init__.py
index 603e37d3ee07..44bfc9d07bb1 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/operations/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/operations/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_operations import KeyVaultClientOperationsMixin
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/operations/_key_vault_client_operations.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/operations/_key_vault_client_operations.py
new file mode 100644
index 000000000000..2c3025282c59
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/operations/_key_vault_client_operations.py
@@ -0,0 +1,5314 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class KeyVaultClientOperationsMixin(object):
+
+ def create_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ parameters, # type: "models.KeyCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Creates a new key, stores it, then returns key parameters and attributes to the client.
+
+ The create key operation can be used to create any key type in Azure Key Vault. If the named
+ key already exists, Azure Key Vault creates a new version of the key. It requires the
+ keys/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name for the new key. The system will generate the version name for the
+ new key.
+ :type key_name: str
+ :param parameters: The parameters to create a key.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_key.metadata = {'url': '/keys/{key-name}/create'} # type: ignore
+
+ def import_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ parameters, # type: "models.KeyImportParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Imports an externally created key, stores it, and returns key parameters and attributes to the client.
+
+ The import key operation may be used to import any key type into an Azure Key Vault. If the
+ named key already exists, Azure Key Vault creates a new version of the key. This operation
+ requires the keys/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: Name for the imported key.
+ :type key_name: str
+ :param parameters: The parameters to import a key.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ def delete_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedKeyBundle"
+ """Deletes a key of any type from storage in Azure Key Vault.
+
+ The delete key operation cannot be used to remove individual versions of a key. This operation
+ removes the cryptographic material associated with the key, which means the key is not usable
+ for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
+ keys/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to delete.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ def update_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
+
+ In order to perform this operation, the key must already exist in the Key Vault. Note: The
+ cryptographic material of a key itself cannot be changed. This operation requires the
+ keys/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of key to update.
+ :type key_name: str
+ :param key_version: The version of the key to update.
+ :type key_version: str
+ :param parameters: The parameters of the key to update.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Gets the public part of a stored key.
+
+ The get key operation is applicable to all key types. If the requested key is symmetric, then
+ no key material is released in the response. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to get.
+ :type key_name: str
+ :param key_version: Adding the version parameter retrieves a specific version of a key. This
+ URI fragment is optional. If not specified, the latest version of the key is returned.
+ :type key_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key_versions(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.KeyListResult"]
+ """Retrieves a list of individual key versions with the same key name.
+
+ The full key identifier, attributes, and tags are provided in the response. This operation
+ requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_key_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_key_versions.metadata = {'url': '/keys/{key-name}/versions'} # type: ignore
+
+ def get_keys(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.KeyListResult"]
+ """List keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a stored key. The LIST operation is applicable to all key types, however only
+ the base key identifier, attributes, and tags are provided in the response. Individual versions
+ of a key are not listed in the response. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_keys.metadata = {'url': '/keys'} # type: ignore
+
+ def backup_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.BackupKeyResult"
+ """Requests that a backup of the specified key be downloaded to the client.
+
+ The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this
+ operation does NOT return key material in a form that can be used outside the Azure Key Vault
+ system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key
+ Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
+ Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.
+ The BACKUP operation may be used to export, in protected form, any key type from Azure Key
+ Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed
+ within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be
+ restored to another geographical area. For example, a backup from the US geographical area
+ cannot be restored in an EU geographical area. This operation requires the key/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupKeyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupKeyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupKeyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.backup_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupKeyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_key.metadata = {'url': '/keys/{key-name}/backup'} # type: ignore
+
+ def restore_key(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.KeyRestoreParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Restores a backed up key to a vault.
+
+ Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
+ attributes and access control policies. The RESTORE operation may be used to import a
+ previously backed up key. Individual versions of a key cannot be restored. The key is restored
+ in its entirety with the same key name as it had when it was backed up. If the key name is not
+ available in the target Key Vault, the RESTORE operation will be rejected. While the key name
+ is retained during restore, the final key identifier will change if the key is restored to a
+ different vault. Restore will restore all versions and preserve version identifiers. The
+ RESTORE operation is subject to security constraints: The target Key Vault must be owned by the
+ same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission
+ in the target Key Vault. This operation requires the keys/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the key.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_key.metadata = {'url': '/keys/restore'} # type: ignore
+
+ def encrypt(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
+
+ The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
+ stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of
+ data, the size of which is dependent on the target key and the encryption algorithm to be used.
+ The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
+ since protection with an asymmetric key can be performed using public portion of the key. This
+ operation is supported for asymmetric keys as a convenience for callers that have a key-
+ reference but do not have access to the public key material. This operation requires the
+ keys/encrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the encryption operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.encrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'} # type: ignore
+
+ def decrypt(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Decrypts a single block of encrypted data.
+
+ The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption
+ key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a
+ single block of data may be decrypted, the size of this block is dependent on the target key
+ and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys
+ stored in Azure Key Vault since it uses the private portion of the key. This operation requires
+ the keys/decrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the decryption operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.decrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'} # type: ignore
+
+ def sign(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeySignParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Creates a signature from a digest using the specified key.
+
+ The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault
+ since this operation uses the private portion of the key. This operation requires the keys/sign
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the signing operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeySignParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.sign.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeySignParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'} # type: ignore
+
+ def verify(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyVerifyParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyVerifyResult"
+ """Verifies a signature using a specified key.
+
+ The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not
+ strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification
+ can be performed using the public portion of the key but this operation is supported as a
+ convenience for callers that only have a key-reference and not the public portion of the key.
+ This operation requires the keys/verify permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for verify operations.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyVerifyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyVerifyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyVerifyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyVerifyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.verify.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyVerifyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'} # type: ignore
+
+ def wrap_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Wraps a symmetric key using a specified key.
+
+ The WRAP operation supports encryption of a symmetric key using a key encryption key that has
+ previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for
+ symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be
+ performed using the public portion of the key. This operation is supported for asymmetric keys
+ as a convenience for callers that have a key-reference but do not have access to the public key
+ material. This operation requires the keys/wrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for wrap operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.wrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'} # type: ignore
+
+ def unwrap_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
+
+ The UNWRAP operation supports decryption of a symmetric key using the target key encryption
+ key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to
+ asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of
+ the key. This operation requires the keys/unwrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the key operation.
+ :type parameters: ~azure.keyvault.v7_0.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.unwrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'} # type: ignore
+
+ def get_deleted_keys(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedKeyListResult"]
+ """Lists the deleted keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a deleted key. This operation includes deletion-specific information. The Get
+ Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedKeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedKeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_keys.metadata = {'url': '/deletedkeys'} # type: ignore
+
+ def get_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedKeyBundle"
+ """Gets the public part of a deleted key.
+
+ The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ def purge_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Permanently deletes the specified key.
+
+ The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the
+ operation can be invoked on any vault, it will return an error if invoked on a non soft-delete
+ enabled vault. This operation requires the keys/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.purge_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ def recover_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Recovers the deleted key to its latest version.
+
+ The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.
+ It recovers the deleted key back to its latest version under /keys. An attempt to recover an
+ non-deleted key will return an error. Consider this the inverse of the delete operation on
+ soft-delete enabled vaults. This operation requires the keys/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the deleted key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'} # type: ignore
+
+ def set_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ parameters, # type: "models.SecretSetParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Sets a secret in a specified key vault.
+
+ The SET operation adds a secret to the Azure Key Vault. If the named secret already exists,
+ Azure Key Vault creates a new version of that secret. This operation requires the secrets/set
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param parameters: The parameters for setting the secret.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretSetParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_secret.metadata = {'url': '/secrets/{secret-name}'} # type: ignore
+
+ def delete_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedSecretBundle"
+ """Deletes a secret from a specified key vault.
+
+ The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied
+ to an individual version of a secret. This operation requires the secrets/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_secret.metadata = {'url': '/secrets/{secret-name}'} # type: ignore
+
+ def update_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ secret_version, # type: str
+ parameters, # type: "models.SecretUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Updates the attributes associated with a specified secret in a given key vault.
+
+ The UPDATE operation changes specified attributes of an existing stored secret. Attributes that
+ are not specified in the request are left unchanged. The value of a secret itself cannot be
+ changed. This operation requires the secrets/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret.
+ :type secret_version: str
+ :param parameters: The parameters for update secret operation.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ 'secret-version': self._serialize.url("secret_version", secret_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} # type: ignore
+
+ def get_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ secret_version, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Get a specified secret from a given key vault.
+
+ The GET operation is applicable to any secret stored in Azure Key Vault. This operation
+ requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param secret_version: The version of the secret. This URI fragment is optional. If not
+ specified, the latest version of the secret is returned.
+ :type secret_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ 'secret-version': self._serialize.url("secret_version", secret_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} # type: ignore
+
+ def get_secrets(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.SecretListResult"]
+ """List secrets in a specified key vault.
+
+ The Get Secrets operation is applicable to the entire vault. However, only the base secret
+ identifier and its attributes are provided in the response. Individual secret versions are not
+ listed in the response. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_secrets.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('SecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_secrets.metadata = {'url': '/secrets'} # type: ignore
+
+ def get_secret_versions(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.SecretListResult"]
+ """List all versions of the specified secret.
+
+ The full secret identifier and attributes are provided in the response. No values are returned
+ for the secrets. This operations requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified, the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_secret_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('SecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_secret_versions.metadata = {'url': '/secrets/{secret-name}/versions'} # type: ignore
+
+ def get_deleted_secrets(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedSecretListResult"]
+ """Lists deleted secrets for the specified vault.
+
+ The Get Deleted Secrets operation returns the secrets that have been deleted for a vault
+ enabled for soft-delete. This operation requires the secrets/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSecretListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedSecretListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_secrets.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedSecretListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_secrets.metadata = {'url': '/deletedsecrets'} # type: ignore
+
+ def get_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedSecretBundle"
+ """Gets the specified deleted secret.
+
+ The Get Deleted Secret operation returns the specified deleted secret along with its
+ attributes. This operation requires the secrets/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} # type: ignore
+
+ def purge_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Permanently deletes the specified secret.
+
+ The purge deleted secret operation removes the secret permanently, without the possibility of
+ recovery. This operation can only be enabled on a soft-delete enabled vault. This operation
+ requires the secrets/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.purge_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} # type: ignore
+
+ def recover_deleted_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Recovers the deleted secret to the latest version.
+
+ Recovers the deleted secret in the specified vault. This operation can only be performed on a
+ soft-delete enabled vault. This operation requires the secrets/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the deleted secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}/recover'} # type: ignore
+
+ def backup_secret(
+ self,
+ vault_base_url, # type: str
+ secret_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.BackupSecretResult"
+ """Backs up the specified secret.
+
+ Requests that a backup of the specified secret be downloaded to the client. All versions of the
+ secret will be downloaded. This operation requires the secrets/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param secret_name: The name of the secret.
+ :type secret_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupSecretResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupSecretResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupSecretResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.backup_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupSecretResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_secret.metadata = {'url': '/secrets/{secret-name}/backup'} # type: ignore
+
+ def restore_secret(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.SecretRestoreParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SecretBundle"
+ """Restores a backed up secret to a vault.
+
+ Restores a backed up secret, and all its versions, to a vault. This operation requires the
+ secrets/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the secret.
+ :type parameters: ~azure.keyvault.v7_0.models.SecretRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SecretBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SecretBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SecretBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_secret.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SecretRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SecretBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_secret.metadata = {'url': '/secrets/restore'} # type: ignore
+
+ def get_certificates(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ include_pending=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.CertificateListResult"]
+ """List certificates in a specified key vault.
+
+ The GetCertificates operation returns the set of certificates resources in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :param include_pending: Specifies whether to include certificates which are not completely
+ provisioned.
+ :type include_pending: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificates.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ if include_pending is not None:
+ query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool')
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_certificates.metadata = {'url': '/certificates'} # type: ignore
+
+ def delete_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedCertificateBundle"
+ """Deletes a certificate from a specified key vault.
+
+ Deletes all versions of a certificate object along with its associated policy. Delete
+ certificate cannot be used to remove individual versions of a certificate object. This
+ operation requires the certificates/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedCertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate.metadata = {'url': '/certificates/{certificate-name}'} # type: ignore
+
+ def set_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ contacts, # type: "models.Contacts"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.Contacts"
+ """Sets the certificate contacts for the specified key vault.
+
+ Sets the certificate contacts for the specified key vault. This operation requires the
+ certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param contacts: The contacts for the key vault certificate.
+ :type contacts: ~azure.keyvault.v7_0.models.Contacts
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(contacts, 'Contacts')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ def get_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.Contacts"
+ """Lists the certificate contacts for a specified key vault.
+
+ The GetCertificateContacts operation returns the set of certificate contact resources in the
+ specified key vault. This operation requires the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ def delete_certificate_contacts(
+ self,
+ vault_base_url, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.Contacts"
+ """Deletes the certificate contacts for a specified key vault.
+
+ Deletes the certificate contacts for a specified key vault certificate. This operation requires
+ the certificates/managecontacts permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Contacts, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.Contacts
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Contacts"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_certificate_contacts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('Contacts', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_contacts.metadata = {'url': '/certificates/contacts'} # type: ignore
+
+ def get_certificate_issuers(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.CertificateIssuerListResult"]
+ """List certificate issuers for a specified key vault.
+
+ The GetCertificateIssuers operation returns the set of certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateIssuerListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateIssuerListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateIssuerListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificate_issuers.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateIssuerListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_certificate_issuers.metadata = {'url': '/certificates/issuers'} # type: ignore
+
+ def set_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ parameter, # type: "models.CertificateIssuerSetParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.IssuerBundle"
+ """Sets the specified certificate issuer.
+
+ The SetCertificateIssuer operation adds or updates the specified certificate issuer. This
+ operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer set parameter.
+ :type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerSetParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameter, 'CertificateIssuerSetParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ def update_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ parameter, # type: "models.CertificateIssuerUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.IssuerBundle"
+ """Updates the specified certificate issuer.
+
+ The UpdateCertificateIssuer operation performs an update on the specified certificate issuer
+ entity. This operation requires the certificates/setissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :param parameter: Certificate issuer update parameter.
+ :type parameter: ~azure.keyvault.v7_0.models.CertificateIssuerUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameter, 'CertificateIssuerUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ def get_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.IssuerBundle"
+ """Lists the specified certificate issuer.
+
+ The GetCertificateIssuer operation returns the specified certificate issuer resources in the
+ specified key vault. This operation requires the certificates/manageissuers/getissuers
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ def delete_certificate_issuer(
+ self,
+ vault_base_url, # type: str
+ issuer_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.IssuerBundle"
+ """Deletes the specified certificate issuer.
+
+ The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from
+ the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param issuer_name: The name of the issuer.
+ :type issuer_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: IssuerBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.IssuerBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_certificate_issuer.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('IssuerBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} # type: ignore
+
+ def create_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateOperation"
+ """Creates a new certificate.
+
+ If this is the first version, the certificate resource is created. This operation requires the
+ certificates/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to create a certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_certificate.metadata = {'url': '/certificates/{certificate-name}/create'} # type: ignore
+
+ def import_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateImportParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Imports a certificate into a specified key vault.
+
+ Imports an existing valid certificate, containing a private key, into Azure Key Vault. The
+ certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM
+ format the PEM file must contain the key as well as x509 certificates. This operation requires
+ the certificates/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to import the certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_certificate.metadata = {'url': '/certificates/{certificate-name}/import'} # type: ignore
+
+ def get_certificate_versions(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.CertificateListResult"]
+ """List the versions of a certificate.
+
+ The GetCertificateVersions operation returns the versions of a certificate in the specified key
+ vault. This operation requires the certificates/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either CertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.CertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_certificate_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('CertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_certificate_versions.metadata = {'url': '/certificates/{certificate-name}/versions'} # type: ignore
+
+ def get_certificate_policy(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificatePolicy"
+ """Lists the policy for a certificate.
+
+ The GetCertificatePolicy operation returns the specified certificate policy resources in the
+ specified key vault. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in a given key vault.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificatePolicy"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificatePolicy', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} # type: ignore
+
+ def update_certificate_policy(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_policy, # type: "models.CertificatePolicy"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificatePolicy"
+ """Updates the policy for a certificate.
+
+ Set specified members in the certificate policy. Leave others as null. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_policy: The policy for the certificate.
+ :type certificate_policy: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificatePolicy, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificatePolicy"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_policy.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(certificate_policy, 'CertificatePolicy')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificatePolicy', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} # type: ignore
+
+ def update_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_version, # type: str
+ parameters, # type: "models.CertificateUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Updates the specified attributes associated with the given certificate.
+
+ The UpdateCertificate operation applies the specified update on the given certificate; the only
+ elements updated are the certificate's attributes. This operation requires the
+ certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given key vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate.
+ :type certificate_version: str
+ :param parameters: The parameters for certificate update.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} # type: ignore
+
+ def get_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_version, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Gets information about a certificate.
+
+ Gets information about a specific certificate. This operation requires the certificates/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate in the given vault.
+ :type certificate_name: str
+ :param certificate_version: The version of the certificate. This URI fragment is optional. If
+ not specified, the latest version of the certificate is returned.
+ :type certificate_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} # type: ignore
+
+ def update_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ certificate_operation, # type: "models.CertificateOperationUpdateParameter"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateOperation"
+ """Updates a certificate operation.
+
+ Updates a certificate creation operation that is already in progress. This operation requires
+ the certificates/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param certificate_operation: The certificate operation response.
+ :type certificate_operation: ~azure.keyvault.v7_0.models.CertificateOperationUpdateParameter
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(certificate_operation, 'CertificateOperationUpdateParameter')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ def get_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateOperation"
+ """Gets the creation operation of a certificate.
+
+ Gets the creation operation associated with a specified certificate. This operation requires
+ the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ def delete_certificate_operation(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateOperation"
+ """Deletes the creation operation for a specific certificate.
+
+ Deletes the creation operation for a specified certificate that is in the process of being
+ created. The certificate is no longer created. This operation requires the certificates/update
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateOperation, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateOperation"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_certificate_operation.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateOperation', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} # type: ignore
+
+ def merge_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ parameters, # type: "models.CertificateMergeParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Merges a certificate or a certificate chain with a key pair existing on the server.
+
+ The MergeCertificate operation performs the merging of a certificate or certificate chain with
+ a key pair currently available in the service. This operation requires the certificates/create
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :param parameters: The parameters to merge certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateMergeParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.merge_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateMergeParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'} # type: ignore
+
+ def backup_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.BackupCertificateResult"
+ """Backs up the specified certificate.
+
+ Requests that a backup of the specified certificate be downloaded to the client. All versions
+ of the certificate will be downloaded. This operation requires the certificates/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupCertificateResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupCertificateResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupCertificateResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.backup_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupCertificateResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_certificate.metadata = {'url': '/certificates/{certificate-name}/backup'} # type: ignore
+
+ def restore_certificate(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.CertificateRestoreParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Restores a backed up certificate to a vault.
+
+ Restores a backed up certificate, and all its versions, to a vault. This operation requires the
+ certificates/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the certificate.
+ :type parameters: ~azure.keyvault.v7_0.models.CertificateRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'CertificateRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_certificate.metadata = {'url': '/certificates/restore'} # type: ignore
+
+ def get_deleted_certificates(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ include_pending=None, # type: Optional[bool]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedCertificateListResult"]
+ """Lists the deleted certificates in the specified vault currently available for recovery.
+
+ The GetDeletedCertificates operation retrieves the certificates in the current vault which are
+ in a deleted state and ready for recovery or purging. This operation includes deletion-specific
+ information. This operation requires the certificates/get/list permission. This operation can
+ only be enabled on soft-delete enabled vaults.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :param include_pending: Specifies whether to include certificates which are not completely
+ provisioned.
+ :type include_pending: bool
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedCertificateListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedCertificateListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_certificates.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ if include_pending is not None:
+ query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool')
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedCertificateListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_certificates.metadata = {'url': '/deletedcertificates'} # type: ignore
+
+ def get_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedCertificateBundle"
+ """Retrieves information about the specified deleted certificate.
+
+ The GetDeletedCertificate operation retrieves the deleted certificate information plus its
+ attributes, such as retention interval, scheduled permanent deletion and the current deletion
+ recovery level. This operation requires the certificates/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedCertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedCertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedCertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} # type: ignore
+
+ def purge_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Permanently deletes the specified deleted certificate.
+
+ The PurgeDeletedCertificate operation performs an irreversible deletion of the specified
+ certificate, without possibility for recovery. The operation is not available if the recovery
+ level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.purge_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} # type: ignore
+
+ def recover_deleted_certificate(
+ self,
+ vault_base_url, # type: str
+ certificate_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CertificateBundle"
+ """Recovers the deleted certificate back to its current version under /certificates.
+
+ The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The
+ operation is applicable in vaults enabled for soft-delete, and must be issued during the
+ retention interval (available in the deleted certificate's attributes). This operation requires
+ the certificates/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param certificate_name: The name of the deleted certificate.
+ :type certificate_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CertificateBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_certificate.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('CertificateBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}/recover'} # type: ignore
+
+ def get_storage_accounts(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.StorageListResult"]
+ """List storage accounts managed by the specified key vault. This operation requires the
+ storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either StorageListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.StorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_storage_accounts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('StorageListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_storage_accounts.metadata = {'url': '/storage'} # type: ignore
+
+ def get_deleted_storage_accounts(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedStorageListResult"]
+ """Lists deleted storage accounts for the specified vault.
+
+ The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted
+ for a vault enabled for soft-delete. This operation requires the storage/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedStorageListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedStorageListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedStorageListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_storage_accounts.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedStorageListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_storage_accounts.metadata = {'url': '/deletedstorage'} # type: ignore
+
+ def get_deleted_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedStorageBundle"
+ """Gets the specified deleted storage account.
+
+ The Get Deleted Storage Account operation returns the specified deleted storage account along
+ with its attributes. This operation requires the storage/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedStorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedStorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedStorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} # type: ignore
+
+ def purge_deleted_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Permanently deletes the specified storage account.
+
+ The purge deleted storage account operation removes the secret permanently, without the
+ possibility of recovery. This operation can only be performed on a soft-delete enabled vault.
+ This operation requires the storage/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.purge_deleted_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} # type: ignore
+
+ def recover_deleted_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Recovers the deleted storage account.
+
+ Recovers the deleted storage account in the specified vault. This operation can only be
+ performed on a soft-delete enabled vault. This operation requires the storage/recover
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}/recover'} # type: ignore
+
+ def backup_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.BackupStorageResult"
+ """Backs up the specified storage account.
+
+ Requests that a backup of the specified storage account be downloaded to the client. This
+ operation requires the storage/backup permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupStorageResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.BackupStorageResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupStorageResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.backup_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupStorageResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_storage_account.metadata = {'url': '/storage/{storage-account-name}/backup'} # type: ignore
+
+ def restore_storage_account(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.StorageRestoreParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Restores a backed up storage account to a vault.
+
+ Restores a backed up storage account to a vault. This operation requires the storage/restore
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_storage_account.metadata = {'url': '/storage/restore'} # type: ignore
+
+ def delete_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedStorageBundle"
+ """Deletes a storage account. This operation requires the storage/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedStorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedStorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedStorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ def get_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Gets information about a specified storage account. This operation requires the storage/get
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ def set_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Creates or updates a new storage account. This operation requires the storage/set permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to create a storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ def update_storage_account(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Updates the specified attributes associated with the given storage account. This operation
+ requires the storage/set/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to update a storage account.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_storage_account.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_storage_account.metadata = {'url': '/storage/{storage-account-name}'} # type: ignore
+
+ def regenerate_storage_account_key(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ parameters, # type: "models.StorageAccountRegenerteKeyParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.StorageBundle"
+ """Regenerates the specified key value for the given storage account. This operation requires the
+ storage/regeneratekey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param parameters: The parameters to regenerate storage account key.
+ :type parameters: ~azure.keyvault.v7_0.models.StorageAccountRegenerteKeyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: StorageBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.StorageBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.StorageBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.regenerate_storage_account_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'StorageAccountRegenerteKeyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('StorageBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ regenerate_storage_account_key.metadata = {'url': '/storage/{storage-account-name}/regeneratekey'} # type: ignore
+
+ def get_sas_definitions(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.SasDefinitionListResult"]
+ """List storage SAS definitions for the given storage account. This operation requires the
+ storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either SasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.SasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_sas_definitions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('SasDefinitionListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_sas_definitions.metadata = {'url': '/storage/{storage-account-name}/sas'} # type: ignore
+
+ def get_deleted_sas_definitions(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedSasDefinitionListResult"]
+ """Lists deleted SAS definitions for the specified vault and storage account.
+
+ The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted
+ for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedSasDefinitionListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.DeletedSasDefinitionListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSasDefinitionListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_sas_definitions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedSasDefinitionListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_sas_definitions.metadata = {'url': '/deletedstorage/{storage-account-name}/sas'} # type: ignore
+
+ def get_deleted_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedSasDefinitionBundle"
+ """Gets the specified deleted sas definition.
+
+ The Get Deleted SAS Definition operation returns the specified deleted SAS definition along
+ with its attributes. This operation requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_deleted_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_sas_definition.metadata = {'url': '/deletedstorage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ def recover_deleted_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SasDefinitionBundle"
+ """Recovers the deleted SAS definition.
+
+ Recovers the deleted SAS definition for the specified storage account. This operation can only
+ be performed on a soft-delete enabled vault. This operation requires the storage/recover
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.recover_deleted_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_sas_definition.metadata = {'url': '/deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover'} # type: ignore
+
+ def delete_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedSasDefinitionBundle"
+ """Deletes a SAS definition from a specified storage account. This operation requires the
+ storage/deletesas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedSasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedSasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.delete_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedSasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ def get_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SasDefinitionBundle"
+ """Gets information about a SAS definition for the specified storage account. This operation
+ requires the storage/getsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+
+ # Construct URL
+ url = self.get_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ def set_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ parameters, # type: "models.SasDefinitionCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SasDefinitionBundle"
+ """Creates or updates a new SAS definition for the specified storage account. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to create a SAS definition.
+ :type parameters: ~azure.keyvault.v7_0.models.SasDefinitionCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.set_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SasDefinitionCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ set_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
+
+ def update_sas_definition(
+ self,
+ vault_base_url, # type: str
+ storage_account_name, # type: str
+ sas_definition_name, # type: str
+ parameters, # type: "models.SasDefinitionUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SasDefinitionBundle"
+ """Updates the specified attributes associated with the given SAS definition. This operation
+ requires the storage/setsas permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param storage_account_name: The name of the storage account.
+ :type storage_account_name: str
+ :param sas_definition_name: The name of the SAS definition.
+ :type sas_definition_name: str
+ :param parameters: The parameters to update a SAS definition.
+ :type parameters: ~azure.keyvault.v7_0.models.SasDefinitionUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SasDefinitionBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SasDefinitionBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.0"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_sas_definition.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'SasDefinitionUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('SasDefinitionBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} # type: ignore
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/py.typed b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/py.typed
new file mode 100644
index 000000000000..e5aff4f83af8
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_0/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/__init__.py
new file mode 100644
index 000000000000..a6c1f9b7a792
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/__init__.py
@@ -0,0 +1,16 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from ._key_vault_client import KeyVaultClient
+__all__ = ['KeyVaultClient']
+
+try:
+ from ._patch import patch_sdk # type: ignore
+ patch_sdk()
+except ImportError:
+ pass
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/_configuration.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_configuration.py
similarity index 66%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/_configuration.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_configuration.py
index 68d6f5b6bd2c..615e2427b33e 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/_configuration.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_configuration.py
@@ -1,47 +1,52 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+
+from typing import TYPE_CHECKING
+
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
-from .version import VERSION
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
+VERSION = "unknown"
class KeyVaultClientConfiguration(Configuration):
- """Configuration for KeyVaultClient
+ """Configuration for KeyVaultClient.
+
Note that all parameters used to create this instance are saved as instance
attributes.
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
"""
- def __init__(self, credentials, **kwargs):
-
- if credentials is None:
- raise ValueError("Parameter 'credentials' must not be None.")
-
+ def __init__(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
super(KeyVaultClientConfiguration, self).__init__(**kwargs)
- self._configure(**kwargs)
- self.user_agent_policy.add_user_agent('azsdk-python-azure-keyvault/{}'.format(VERSION))
- self.generate_client_request_id = True
-
- self.credentials = credentials
+ self.api_version = "7.1"
+ kwargs.setdefault('sdk_moniker', 'keyvault/{}'.format(VERSION))
+ self._configure(**kwargs)
- def _configure(self, **kwargs):
+ def _configure(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/_key_vault_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_key_vault_client.py
similarity index 66%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/_key_vault_client.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_key_vault_client.py
index e3ec609b6cd3..d9db79ab8785 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/_key_vault_client.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_key_vault_client.py
@@ -1,16 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+
from azure.core import PipelineClient
-from msrest import Serializer, Deserializer
+from msrest import Deserializer, Serializer
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
from ._configuration import KeyVaultClientConfiguration
from .operations import KeyVaultClientOperationsMixin
@@ -20,27 +23,32 @@
class KeyVaultClient(KeyVaultClientOperationsMixin):
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
-
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
def __init__(
- self, credentials, **kwargs):
-
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
base_url = '{vaultBaseUrl}'
- self._config = KeyVaultClientConfiguration(credentials, **kwargs)
+ self._config = KeyVaultClientConfiguration(**kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
- self.api_version = '2016-10-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
+ def close(self):
+ # type: () -> None
+ self._client.close()
+
def __enter__(self):
+ # type: () -> KeyVaultClient
self._client.__enter__()
return self
+
def __exit__(self, *exc_details):
+ # type: (Any) -> None
self._client.__exit__(*exc_details)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_metadata.json b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_metadata.json
new file mode 100644
index 000000000000..0210e6bce9b1
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/_metadata.json
@@ -0,0 +1,261 @@
+{
+ "chosen_version": "7.1",
+ "total_api_version_list": ["7.1"],
+ "client": {
+ "name": "KeyVaultClient",
+ "filename": "_key_vault_client",
+ "description": "The key vault client performs cryptographic key operations and vault operations against the Key Vault service.",
+ "base_url": null,
+ "custom_base_url": "\u0027{vaultBaseUrl}\u0027",
+ "azure_arm": false
+ },
+ "global_parameters": {
+ "sync_method": {
+ },
+ "async_method": {
+ },
+ "constant": {
+ },
+ "call": ""
+ },
+ "config": {
+ "credential": false,
+ "credential_scopes": null,
+ "credential_default_policy_type": "BearerTokenCredentialPolicy",
+ "credential_default_policy_type_has_async_version": true
+ },
+ "operation_groups": {
+ },
+ "operation_mixins": {
+ "create_key" : {
+ "sync": {
+ "signature": "def create_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n parameters, # type: \"models.KeyCreateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates a new key, stores it, then returns key parameters and attributes to the client.\n\nThe create key operation can be used to create any key type in Azure Key Vault. If the named\nkey already exists, Azure Key Vault creates a new version of the key. It requires the\nkeys/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name for the new key. The system will generate the version name for the\n new key.\n:type key_name: str\n:param parameters: The parameters to create a key.\n:type parameters: ~azure.keyvault.v7_1.models.KeyCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def create_key(\n self,\n vault_base_url: str,\n key_name: str,\n parameters: \"models.KeyCreateParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Creates a new key, stores it, then returns key parameters and attributes to the client.\n\nThe create key operation can be used to create any key type in Azure Key Vault. If the named\nkey already exists, Azure Key Vault creates a new version of the key. It requires the\nkeys/create permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name for the new key. The system will generate the version name for the\n new key.\n:type key_name: str\n:param parameters: The parameters to create a key.\n:type parameters: ~azure.keyvault.v7_1.models.KeyCreateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, parameters"
+ },
+ "import_key" : {
+ "sync": {
+ "signature": "def import_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n parameters, # type: \"models.KeyImportParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Imports an externally created key, stores it, and returns key parameters and attributes to the client.\n\nThe import key operation may be used to import any key type into an Azure Key Vault. If the\nnamed key already exists, Azure Key Vault creates a new version of the key. This operation\nrequires the keys/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: Name for the imported key.\n:type key_name: str\n:param parameters: The parameters to import a key.\n:type parameters: ~azure.keyvault.v7_1.models.KeyImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def import_key(\n self,\n vault_base_url: str,\n key_name: str,\n parameters: \"models.KeyImportParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Imports an externally created key, stores it, and returns key parameters and attributes to the client.\n\nThe import key operation may be used to import any key type into an Azure Key Vault. If the\nnamed key already exists, Azure Key Vault creates a new version of the key. This operation\nrequires the keys/import permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: Name for the imported key.\n:type key_name: str\n:param parameters: The parameters to import a key.\n:type parameters: ~azure.keyvault.v7_1.models.KeyImportParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, parameters"
+ },
+ "delete_key" : {
+ "sync": {
+ "signature": "def delete_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Deletes a key of any type from storage in Azure Key Vault.\n\nThe delete key operation cannot be used to remove individual versions of a key. This operation\nremoves the cryptographic material associated with the key, which means the key is not usable\nfor Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the\nkeys/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to delete.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def delete_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.DeletedKeyBundle\":\n",
+ "doc": "\"\"\"Deletes a key of any type from storage in Azure Key Vault.\n\nThe delete key operation cannot be used to remove individual versions of a key. This operation\nremoves the cryptographic material associated with the key, which means the key is not usable\nfor Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the\nkeys/delete permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to delete.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "update_key" : {
+ "sync": {
+ "signature": "def update_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyUpdateParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.\n\nIn order to perform this operation, the key must already exist in the Key Vault. Note: The\ncryptographic material of a key itself cannot be changed. This operation requires the\nkeys/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of key to update.\n:type key_name: str\n:param key_version: The version of the key to update.\n:type key_version: str\n:param parameters: The parameters of the key to update.\n:type parameters: ~azure.keyvault.v7_1.models.KeyUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def update_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyUpdateParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.\n\nIn order to perform this operation, the key must already exist in the Key Vault. Note: The\ncryptographic material of a key itself cannot be changed. This operation requires the\nkeys/update permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of key to update.\n:type key_name: str\n:param key_version: The version of the key to update.\n:type key_version: str\n:param parameters: The parameters of the key to update.\n:type parameters: ~azure.keyvault.v7_1.models.KeyUpdateParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "get_key" : {
+ "sync": {
+ "signature": "def get_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the public part of a stored key.\n\nThe get key operation is applicable to all key types. If the requested key is symmetric, then\nno key material is released in the response. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to get.\n:type key_name: str\n:param key_version: Adding the version parameter retrieves a specific version of a key. This\n URI fragment is optional. If not specified, the latest version of the key is returned.\n:type key_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Gets the public part of a stored key.\n\nThe get key operation is applicable to all key types. If the requested key is symmetric, then\nno key material is released in the response. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key to get.\n:type key_name: str\n:param key_version: Adding the version parameter retrieves a specific version of a key. This\n URI fragment is optional. If not specified, the latest version of the key is returned.\n:type key_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version"
+ },
+ "get_key_versions" : {
+ "sync": {
+ "signature": "def get_key_versions(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Retrieves a list of individual key versions with the same key name.\n\nThe full key identifier, attributes, and tags are provided in the response. This operation\nrequires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_key_versions(\n self,\n vault_base_url: str,\n key_name: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.KeyListResult\"]:\n",
+ "doc": "\"\"\"Retrieves a list of individual key versions with the same key name.\n\nThe full key identifier, attributes, and tags are provided in the response. This operation\nrequires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, maxresults"
+ },
+ "get_keys" : {
+ "sync": {
+ "signature": "def get_keys(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"List keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a stored key. The LIST operation is applicable to all key types, however only\nthe base key identifier, attributes, and tags are provided in the response. Individual versions\nof a key are not listed in the response. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_keys(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.KeyListResult\"]:\n",
+ "doc": "\"\"\"List keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a stored key. The LIST operation is applicable to all key types, however only\nthe base key identifier, attributes, and tags are provided in the response. Individual versions\nof a key are not listed in the response. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either KeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.KeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "backup_key" : {
+ "sync": {
+ "signature": "def backup_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Requests that a backup of the specified key be downloaded to the client.\n\nThe Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this\noperation does NOT return key material in a form that can be used outside the Azure Key Vault\nsystem, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key\nVault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure\nKey Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.\nThe BACKUP operation may be used to export, in protected form, any key type from Azure Key\nVault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed\nwithin geographical boundaries only; meaning that a BACKUP from one geographical area cannot be\nrestored to another geographical area. For example, a backup from the US geographical area\ncannot be restored in an EU geographical area. This operation requires the key/backup\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupKeyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.BackupKeyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def backup_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.BackupKeyResult\":\n",
+ "doc": "\"\"\"Requests that a backup of the specified key be downloaded to the client.\n\nThe Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this\noperation does NOT return key material in a form that can be used outside the Azure Key Vault\nsystem, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key\nVault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure\nKey Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.\nThe BACKUP operation may be used to export, in protected form, any key type from Azure Key\nVault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed\nwithin geographical boundaries only; meaning that a BACKUP from one geographical area cannot be\nrestored to another geographical area. For example, a backup from the US geographical area\ncannot be restored in an EU geographical area. This operation requires the key/backup\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BackupKeyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.BackupKeyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "restore_key" : {
+ "sync": {
+ "signature": "def restore_key(\n self,\n vault_base_url, # type: str\n parameters, # type: \"models.KeyRestoreParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Restores a backed up key to a vault.\n\nImports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,\nattributes and access control policies. The RESTORE operation may be used to import a\npreviously backed up key. Individual versions of a key cannot be restored. The key is restored\nin its entirety with the same key name as it had when it was backed up. If the key name is not\navailable in the target Key Vault, the RESTORE operation will be rejected. While the key name\nis retained during restore, the final key identifier will change if the key is restored to a\ndifferent vault. Restore will restore all versions and preserve version identifiers. The\nRESTORE operation is subject to security constraints: The target Key Vault must be owned by the\nsame Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission\nin the target Key Vault. This operation requires the keys/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the key.\n:type parameters: ~azure.keyvault.v7_1.models.KeyRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def restore_key(\n self,\n vault_base_url: str,\n parameters: \"models.KeyRestoreParameters\",\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Restores a backed up key to a vault.\n\nImports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,\nattributes and access control policies. The RESTORE operation may be used to import a\npreviously backed up key. Individual versions of a key cannot be restored. The key is restored\nin its entirety with the same key name as it had when it was backed up. If the key name is not\navailable in the target Key Vault, the RESTORE operation will be rejected. While the key name\nis retained during restore, the final key identifier will change if the key is restored to a\ndifferent vault. Restore will restore all versions and preserve version identifiers. The\nRESTORE operation is subject to security constraints: The target Key Vault must be owned by the\nsame Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission\nin the target Key Vault. This operation requires the keys/restore permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param parameters: The parameters to restore the key.\n:type parameters: ~azure.keyvault.v7_1.models.KeyRestoreParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, parameters"
+ },
+ "encrypt" : {
+ "sync": {
+ "signature": "def encrypt(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.\n\nThe ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is\nstored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of\ndata, the size of which is dependent on the target key and the encryption algorithm to be used.\nThe ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault\nsince protection with an asymmetric key can be performed using public portion of the key. This\noperation is supported for asymmetric keys as a convenience for callers that have a key-\nreference but do not have access to the public key material. This operation requires the\nkeys/encrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the encryption operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def encrypt(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.\n\nThe ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is\nstored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of\ndata, the size of which is dependent on the target key and the encryption algorithm to be used.\nThe ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault\nsince protection with an asymmetric key can be performed using public portion of the key. This\noperation is supported for asymmetric keys as a convenience for callers that have a key-\nreference but do not have access to the public key material. This operation requires the\nkeys/encrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the encryption operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "decrypt" : {
+ "sync": {
+ "signature": "def decrypt(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Decrypts a single block of encrypted data.\n\nThe DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption\nkey and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a\nsingle block of data may be decrypted, the size of this block is dependent on the target key\nand the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys\nstored in Azure Key Vault since it uses the private portion of the key. This operation requires\nthe keys/decrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the decryption operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def decrypt(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Decrypts a single block of encrypted data.\n\nThe DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption\nkey and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a\nsingle block of data may be decrypted, the size of this block is dependent on the target key\nand the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys\nstored in Azure Key Vault since it uses the private portion of the key. This operation requires\nthe keys/decrypt permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the decryption operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "sign" : {
+ "sync": {
+ "signature": "def sign(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeySignParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Creates a signature from a digest using the specified key.\n\nThe SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault\nsince this operation uses the private portion of the key. This operation requires the keys/sign\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the signing operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeySignParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def sign(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeySignParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Creates a signature from a digest using the specified key.\n\nThe SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault\nsince this operation uses the private portion of the key. This operation requires the keys/sign\npermission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the signing operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeySignParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "verify" : {
+ "sync": {
+ "signature": "def verify(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyVerifyParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Verifies a signature using a specified key.\n\nThe VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not\nstrictly necessary for asymmetric keys stored in Azure Key Vault since signature verification\ncan be performed using the public portion of the key but this operation is supported as a\nconvenience for callers that only have a key-reference and not the public portion of the key.\nThis operation requires the keys/verify permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for verify operations.\n:type parameters: ~azure.keyvault.v7_1.models.KeyVerifyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyVerifyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyVerifyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def verify(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyVerifyParameters\",\n **kwargs\n) -\u003e \"models.KeyVerifyResult\":\n",
+ "doc": "\"\"\"Verifies a signature using a specified key.\n\nThe VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not\nstrictly necessary for asymmetric keys stored in Azure Key Vault since signature verification\ncan be performed using the public portion of the key but this operation is supported as a\nconvenience for callers that only have a key-reference and not the public portion of the key.\nThis operation requires the keys/verify permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for verify operations.\n:type parameters: ~azure.keyvault.v7_1.models.KeyVerifyParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyVerifyResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyVerifyResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "wrap_key" : {
+ "sync": {
+ "signature": "def wrap_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Wraps a symmetric key using a specified key.\n\nThe WRAP operation supports encryption of a symmetric key using a key encryption key that has\npreviously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for\nsymmetric keys stored in Azure Key Vault since protection with an asymmetric key can be\nperformed using the public portion of the key. This operation is supported for asymmetric keys\nas a convenience for callers that have a key-reference but do not have access to the public key\nmaterial. This operation requires the keys/wrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for wrap operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def wrap_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Wraps a symmetric key using a specified key.\n\nThe WRAP operation supports encryption of a symmetric key using a key encryption key that has\npreviously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for\nsymmetric keys stored in Azure Key Vault since protection with an asymmetric key can be\nperformed using the public portion of the key. This operation is supported for asymmetric keys\nas a convenience for callers that have a key-reference but do not have access to the public key\nmaterial. This operation requires the keys/wrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for wrap operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "unwrap_key" : {
+ "sync": {
+ "signature": "def unwrap_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n key_version, # type: str\n parameters, # type: \"models.KeyOperationsParameters\"\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Unwraps a symmetric key using the specified key that was initially used for wrapping that key.\n\nThe UNWRAP operation supports decryption of a symmetric key using the target key encryption\nkey. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to\nasymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of\nthe key. This operation requires the keys/unwrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the key operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def unwrap_key(\n self,\n vault_base_url: str,\n key_name: str,\n key_version: str,\n parameters: \"models.KeyOperationsParameters\",\n **kwargs\n) -\u003e \"models.KeyOperationResult\":\n",
+ "doc": "\"\"\"Unwraps a symmetric key using the specified key that was initially used for wrapping that key.\n\nThe UNWRAP operation supports decryption of a symmetric key using the target key encryption\nkey. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to\nasymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of\nthe key. This operation requires the keys/unwrapKey permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:param key_version: The version of the key.\n:type key_version: str\n:param parameters: The parameters for the key operation.\n:type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyOperationResult, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyOperationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name, key_version, parameters"
+ },
+ "get_deleted_keys" : {
+ "sync": {
+ "signature": "def get_deleted_keys(\n self,\n vault_base_url, # type: str\n maxresults=None, # type: Optional[int]\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Lists the deleted keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a deleted key. This operation includes deletion-specific information. The Get\nDeleted Keys operation is applicable for vaults enabled for soft-delete. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.DeletedKeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": false,
+ "signature": "def get_deleted_keys(\n self,\n vault_base_url: str,\n maxresults: Optional[int] = None,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.DeletedKeyListResult\"]:\n",
+ "doc": "\"\"\"Lists the deleted keys in the specified vault.\n\nRetrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the\npublic part of a deleted key. This operation includes deletion-specific information. The Get\nDeleted Keys operation is applicable for vaults enabled for soft-delete. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/list permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param maxresults: Maximum number of results to return in a page. If not specified the service\n will return up to 25 results.\n:type maxresults: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.DeletedKeyListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, maxresults"
+ },
+ "get_deleted_key" : {
+ "sync": {
+ "signature": "def get_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Gets the public part of a deleted key.\n\nThe Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def get_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.DeletedKeyBundle\":\n",
+ "doc": "\"\"\"Gets the public part of a deleted key.\n\nThe Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation\ncan be invoked on any vault, it will return an error if invoked on a non soft-delete enabled\nvault. This operation requires the keys/get permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeletedKeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "purge_deleted_key" : {
+ "sync": {
+ "signature": "def purge_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Permanently deletes the specified key.\n\nThe Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the\noperation can be invoked on any vault, it will return an error if invoked on a non soft-delete\nenabled vault. This operation requires the keys/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def purge_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e None:\n",
+ "doc": "\"\"\"Permanently deletes the specified key.\n\nThe Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the\noperation can be invoked on any vault, it will return an error if invoked on a non soft-delete\nenabled vault. This operation requires the keys/purge permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ },
+ "recover_deleted_key" : {
+ "sync": {
+ "signature": "def recover_deleted_key(\n self,\n vault_base_url, # type: str\n key_name, # type: str\n **kwargs # type: Any\n):\n",
+ "doc": "\"\"\"Recovers the deleted key to its latest version.\n\nThe Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.\nIt recovers the deleted key back to its latest version under /keys. An attempt to recover an\nnon-deleted key will return an error. Consider this the inverse of the delete operation on\nsoft-delete enabled vaults. This operation requires the keys/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the deleted key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "async": {
+ "coroutine": true,
+ "signature": "async def recover_deleted_key(\n self,\n vault_base_url: str,\n key_name: str,\n **kwargs\n) -\u003e \"models.KeyBundle\":\n",
+ "doc": "\"\"\"Recovers the deleted key to its latest version.\n\nThe Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.\nIt recovers the deleted key back to its latest version under /keys. An attempt to recover an\nnon-deleted key will return an error. Consider this the inverse of the delete operation on\nsoft-delete enabled vaults. This operation requires the keys/recover permission.\n\n:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.\n:type vault_base_url: str\n:param key_name: The name of the deleted key.\n:type key_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyBundle, or the result of cls(response)\n:rtype: ~azure.keyvault.v7_1.models.KeyBundle\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
+ },
+ "call": "vault_base_url, key_name"
+ }
+ },
+ "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\"]}}}",
+ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}"
+}
\ No newline at end of file
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/version.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/__init__.py
similarity index 75%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/version.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/__init__.py
index 20ba78005d47..71ceadebe430 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/version.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/__init__.py
@@ -1,13 +1,10 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "2016-10-01"
-
+from ._key_vault_client_async import KeyVaultClient
+__all__ = ['KeyVaultClient']
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/_configuration_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/_configuration_async.py
new file mode 100644
index 000000000000..1b0bf1731cfd
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/_configuration_async.py
@@ -0,0 +1,46 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import Any
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+
+VERSION = "unknown"
+
+class KeyVaultClientConfiguration(Configuration):
+ """Configuration for KeyVaultClient.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ """
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ super(KeyVaultClientConfiguration, self).__init__(**kwargs)
+
+ self.api_version = "7.1"
+ kwargs.setdefault('sdk_moniker', 'keyvault/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/_key_vault_client_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/_key_vault_client_async.py
similarity index 69%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/_key_vault_client_async.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/_key_vault_client_async.py
index 482d6336ab1a..2d273c4e45f8 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/_key_vault_client_async.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/_key_vault_client_async.py
@@ -1,16 +1,15 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from typing import Any
+
from azure.core import AsyncPipelineClient
-from msrest import Serializer, Deserializer
+from msrest import Deserializer, Serializer
from ._configuration_async import KeyVaultClientConfiguration
from .operations_async import KeyVaultClientOperationsMixin
@@ -20,27 +19,28 @@
class KeyVaultClient(KeyVaultClientOperationsMixin):
"""The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
-
- :param credentials: Credentials needed for the client to connect to Azure.
- :type credentials: :mod:`A msrestazure Credentials
- object`
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
def __init__(
- self, credentials, **kwargs):
-
+ self,
+ **kwargs: Any
+ ) -> None:
base_url = '{vaultBaseUrl}'
- self._config = KeyVaultClientConfiguration(credentials, **kwargs)
+ self._config = KeyVaultClientConfiguration(**kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
- self.api_version = '7.0'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
- async def __aenter__(self):
+ async def close(self) -> None:
+ await self._client.close()
+
+ async def __aenter__(self) -> "KeyVaultClient":
await self._client.__aenter__()
return self
- async def __aexit__(self, *exc_details):
+
+ async def __aexit__(self, *exc_details) -> None:
await self._client.__aexit__(*exc_details)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/operations_async/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/operations_async/__init__.py
similarity index 90%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/operations_async/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/operations_async/__init__.py
index 771a17ceb80d..b887c97a4206 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/operations_async/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/operations_async/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_operations_async import KeyVaultClientOperationsMixin
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/operations_async/_key_vault_client_operations_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/operations_async/_key_vault_client_operations_async.py
new file mode 100644
index 000000000000..8c14098b490e
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/aio/operations_async/_key_vault_client_operations_async.py
@@ -0,0 +1,1361 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class KeyVaultClientOperationsMixin:
+
+ async def create_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ parameters: "models.KeyCreateParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Creates a new key, stores it, then returns key parameters and attributes to the client.
+
+ The create key operation can be used to create any key type in Azure Key Vault. If the named
+ key already exists, Azure Key Vault creates a new version of the key. It requires the
+ keys/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name for the new key. The system will generate the version name for the
+ new key.
+ :type key_name: str
+ :param parameters: The parameters to create a key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_key.metadata = {'url': '/keys/{key-name}/create'} # type: ignore
+
+ async def import_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ parameters: "models.KeyImportParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Imports an externally created key, stores it, and returns key parameters and attributes to the client.
+
+ The import key operation may be used to import any key type into an Azure Key Vault. If the
+ named key already exists, Azure Key Vault creates a new version of the key. This operation
+ requires the keys/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: Name for the imported key.
+ :type key_name: str
+ :param parameters: The parameters to import a key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ async def delete_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.DeletedKeyBundle":
+ """Deletes a key of any type from storage in Azure Key Vault.
+
+ The delete key operation cannot be used to remove individual versions of a key. This operation
+ removes the cryptographic material associated with the key, which means the key is not usable
+ for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
+ keys/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to delete.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.delete_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ async def update_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyUpdateParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
+
+ In order to perform this operation, the key must already exist in the Key Vault. Note: The
+ cryptographic material of a key itself cannot be changed. This operation requires the
+ keys/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of key to update.
+ :type key_name: str
+ :param key_version: The version of the key to update.
+ :type key_version: str
+ :param parameters: The parameters of the key to update.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ async def get_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Gets the public part of a stored key.
+
+ The get key operation is applicable to all key types. If the requested key is symmetric, then
+ no key material is released in the response. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to get.
+ :type key_name: str
+ :param key_version: Adding the version parameter retrieves a specific version of a key. This
+ URI fragment is optional. If not specified, the latest version of the key is returned.
+ :type key_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.get_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key_versions(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.KeyListResult"]:
+ """Retrieves a list of individual key versions with the same key name.
+
+ The full key identifier, attributes, and tags are provided in the response. This operation
+ requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_key_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_key_versions.metadata = {'url': '/keys/{key-name}/versions'} # type: ignore
+
+ def get_keys(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.KeyListResult"]:
+ """List keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a stored key. The LIST operation is applicable to all key types, however only
+ the base key identifier, attributes, and tags are provided in the response. Individual versions
+ of a key are not listed in the response. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_keys.metadata = {'url': '/keys'} # type: ignore
+
+ async def backup_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.BackupKeyResult":
+ """Requests that a backup of the specified key be downloaded to the client.
+
+ The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this
+ operation does NOT return key material in a form that can be used outside the Azure Key Vault
+ system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key
+ Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
+ Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.
+ The BACKUP operation may be used to export, in protected form, any key type from Azure Key
+ Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed
+ within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be
+ restored to another geographical area. For example, a backup from the US geographical area
+ cannot be restored in an EU geographical area. This operation requires the key/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupKeyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.BackupKeyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupKeyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.backup_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupKeyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_key.metadata = {'url': '/keys/{key-name}/backup'} # type: ignore
+
+ async def restore_key(
+ self,
+ vault_base_url: str,
+ parameters: "models.KeyRestoreParameters",
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Restores a backed up key to a vault.
+
+ Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
+ attributes and access control policies. The RESTORE operation may be used to import a
+ previously backed up key. Individual versions of a key cannot be restored. The key is restored
+ in its entirety with the same key name as it had when it was backed up. If the key name is not
+ available in the target Key Vault, the RESTORE operation will be rejected. While the key name
+ is retained during restore, the final key identifier will change if the key is restored to a
+ different vault. Restore will restore all versions and preserve version identifiers. The
+ RESTORE operation is subject to security constraints: The target Key Vault must be owned by the
+ same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission
+ in the target Key Vault. This operation requires the keys/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_key.metadata = {'url': '/keys/restore'} # type: ignore
+
+ async def encrypt(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
+
+ The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
+ stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of
+ data, the size of which is dependent on the target key and the encryption algorithm to be used.
+ The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
+ since protection with an asymmetric key can be performed using public portion of the key. This
+ operation is supported for asymmetric keys as a convenience for callers that have a key-
+ reference but do not have access to the public key material. This operation requires the
+ keys/encrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the encryption operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.encrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'} # type: ignore
+
+ async def decrypt(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Decrypts a single block of encrypted data.
+
+ The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption
+ key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a
+ single block of data may be decrypted, the size of this block is dependent on the target key
+ and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys
+ stored in Azure Key Vault since it uses the private portion of the key. This operation requires
+ the keys/decrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the decryption operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.decrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'} # type: ignore
+
+ async def sign(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeySignParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Creates a signature from a digest using the specified key.
+
+ The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault
+ since this operation uses the private portion of the key. This operation requires the keys/sign
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the signing operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeySignParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.sign.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeySignParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'} # type: ignore
+
+ async def verify(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyVerifyParameters",
+ **kwargs
+ ) -> "models.KeyVerifyResult":
+ """Verifies a signature using a specified key.
+
+ The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not
+ strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification
+ can be performed using the public portion of the key but this operation is supported as a
+ convenience for callers that only have a key-reference and not the public portion of the key.
+ This operation requires the keys/verify permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for verify operations.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyVerifyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyVerifyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyVerifyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyVerifyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.verify.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyVerifyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'} # type: ignore
+
+ async def wrap_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Wraps a symmetric key using a specified key.
+
+ The WRAP operation supports encryption of a symmetric key using a key encryption key that has
+ previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for
+ symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be
+ performed using the public portion of the key. This operation is supported for asymmetric keys
+ as a convenience for callers that have a key-reference but do not have access to the public key
+ material. This operation requires the keys/wrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for wrap operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.wrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'} # type: ignore
+
+ async def unwrap_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ key_version: str,
+ parameters: "models.KeyOperationsParameters",
+ **kwargs
+ ) -> "models.KeyOperationResult":
+ """Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
+
+ The UNWRAP operation supports decryption of a symmetric key using the target key encryption
+ key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to
+ asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of
+ the key. This operation requires the keys/unwrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the key operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.unwrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'} # type: ignore
+
+ def get_deleted_keys(
+ self,
+ vault_base_url: str,
+ maxresults: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DeletedKeyListResult"]:
+ """Lists the deleted keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a deleted key. This operation includes deletion-specific information. The Get
+ Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_1.models.DeletedKeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedKeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_keys.metadata = {'url': '/deletedkeys'} # type: ignore
+
+ async def get_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.DeletedKeyBundle":
+ """Gets the public part of a deleted key.
+
+ The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.get_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ async def purge_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> None:
+ """Permanently deletes the specified key.
+
+ The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the
+ operation can be invoked on any vault, it will return an error if invoked on a non soft-delete
+ enabled vault. This operation requires the keys/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.purge_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ async def recover_deleted_key(
+ self,
+ vault_base_url: str,
+ key_name: str,
+ **kwargs
+ ) -> "models.KeyBundle":
+ """Recovers the deleted key to its latest version.
+
+ The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.
+ It recovers the deleted key back to its latest version under /keys. An attempt to recover an
+ non-deleted key will return an error. Consider this the inverse of the delete operation on
+ soft-delete enabled vaults. This operation requires the keys/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the deleted key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.recover_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'} # type: ignore
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/__init__.py
new file mode 100644
index 000000000000..48eb2c16009f
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/__init__.py
@@ -0,0 +1,94 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+try:
+ from ._models_py3 import Attributes
+ from ._models_py3 import BackupKeyResult
+ from ._models_py3 import DeletedKeyBundle
+ from ._models_py3 import DeletedKeyItem
+ from ._models_py3 import DeletedKeyListResult
+ from ._models_py3 import Error
+ from ._models_py3 import JsonWebKey
+ from ._models_py3 import KeyAttributes
+ from ._models_py3 import KeyBundle
+ from ._models_py3 import KeyCreateParameters
+ from ._models_py3 import KeyImportParameters
+ from ._models_py3 import KeyItem
+ from ._models_py3 import KeyListResult
+ from ._models_py3 import KeyOperationResult
+ from ._models_py3 import KeyOperationsParameters
+ from ._models_py3 import KeyProperties
+ from ._models_py3 import KeyRestoreParameters
+ from ._models_py3 import KeySignParameters
+ from ._models_py3 import KeyUpdateParameters
+ from ._models_py3 import KeyVaultError
+ from ._models_py3 import KeyVerifyParameters
+ from ._models_py3 import KeyVerifyResult
+except (SyntaxError, ImportError):
+ from ._models import Attributes # type: ignore
+ from ._models import BackupKeyResult # type: ignore
+ from ._models import DeletedKeyBundle # type: ignore
+ from ._models import DeletedKeyItem # type: ignore
+ from ._models import DeletedKeyListResult # type: ignore
+ from ._models import Error # type: ignore
+ from ._models import JsonWebKey # type: ignore
+ from ._models import KeyAttributes # type: ignore
+ from ._models import KeyBundle # type: ignore
+ from ._models import KeyCreateParameters # type: ignore
+ from ._models import KeyImportParameters # type: ignore
+ from ._models import KeyItem # type: ignore
+ from ._models import KeyListResult # type: ignore
+ from ._models import KeyOperationResult # type: ignore
+ from ._models import KeyOperationsParameters # type: ignore
+ from ._models import KeyProperties # type: ignore
+ from ._models import KeyRestoreParameters # type: ignore
+ from ._models import KeySignParameters # type: ignore
+ from ._models import KeyUpdateParameters # type: ignore
+ from ._models import KeyVaultError # type: ignore
+ from ._models import KeyVerifyParameters # type: ignore
+ from ._models import KeyVerifyResult # type: ignore
+
+from ._key_vault_client_enums import (
+ DeletionRecoveryLevel,
+ JsonWebKeyCurveName,
+ JsonWebKeyEncryptionAlgorithm,
+ JsonWebKeyOperation,
+ JsonWebKeySignatureAlgorithm,
+ JsonWebKeyType,
+)
+
+__all__ = [
+ 'Attributes',
+ 'BackupKeyResult',
+ 'DeletedKeyBundle',
+ 'DeletedKeyItem',
+ 'DeletedKeyListResult',
+ 'Error',
+ 'JsonWebKey',
+ 'KeyAttributes',
+ 'KeyBundle',
+ 'KeyCreateParameters',
+ 'KeyImportParameters',
+ 'KeyItem',
+ 'KeyListResult',
+ 'KeyOperationResult',
+ 'KeyOperationsParameters',
+ 'KeyProperties',
+ 'KeyRestoreParameters',
+ 'KeySignParameters',
+ 'KeyUpdateParameters',
+ 'KeyVaultError',
+ 'KeyVerifyParameters',
+ 'KeyVerifyResult',
+ 'DeletionRecoveryLevel',
+ 'JsonWebKeyCurveName',
+ 'JsonWebKeyEncryptionAlgorithm',
+ 'JsonWebKeyOperation',
+ 'JsonWebKeySignatureAlgorithm',
+ 'JsonWebKeyType',
+]
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_key_vault_client_enums.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_key_vault_client_enums.py
new file mode 100644
index 000000000000..90f28ab36624
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_key_vault_client_enums.py
@@ -0,0 +1,98 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from enum import Enum, EnumMeta
+from six import with_metaclass
+
+class _CaseInsensitiveEnumMeta(EnumMeta):
+ def __getitem__(self, name):
+ return super().__getitem__(name.upper())
+
+ def __getattr__(cls, name):
+ """Return the enum member matching `name`
+ We use __getattr__ instead of descriptors or inserting into the enum
+ class' __dict__ in order to support `name` and `value` being both
+ properties for enum members (which live in the class' __dict__) and
+ enum members themselves.
+ """
+ try:
+ return cls._member_map_[name.upper()]
+ except KeyError:
+ raise AttributeError(name)
+
+
+class DeletionRecoveryLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """Reflects the deletion recovery level currently in effect for keys in the current vault. If it
+ contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only
+ the system can purge the key, at the end of the retention interval.
+ """
+
+ PURGEABLE = "Purgeable" #: Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.).
+ RECOVERABLE_PURGEABLE = "Recoverable+Purgeable" #: Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered.
+ RECOVERABLE = "Recoverable" #: Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not recovered.
+ RECOVERABLE_PROTECTED_SUBSCRIPTION = "Recoverable+ProtectedSubscription" #: Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered.
+ CUSTOMIZED_RECOVERABLE_PURGEABLE = "CustomizedRecoverable+Purgeable" #: Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription is cancelled.
+ CUSTOMIZED_RECOVERABLE = "CustomizedRecoverable" #: Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval and while the subscription is still available.
+ CUSTOMIZED_RECOVERABLE_PROTECTED_SUBSCRIPTION = "CustomizedRecoverable+ProtectedSubscription" #: Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7<= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled.
+
+class JsonWebKeyCurveName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """Elliptic curve name. For valid values, see JsonWebKeyCurveName.
+ """
+
+ P256 = "P-256" #: The NIST P-256 elliptic curve, AKA SECG curve SECP256R1.
+ P384 = "P-384" #: The NIST P-384 elliptic curve, AKA SECG curve SECP384R1.
+ P521 = "P-521" #: The NIST P-521 elliptic curve, AKA SECG curve SECP521R1.
+ P256_K = "P-256K" #: The SECG SECP256K1 elliptic curve.
+
+class JsonWebKeyEncryptionAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """algorithm identifier
+ """
+
+ RSA_OAEP = "RSA-OAEP"
+ RSA_OAEP256 = "RSA-OAEP-256"
+ RSA1_5 = "RSA1_5"
+
+class JsonWebKeyOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """JSON web key operations. For more information, see JsonWebKeyOperation.
+ """
+
+ ENCRYPT = "encrypt"
+ DECRYPT = "decrypt"
+ SIGN = "sign"
+ VERIFY = "verify"
+ WRAP_KEY = "wrapKey"
+ UNWRAP_KEY = "unwrapKey"
+ IMPORT_ENUM = "import"
+
+class JsonWebKeySignatureAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The signing/verification algorithm identifier. For more information on possible algorithm
+ types, see JsonWebKeySignatureAlgorithm.
+ """
+
+ PS256 = "PS256" #: RSASSA-PSS using SHA-256 and MGF1 with SHA-256, as described in https://tools.ietf.org/html/rfc7518.
+ PS384 = "PS384" #: RSASSA-PSS using SHA-384 and MGF1 with SHA-384, as described in https://tools.ietf.org/html/rfc7518.
+ PS512 = "PS512" #: RSASSA-PSS using SHA-512 and MGF1 with SHA-512, as described in https://tools.ietf.org/html/rfc7518.
+ RS256 = "RS256" #: RSASSA-PKCS1-v1_5 using SHA-256, as described in https://tools.ietf.org/html/rfc7518.
+ RS384 = "RS384" #: RSASSA-PKCS1-v1_5 using SHA-384, as described in https://tools.ietf.org/html/rfc7518.
+ RS512 = "RS512" #: RSASSA-PKCS1-v1_5 using SHA-512, as described in https://tools.ietf.org/html/rfc7518.
+ RSNULL = "RSNULL" #: Reserved.
+ ES256 = "ES256" #: ECDSA using P-256 and SHA-256, as described in https://tools.ietf.org/html/rfc7518.
+ ES384 = "ES384" #: ECDSA using P-384 and SHA-384, as described in https://tools.ietf.org/html/rfc7518.
+ ES512 = "ES512" #: ECDSA using P-521 and SHA-512, as described in https://tools.ietf.org/html/rfc7518.
+ ES256_K = "ES256K" #: ECDSA using P-256K and SHA-256, as described in https://tools.ietf.org/html/rfc7518.
+
+class JsonWebKeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-
+ algorithms-40.
+ """
+
+ EC = "EC" #: Elliptic Curve.
+ EC_HSM = "EC-HSM" #: Elliptic Curve with a private key which is not exportable from the HSM.
+ RSA = "RSA" #: RSA (https://tools.ietf.org/html/rfc3447).
+ RSA_HSM = "RSA-HSM" #: RSA with a private key which is not exportable from the HSM.
+ OCT = "oct" #: Octet sequence (used to represent symmetric keys).
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_models.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_models.py
new file mode 100644
index 000000000000..2738d13b5d2f
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_models.py
@@ -0,0 +1,837 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+
+class Attributes(msrest.serialization.Model):
+ """The object attributes managed by the KeyVault service.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param enabled: Determines whether the object is enabled.
+ :type enabled: bool
+ :param not_before: Not before date in UTC.
+ :type not_before: ~datetime.datetime
+ :param expires: Expiry date in UTC.
+ :type expires: ~datetime.datetime
+ :ivar created: Creation time in UTC.
+ :vartype created: ~datetime.datetime
+ :ivar updated: Last updated time in UTC.
+ :vartype updated: ~datetime.datetime
+ """
+
+ _validation = {
+ 'created': {'readonly': True},
+ 'updated': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'enabled': {'key': 'enabled', 'type': 'bool'},
+ 'not_before': {'key': 'nbf', 'type': 'unix-time'},
+ 'expires': {'key': 'exp', 'type': 'unix-time'},
+ 'created': {'key': 'created', 'type': 'unix-time'},
+ 'updated': {'key': 'updated', 'type': 'unix-time'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(Attributes, self).__init__(**kwargs)
+ self.enabled = kwargs.get('enabled', None)
+ self.not_before = kwargs.get('not_before', None)
+ self.expires = kwargs.get('expires', None)
+ self.created = None
+ self.updated = None
+
+
+class BackupKeyResult(msrest.serialization.Model):
+ """The backup key result, containing the backup blob.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: The backup blob containing the backed up key.
+ :vartype value: bytes
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(BackupKeyResult, self).__init__(**kwargs)
+ self.value = None
+
+
+class KeyBundle(msrest.serialization.Model):
+ """A KeyBundle consisting of a WebKey plus its attributes.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param key: The Json web key.
+ :type key: ~azure.keyvault.v7_1.models.JsonWebKey
+ :param attributes: The key management attributes.
+ :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
+ :vartype managed: bool
+ """
+
+ _validation = {
+ 'managed': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'key': {'key': 'key', 'type': 'JsonWebKey'},
+ 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'managed': {'key': 'managed', 'type': 'bool'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyBundle, self).__init__(**kwargs)
+ self.key = kwargs.get('key', None)
+ self.attributes = kwargs.get('attributes', None)
+ self.tags = kwargs.get('tags', None)
+ self.managed = None
+
+
+class DeletedKeyBundle(KeyBundle):
+ """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param key: The Json web key.
+ :type key: ~azure.keyvault.v7_1.models.JsonWebKey
+ :param attributes: The key management attributes.
+ :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
+ :vartype managed: bool
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
+ :type recovery_id: str
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
+ """
+
+ _validation = {
+ 'managed': {'readonly': True},
+ 'scheduled_purge_date': {'readonly': True},
+ 'deleted_date': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'key': {'key': 'key', 'type': 'JsonWebKey'},
+ 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'managed': {'key': 'managed', 'type': 'bool'},
+ 'recovery_id': {'key': 'recoveryId', 'type': 'str'},
+ 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'},
+ 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(DeletedKeyBundle, self).__init__(**kwargs)
+ self.recovery_id = kwargs.get('recovery_id', None)
+ self.scheduled_purge_date = None
+ self.deleted_date = None
+
+
+class KeyItem(msrest.serialization.Model):
+ """The key item containing key metadata.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param kid: Key identifier.
+ :type kid: str
+ :param attributes: The key management attributes.
+ :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
+ :vartype managed: bool
+ """
+
+ _validation = {
+ 'managed': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'kid': {'key': 'kid', 'type': 'str'},
+ 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'managed': {'key': 'managed', 'type': 'bool'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyItem, self).__init__(**kwargs)
+ self.kid = kwargs.get('kid', None)
+ self.attributes = kwargs.get('attributes', None)
+ self.tags = kwargs.get('tags', None)
+ self.managed = None
+
+
+class DeletedKeyItem(KeyItem):
+ """The deleted key item containing the deleted key metadata and information about deletion.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param kid: Key identifier.
+ :type kid: str
+ :param attributes: The key management attributes.
+ :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
+ :vartype managed: bool
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
+ :type recovery_id: str
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
+ """
+
+ _validation = {
+ 'managed': {'readonly': True},
+ 'scheduled_purge_date': {'readonly': True},
+ 'deleted_date': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'kid': {'key': 'kid', 'type': 'str'},
+ 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'managed': {'key': 'managed', 'type': 'bool'},
+ 'recovery_id': {'key': 'recoveryId', 'type': 'str'},
+ 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'},
+ 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(DeletedKeyItem, self).__init__(**kwargs)
+ self.recovery_id = kwargs.get('recovery_id', None)
+ self.scheduled_purge_date = None
+ self.deleted_date = None
+
+
+class DeletedKeyListResult(msrest.serialization.Model):
+ """A list of keys that have been deleted in this vault.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: A response message containing a list of deleted keys in the vault along with a
+ link to the next page of deleted keys.
+ :vartype value: list[~azure.keyvault.v7_1.models.DeletedKeyItem]
+ :ivar next_link: The URL to get the next set of deleted keys.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[DeletedKeyItem]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(DeletedKeyListResult, self).__init__(**kwargs)
+ self.value = None
+ self.next_link = None
+
+
+class Error(msrest.serialization.Model):
+ """The key vault server error.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar code: The error code.
+ :vartype code: str
+ :ivar message: The error message.
+ :vartype message: str
+ :ivar inner_error: The key vault server error.
+ :vartype inner_error: ~azure.keyvault.v7_1.models.Error
+ """
+
+ _validation = {
+ 'code': {'readonly': True},
+ 'message': {'readonly': True},
+ 'inner_error': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'code': {'key': 'code', 'type': 'str'},
+ 'message': {'key': 'message', 'type': 'str'},
+ 'inner_error': {'key': 'innererror', 'type': 'Error'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(Error, self).__init__(**kwargs)
+ self.code = None
+ self.message = None
+ self.inner_error = None
+
+
+class JsonWebKey(msrest.serialization.Model):
+ """As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18.
+
+ :param kid: Key identifier.
+ :type kid: str
+ :param kty: JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-
+ jose-json-web-algorithms-40. Possible values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
+ :type kty: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
+ :param key_ops:
+ :type key_ops: list[str]
+ :param n: RSA modulus.
+ :type n: bytes
+ :param e: RSA public exponent.
+ :type e: bytes
+ :param d: RSA private exponent, or the D component of an EC private key.
+ :type d: bytes
+ :param dp: RSA private key parameter.
+ :type dp: bytes
+ :param dq: RSA private key parameter.
+ :type dq: bytes
+ :param qi: RSA private key parameter.
+ :type qi: bytes
+ :param p: RSA secret prime.
+ :type p: bytes
+ :param q: RSA secret prime, with p < q.
+ :type q: bytes
+ :param k: Symmetric key.
+ :type k: bytes
+ :param t: HSM Token, used with 'Bring Your Own Key'.
+ :type t: bytes
+ :param crv: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
+ :type crv: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
+ :param x: X component of an EC public key.
+ :type x: bytes
+ :param y: Y component of an EC public key.
+ :type y: bytes
+ """
+
+ _attribute_map = {
+ 'kid': {'key': 'kid', 'type': 'str'},
+ 'kty': {'key': 'kty', 'type': 'str'},
+ 'key_ops': {'key': 'key_ops', 'type': '[str]'},
+ 'n': {'key': 'n', 'type': 'base64'},
+ 'e': {'key': 'e', 'type': 'base64'},
+ 'd': {'key': 'd', 'type': 'base64'},
+ 'dp': {'key': 'dp', 'type': 'base64'},
+ 'dq': {'key': 'dq', 'type': 'base64'},
+ 'qi': {'key': 'qi', 'type': 'base64'},
+ 'p': {'key': 'p', 'type': 'base64'},
+ 'q': {'key': 'q', 'type': 'base64'},
+ 'k': {'key': 'k', 'type': 'base64'},
+ 't': {'key': 'key_hsm', 'type': 'base64'},
+ 'crv': {'key': 'crv', 'type': 'str'},
+ 'x': {'key': 'x', 'type': 'base64'},
+ 'y': {'key': 'y', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(JsonWebKey, self).__init__(**kwargs)
+ self.kid = kwargs.get('kid', None)
+ self.kty = kwargs.get('kty', None)
+ self.key_ops = kwargs.get('key_ops', None)
+ self.n = kwargs.get('n', None)
+ self.e = kwargs.get('e', None)
+ self.d = kwargs.get('d', None)
+ self.dp = kwargs.get('dp', None)
+ self.dq = kwargs.get('dq', None)
+ self.qi = kwargs.get('qi', None)
+ self.p = kwargs.get('p', None)
+ self.q = kwargs.get('q', None)
+ self.k = kwargs.get('k', None)
+ self.t = kwargs.get('t', None)
+ self.crv = kwargs.get('crv', None)
+ self.x = kwargs.get('x', None)
+ self.y = kwargs.get('y', None)
+
+
+class KeyAttributes(Attributes):
+ """The attributes of a key managed by the key vault service.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param enabled: Determines whether the object is enabled.
+ :type enabled: bool
+ :param not_before: Not before date in UTC.
+ :type not_before: ~datetime.datetime
+ :param expires: Expiry date in UTC.
+ :type expires: ~datetime.datetime
+ :ivar created: Creation time in UTC.
+ :vartype created: ~datetime.datetime
+ :ivar updated: Last updated time in UTC.
+ :vartype updated: ~datetime.datetime
+ :ivar recoverable_days: softDelete data retention days. Value should be >=7 and <=90 when
+ softDelete enabled, otherwise 0.
+ :vartype recoverable_days: int
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for keys in the
+ current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged
+ user; otherwise, only the system can purge the key, at the end of the retention interval.
+ Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
+ "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_1.models.DeletionRecoveryLevel
+ """
+
+ _validation = {
+ 'created': {'readonly': True},
+ 'updated': {'readonly': True},
+ 'recoverable_days': {'readonly': True},
+ 'recovery_level': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'enabled': {'key': 'enabled', 'type': 'bool'},
+ 'not_before': {'key': 'nbf', 'type': 'unix-time'},
+ 'expires': {'key': 'exp', 'type': 'unix-time'},
+ 'created': {'key': 'created', 'type': 'unix-time'},
+ 'updated': {'key': 'updated', 'type': 'unix-time'},
+ 'recoverable_days': {'key': 'recoverableDays', 'type': 'int'},
+ 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyAttributes, self).__init__(**kwargs)
+ self.recoverable_days = None
+ self.recovery_level = None
+
+
+class KeyCreateParameters(msrest.serialization.Model):
+ """The key create parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param kty: Required. The type of key to create. For valid values, see JsonWebKeyType. Possible
+ values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
+ :type kty: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
+ :type key_size: int
+ :param key_ops:
+ :type key_ops: list[str or ~azure.keyvault.v7_1.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
+ :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
+ :type curve: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
+ """
+
+ _validation = {
+ 'kty': {'required': True},
+ }
+
+ _attribute_map = {
+ 'kty': {'key': 'kty', 'type': 'str'},
+ 'key_size': {'key': 'key_size', 'type': 'int'},
+ 'key_ops': {'key': 'key_ops', 'type': '[str]'},
+ 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'curve': {'key': 'crv', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyCreateParameters, self).__init__(**kwargs)
+ self.kty = kwargs['kty']
+ self.key_size = kwargs.get('key_size', None)
+ self.key_ops = kwargs.get('key_ops', None)
+ self.key_attributes = kwargs.get('key_attributes', None)
+ self.tags = kwargs.get('tags', None)
+ self.curve = kwargs.get('curve', None)
+
+
+class KeyImportParameters(msrest.serialization.Model):
+ """The key import parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param hsm: Whether to import as a hardware key (HSM) or software key.
+ :type hsm: bool
+ :param key: Required. The Json web key.
+ :type key: ~azure.keyvault.v7_1.models.JsonWebKey
+ :param key_attributes: The key management attributes.
+ :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ """
+
+ _validation = {
+ 'key': {'required': True},
+ }
+
+ _attribute_map = {
+ 'hsm': {'key': 'Hsm', 'type': 'bool'},
+ 'key': {'key': 'key', 'type': 'JsonWebKey'},
+ 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyImportParameters, self).__init__(**kwargs)
+ self.hsm = kwargs.get('hsm', None)
+ self.key = kwargs['key']
+ self.key_attributes = kwargs.get('key_attributes', None)
+ self.tags = kwargs.get('tags', None)
+
+
+class KeyListResult(msrest.serialization.Model):
+ """The key list result.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: A response message containing a list of keys in the key vault along with a link to
+ the next page of keys.
+ :vartype value: list[~azure.keyvault.v7_1.models.KeyItem]
+ :ivar next_link: The URL to get the next set of keys.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[KeyItem]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyListResult, self).__init__(**kwargs)
+ self.value = None
+ self.next_link = None
+
+
+class KeyOperationResult(msrest.serialization.Model):
+ """The key operation result.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar kid: Key identifier.
+ :vartype kid: str
+ :ivar result:
+ :vartype result: bytes
+ """
+
+ _validation = {
+ 'kid': {'readonly': True},
+ 'result': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'kid': {'key': 'kid', 'type': 'str'},
+ 'result': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyOperationResult, self).__init__(**kwargs)
+ self.kid = None
+ self.result = None
+
+
+class KeyOperationsParameters(msrest.serialization.Model):
+ """The key operations parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param algorithm: Required. algorithm identifier. Possible values include: "RSA-OAEP", "RSA-
+ OAEP-256", "RSA1_5".
+ :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeyEncryptionAlgorithm
+ :param value: Required.
+ :type value: bytes
+ """
+
+ _validation = {
+ 'algorithm': {'required': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ 'algorithm': {'key': 'alg', 'type': 'str'},
+ 'value': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyOperationsParameters, self).__init__(**kwargs)
+ self.algorithm = kwargs['algorithm']
+ self.value = kwargs['value']
+
+
+class KeyProperties(msrest.serialization.Model):
+ """Properties of the key pair backing a certificate.
+
+ :param exportable: Indicates if the private key can be exported.
+ :type exportable: bool
+ :param key_type: The type of key pair to be used for the certificate. Possible values include:
+ "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
+ :type key_type: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
+ :type key_size: int
+ :param reuse_key: Indicates if the same key pair will be used on certificate renewal.
+ :type reuse_key: bool
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
+ :type curve: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
+ """
+
+ _attribute_map = {
+ 'exportable': {'key': 'exportable', 'type': 'bool'},
+ 'key_type': {'key': 'kty', 'type': 'str'},
+ 'key_size': {'key': 'key_size', 'type': 'int'},
+ 'reuse_key': {'key': 'reuse_key', 'type': 'bool'},
+ 'curve': {'key': 'crv', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyProperties, self).__init__(**kwargs)
+ self.exportable = kwargs.get('exportable', None)
+ self.key_type = kwargs.get('key_type', None)
+ self.key_size = kwargs.get('key_size', None)
+ self.reuse_key = kwargs.get('reuse_key', None)
+ self.curve = kwargs.get('curve', None)
+
+
+class KeyRestoreParameters(msrest.serialization.Model):
+ """The key restore parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param key_bundle_backup: Required. The backup blob associated with a key bundle.
+ :type key_bundle_backup: bytes
+ """
+
+ _validation = {
+ 'key_bundle_backup': {'required': True},
+ }
+
+ _attribute_map = {
+ 'key_bundle_backup': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyRestoreParameters, self).__init__(**kwargs)
+ self.key_bundle_backup = kwargs['key_bundle_backup']
+
+
+class KeySignParameters(msrest.serialization.Model):
+ """The key operations parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param algorithm: Required. The signing/verification algorithm identifier. For more information
+ on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include:
+ "PS256", "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512",
+ "ES256K".
+ :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeySignatureAlgorithm
+ :param value: Required.
+ :type value: bytes
+ """
+
+ _validation = {
+ 'algorithm': {'required': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ 'algorithm': {'key': 'alg', 'type': 'str'},
+ 'value': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeySignParameters, self).__init__(**kwargs)
+ self.algorithm = kwargs['algorithm']
+ self.value = kwargs['value']
+
+
+class KeyUpdateParameters(msrest.serialization.Model):
+ """The key update parameters.
+
+ :param key_ops: Json web key operations. For more information on possible key operations, see
+ JsonWebKeyOperation.
+ :type key_ops: list[str or ~azure.keyvault.v7_1.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
+ :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ """
+
+ _attribute_map = {
+ 'key_ops': {'key': 'key_ops', 'type': '[str]'},
+ 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyUpdateParameters, self).__init__(**kwargs)
+ self.key_ops = kwargs.get('key_ops', None)
+ self.key_attributes = kwargs.get('key_attributes', None)
+ self.tags = kwargs.get('tags', None)
+
+
+class KeyVaultError(msrest.serialization.Model):
+ """The key vault error exception.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar error: The key vault server error.
+ :vartype error: ~azure.keyvault.v7_1.models.Error
+ """
+
+ _validation = {
+ 'error': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'error': {'key': 'error', 'type': 'Error'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyVaultError, self).__init__(**kwargs)
+ self.error = None
+
+
+class KeyVerifyParameters(msrest.serialization.Model):
+ """The key verify parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param algorithm: Required. The signing/verification algorithm. For more information on
+ possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: "PS256",
+ "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512", "ES256K".
+ :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeySignatureAlgorithm
+ :param digest: Required. The digest used for signing.
+ :type digest: bytes
+ :param signature: Required. The signature to be verified.
+ :type signature: bytes
+ """
+
+ _validation = {
+ 'algorithm': {'required': True},
+ 'digest': {'required': True},
+ 'signature': {'required': True},
+ }
+
+ _attribute_map = {
+ 'algorithm': {'key': 'alg', 'type': 'str'},
+ 'digest': {'key': 'digest', 'type': 'base64'},
+ 'signature': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyVerifyParameters, self).__init__(**kwargs)
+ self.algorithm = kwargs['algorithm']
+ self.digest = kwargs['digest']
+ self.signature = kwargs['signature']
+
+
+class KeyVerifyResult(msrest.serialization.Model):
+ """The key verify result.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: True if the signature is verified, otherwise false.
+ :vartype value: bool
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': 'bool'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyVerifyResult, self).__init__(**kwargs)
+ self.value = None
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_models_py3.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_models_py3.py
new file mode 100644
index 000000000000..63a59b046b7a
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/models/_models_py3.py
@@ -0,0 +1,919 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+import datetime
+from typing import Dict, List, Optional, Union
+
+from azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+from ._key_vault_client_enums import *
+
+
+class Attributes(msrest.serialization.Model):
+ """The object attributes managed by the KeyVault service.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param enabled: Determines whether the object is enabled.
+ :type enabled: bool
+ :param not_before: Not before date in UTC.
+ :type not_before: ~datetime.datetime
+ :param expires: Expiry date in UTC.
+ :type expires: ~datetime.datetime
+ :ivar created: Creation time in UTC.
+ :vartype created: ~datetime.datetime
+ :ivar updated: Last updated time in UTC.
+ :vartype updated: ~datetime.datetime
+ """
+
+ _validation = {
+ 'created': {'readonly': True},
+ 'updated': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'enabled': {'key': 'enabled', 'type': 'bool'},
+ 'not_before': {'key': 'nbf', 'type': 'unix-time'},
+ 'expires': {'key': 'exp', 'type': 'unix-time'},
+ 'created': {'key': 'created', 'type': 'unix-time'},
+ 'updated': {'key': 'updated', 'type': 'unix-time'},
+ }
+
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
+ super(Attributes, self).__init__(**kwargs)
+ self.enabled = enabled
+ self.not_before = not_before
+ self.expires = expires
+ self.created = None
+ self.updated = None
+
+
+class BackupKeyResult(msrest.serialization.Model):
+ """The backup key result, containing the backup blob.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: The backup blob containing the backed up key.
+ :vartype value: bytes
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(BackupKeyResult, self).__init__(**kwargs)
+ self.value = None
+
+
+class KeyBundle(msrest.serialization.Model):
+ """A KeyBundle consisting of a WebKey plus its attributes.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param key: The Json web key.
+ :type key: ~azure.keyvault.v7_1.models.JsonWebKey
+ :param attributes: The key management attributes.
+ :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
+ :vartype managed: bool
+ """
+
+ _validation = {
+ 'managed': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'key': {'key': 'key', 'type': 'JsonWebKey'},
+ 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'managed': {'key': 'managed', 'type': 'bool'},
+ }
+
+ def __init__(
+ self,
+ *,
+ key: Optional["JsonWebKey"] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
+ super(KeyBundle, self).__init__(**kwargs)
+ self.key = key
+ self.attributes = attributes
+ self.tags = tags
+ self.managed = None
+
+
+class DeletedKeyBundle(KeyBundle):
+ """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param key: The Json web key.
+ :type key: ~azure.keyvault.v7_1.models.JsonWebKey
+ :param attributes: The key management attributes.
+ :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
+ :vartype managed: bool
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
+ :type recovery_id: str
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
+ """
+
+ _validation = {
+ 'managed': {'readonly': True},
+ 'scheduled_purge_date': {'readonly': True},
+ 'deleted_date': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'key': {'key': 'key', 'type': 'JsonWebKey'},
+ 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'managed': {'key': 'managed', 'type': 'bool'},
+ 'recovery_id': {'key': 'recoveryId', 'type': 'str'},
+ 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'},
+ 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
+ }
+
+ def __init__(
+ self,
+ *,
+ key: Optional["JsonWebKey"] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
+ super(DeletedKeyBundle, self).__init__(key=key, attributes=attributes, tags=tags, **kwargs)
+ self.recovery_id = recovery_id
+ self.scheduled_purge_date = None
+ self.deleted_date = None
+
+
+class KeyItem(msrest.serialization.Model):
+ """The key item containing key metadata.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param kid: Key identifier.
+ :type kid: str
+ :param attributes: The key management attributes.
+ :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
+ :vartype managed: bool
+ """
+
+ _validation = {
+ 'managed': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'kid': {'key': 'kid', 'type': 'str'},
+ 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'managed': {'key': 'managed', 'type': 'bool'},
+ }
+
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
+ super(KeyItem, self).__init__(**kwargs)
+ self.kid = kid
+ self.attributes = attributes
+ self.tags = tags
+ self.managed = None
+
+
+class DeletedKeyItem(KeyItem):
+ """The deleted key item containing the deleted key metadata and information about deletion.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param kid: Key identifier.
+ :type kid: str
+ :param attributes: The key management attributes.
+ :type attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :ivar managed: True if the key's lifetime is managed by key vault. If this is a key backing a
+ certificate, then managed will be true.
+ :vartype managed: bool
+ :param recovery_id: The url of the recovery object, used to identify and recover the deleted
+ key.
+ :type recovery_id: str
+ :ivar scheduled_purge_date: The time when the key is scheduled to be purged, in UTC.
+ :vartype scheduled_purge_date: ~datetime.datetime
+ :ivar deleted_date: The time when the key was deleted, in UTC.
+ :vartype deleted_date: ~datetime.datetime
+ """
+
+ _validation = {
+ 'managed': {'readonly': True},
+ 'scheduled_purge_date': {'readonly': True},
+ 'deleted_date': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'kid': {'key': 'kid', 'type': 'str'},
+ 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'managed': {'key': 'managed', 'type': 'bool'},
+ 'recovery_id': {'key': 'recoveryId', 'type': 'str'},
+ 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'},
+ 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'},
+ }
+
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ recovery_id: Optional[str] = None,
+ **kwargs
+ ):
+ super(DeletedKeyItem, self).__init__(kid=kid, attributes=attributes, tags=tags, **kwargs)
+ self.recovery_id = recovery_id
+ self.scheduled_purge_date = None
+ self.deleted_date = None
+
+
+class DeletedKeyListResult(msrest.serialization.Model):
+ """A list of keys that have been deleted in this vault.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: A response message containing a list of deleted keys in the vault along with a
+ link to the next page of deleted keys.
+ :vartype value: list[~azure.keyvault.v7_1.models.DeletedKeyItem]
+ :ivar next_link: The URL to get the next set of deleted keys.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[DeletedKeyItem]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(DeletedKeyListResult, self).__init__(**kwargs)
+ self.value = None
+ self.next_link = None
+
+
+class Error(msrest.serialization.Model):
+ """The key vault server error.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar code: The error code.
+ :vartype code: str
+ :ivar message: The error message.
+ :vartype message: str
+ :ivar inner_error: The key vault server error.
+ :vartype inner_error: ~azure.keyvault.v7_1.models.Error
+ """
+
+ _validation = {
+ 'code': {'readonly': True},
+ 'message': {'readonly': True},
+ 'inner_error': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'code': {'key': 'code', 'type': 'str'},
+ 'message': {'key': 'message', 'type': 'str'},
+ 'inner_error': {'key': 'innererror', 'type': 'Error'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(Error, self).__init__(**kwargs)
+ self.code = None
+ self.message = None
+ self.inner_error = None
+
+
+class JsonWebKey(msrest.serialization.Model):
+ """As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18.
+
+ :param kid: Key identifier.
+ :type kid: str
+ :param kty: JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-
+ jose-json-web-algorithms-40. Possible values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
+ :type kty: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
+ :param key_ops:
+ :type key_ops: list[str]
+ :param n: RSA modulus.
+ :type n: bytes
+ :param e: RSA public exponent.
+ :type e: bytes
+ :param d: RSA private exponent, or the D component of an EC private key.
+ :type d: bytes
+ :param dp: RSA private key parameter.
+ :type dp: bytes
+ :param dq: RSA private key parameter.
+ :type dq: bytes
+ :param qi: RSA private key parameter.
+ :type qi: bytes
+ :param p: RSA secret prime.
+ :type p: bytes
+ :param q: RSA secret prime, with p < q.
+ :type q: bytes
+ :param k: Symmetric key.
+ :type k: bytes
+ :param t: HSM Token, used with 'Bring Your Own Key'.
+ :type t: bytes
+ :param crv: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
+ :type crv: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
+ :param x: X component of an EC public key.
+ :type x: bytes
+ :param y: Y component of an EC public key.
+ :type y: bytes
+ """
+
+ _attribute_map = {
+ 'kid': {'key': 'kid', 'type': 'str'},
+ 'kty': {'key': 'kty', 'type': 'str'},
+ 'key_ops': {'key': 'key_ops', 'type': '[str]'},
+ 'n': {'key': 'n', 'type': 'base64'},
+ 'e': {'key': 'e', 'type': 'base64'},
+ 'd': {'key': 'd', 'type': 'base64'},
+ 'dp': {'key': 'dp', 'type': 'base64'},
+ 'dq': {'key': 'dq', 'type': 'base64'},
+ 'qi': {'key': 'qi', 'type': 'base64'},
+ 'p': {'key': 'p', 'type': 'base64'},
+ 'q': {'key': 'q', 'type': 'base64'},
+ 'k': {'key': 'k', 'type': 'base64'},
+ 't': {'key': 'key_hsm', 'type': 'base64'},
+ 'crv': {'key': 'crv', 'type': 'str'},
+ 'x': {'key': 'x', 'type': 'base64'},
+ 'y': {'key': 'y', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ *,
+ kid: Optional[str] = None,
+ kty: Optional[Union[str, "JsonWebKeyType"]] = None,
+ key_ops: Optional[List[str]] = None,
+ n: Optional[bytes] = None,
+ e: Optional[bytes] = None,
+ d: Optional[bytes] = None,
+ dp: Optional[bytes] = None,
+ dq: Optional[bytes] = None,
+ qi: Optional[bytes] = None,
+ p: Optional[bytes] = None,
+ q: Optional[bytes] = None,
+ k: Optional[bytes] = None,
+ t: Optional[bytes] = None,
+ crv: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
+ x: Optional[bytes] = None,
+ y: Optional[bytes] = None,
+ **kwargs
+ ):
+ super(JsonWebKey, self).__init__(**kwargs)
+ self.kid = kid
+ self.kty = kty
+ self.key_ops = key_ops
+ self.n = n
+ self.e = e
+ self.d = d
+ self.dp = dp
+ self.dq = dq
+ self.qi = qi
+ self.p = p
+ self.q = q
+ self.k = k
+ self.t = t
+ self.crv = crv
+ self.x = x
+ self.y = y
+
+
+class KeyAttributes(Attributes):
+ """The attributes of a key managed by the key vault service.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param enabled: Determines whether the object is enabled.
+ :type enabled: bool
+ :param not_before: Not before date in UTC.
+ :type not_before: ~datetime.datetime
+ :param expires: Expiry date in UTC.
+ :type expires: ~datetime.datetime
+ :ivar created: Creation time in UTC.
+ :vartype created: ~datetime.datetime
+ :ivar updated: Last updated time in UTC.
+ :vartype updated: ~datetime.datetime
+ :ivar recoverable_days: softDelete data retention days. Value should be >=7 and <=90 when
+ softDelete enabled, otherwise 0.
+ :vartype recoverable_days: int
+ :ivar recovery_level: Reflects the deletion recovery level currently in effect for keys in the
+ current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged
+ user; otherwise, only the system can purge the key, at the end of the retention interval.
+ Possible values include: "Purgeable", "Recoverable+Purgeable", "Recoverable",
+ "Recoverable+ProtectedSubscription", "CustomizedRecoverable+Purgeable",
+ "CustomizedRecoverable", "CustomizedRecoverable+ProtectedSubscription".
+ :vartype recovery_level: str or ~azure.keyvault.v7_1.models.DeletionRecoveryLevel
+ """
+
+ _validation = {
+ 'created': {'readonly': True},
+ 'updated': {'readonly': True},
+ 'recoverable_days': {'readonly': True},
+ 'recovery_level': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'enabled': {'key': 'enabled', 'type': 'bool'},
+ 'not_before': {'key': 'nbf', 'type': 'unix-time'},
+ 'expires': {'key': 'exp', 'type': 'unix-time'},
+ 'created': {'key': 'created', 'type': 'unix-time'},
+ 'updated': {'key': 'updated', 'type': 'unix-time'},
+ 'recoverable_days': {'key': 'recoverableDays', 'type': 'int'},
+ 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ enabled: Optional[bool] = None,
+ not_before: Optional[datetime.datetime] = None,
+ expires: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
+ super(KeyAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs)
+ self.recoverable_days = None
+ self.recovery_level = None
+
+
+class KeyCreateParameters(msrest.serialization.Model):
+ """The key create parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param kty: Required. The type of key to create. For valid values, see JsonWebKeyType. Possible
+ values include: "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
+ :type kty: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
+ :type key_size: int
+ :param key_ops:
+ :type key_ops: list[str or ~azure.keyvault.v7_1.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
+ :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
+ :type curve: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
+ """
+
+ _validation = {
+ 'kty': {'required': True},
+ }
+
+ _attribute_map = {
+ 'kty': {'key': 'kty', 'type': 'str'},
+ 'key_size': {'key': 'key_size', 'type': 'int'},
+ 'key_ops': {'key': 'key_ops', 'type': '[str]'},
+ 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'curve': {'key': 'crv', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ kty: Union[str, "JsonWebKeyType"],
+ key_size: Optional[int] = None,
+ key_ops: Optional[List[Union[str, "JsonWebKeyOperation"]]] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ curve: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
+ **kwargs
+ ):
+ super(KeyCreateParameters, self).__init__(**kwargs)
+ self.kty = kty
+ self.key_size = key_size
+ self.key_ops = key_ops
+ self.key_attributes = key_attributes
+ self.tags = tags
+ self.curve = curve
+
+
+class KeyImportParameters(msrest.serialization.Model):
+ """The key import parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param hsm: Whether to import as a hardware key (HSM) or software key.
+ :type hsm: bool
+ :param key: Required. The Json web key.
+ :type key: ~azure.keyvault.v7_1.models.JsonWebKey
+ :param key_attributes: The key management attributes.
+ :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ """
+
+ _validation = {
+ 'key': {'required': True},
+ }
+
+ _attribute_map = {
+ 'hsm': {'key': 'Hsm', 'type': 'bool'},
+ 'key': {'key': 'key', 'type': 'JsonWebKey'},
+ 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ }
+
+ def __init__(
+ self,
+ *,
+ key: "JsonWebKey",
+ hsm: Optional[bool] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
+ super(KeyImportParameters, self).__init__(**kwargs)
+ self.hsm = hsm
+ self.key = key
+ self.key_attributes = key_attributes
+ self.tags = tags
+
+
+class KeyListResult(msrest.serialization.Model):
+ """The key list result.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: A response message containing a list of keys in the key vault along with a link to
+ the next page of keys.
+ :vartype value: list[~azure.keyvault.v7_1.models.KeyItem]
+ :ivar next_link: The URL to get the next set of keys.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[KeyItem]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyListResult, self).__init__(**kwargs)
+ self.value = None
+ self.next_link = None
+
+
+class KeyOperationResult(msrest.serialization.Model):
+ """The key operation result.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar kid: Key identifier.
+ :vartype kid: str
+ :ivar result:
+ :vartype result: bytes
+ """
+
+ _validation = {
+ 'kid': {'readonly': True},
+ 'result': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'kid': {'key': 'kid', 'type': 'str'},
+ 'result': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyOperationResult, self).__init__(**kwargs)
+ self.kid = None
+ self.result = None
+
+
+class KeyOperationsParameters(msrest.serialization.Model):
+ """The key operations parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param algorithm: Required. algorithm identifier. Possible values include: "RSA-OAEP", "RSA-
+ OAEP-256", "RSA1_5".
+ :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeyEncryptionAlgorithm
+ :param value: Required.
+ :type value: bytes
+ """
+
+ _validation = {
+ 'algorithm': {'required': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ 'algorithm': {'key': 'alg', 'type': 'str'},
+ 'value': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeyEncryptionAlgorithm"],
+ value: bytes,
+ **kwargs
+ ):
+ super(KeyOperationsParameters, self).__init__(**kwargs)
+ self.algorithm = algorithm
+ self.value = value
+
+
+class KeyProperties(msrest.serialization.Model):
+ """Properties of the key pair backing a certificate.
+
+ :param exportable: Indicates if the private key can be exported.
+ :type exportable: bool
+ :param key_type: The type of key pair to be used for the certificate. Possible values include:
+ "EC", "EC-HSM", "RSA", "RSA-HSM", "oct".
+ :type key_type: str or ~azure.keyvault.v7_1.models.JsonWebKeyType
+ :param key_size: The key size in bits. For example: 2048, 3072, or 4096 for RSA.
+ :type key_size: int
+ :param reuse_key: Indicates if the same key pair will be used on certificate renewal.
+ :type reuse_key: bool
+ :param curve: Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values
+ include: "P-256", "P-384", "P-521", "P-256K".
+ :type curve: str or ~azure.keyvault.v7_1.models.JsonWebKeyCurveName
+ """
+
+ _attribute_map = {
+ 'exportable': {'key': 'exportable', 'type': 'bool'},
+ 'key_type': {'key': 'kty', 'type': 'str'},
+ 'key_size': {'key': 'key_size', 'type': 'int'},
+ 'reuse_key': {'key': 'reuse_key', 'type': 'bool'},
+ 'curve': {'key': 'crv', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ exportable: Optional[bool] = None,
+ key_type: Optional[Union[str, "JsonWebKeyType"]] = None,
+ key_size: Optional[int] = None,
+ reuse_key: Optional[bool] = None,
+ curve: Optional[Union[str, "JsonWebKeyCurveName"]] = None,
+ **kwargs
+ ):
+ super(KeyProperties, self).__init__(**kwargs)
+ self.exportable = exportable
+ self.key_type = key_type
+ self.key_size = key_size
+ self.reuse_key = reuse_key
+ self.curve = curve
+
+
+class KeyRestoreParameters(msrest.serialization.Model):
+ """The key restore parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param key_bundle_backup: Required. The backup blob associated with a key bundle.
+ :type key_bundle_backup: bytes
+ """
+
+ _validation = {
+ 'key_bundle_backup': {'required': True},
+ }
+
+ _attribute_map = {
+ 'key_bundle_backup': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ *,
+ key_bundle_backup: bytes,
+ **kwargs
+ ):
+ super(KeyRestoreParameters, self).__init__(**kwargs)
+ self.key_bundle_backup = key_bundle_backup
+
+
+class KeySignParameters(msrest.serialization.Model):
+ """The key operations parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param algorithm: Required. The signing/verification algorithm identifier. For more information
+ on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include:
+ "PS256", "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512",
+ "ES256K".
+ :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeySignatureAlgorithm
+ :param value: Required.
+ :type value: bytes
+ """
+
+ _validation = {
+ 'algorithm': {'required': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ 'algorithm': {'key': 'alg', 'type': 'str'},
+ 'value': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeySignatureAlgorithm"],
+ value: bytes,
+ **kwargs
+ ):
+ super(KeySignParameters, self).__init__(**kwargs)
+ self.algorithm = algorithm
+ self.value = value
+
+
+class KeyUpdateParameters(msrest.serialization.Model):
+ """The key update parameters.
+
+ :param key_ops: Json web key operations. For more information on possible key operations, see
+ JsonWebKeyOperation.
+ :type key_ops: list[str or ~azure.keyvault.v7_1.models.JsonWebKeyOperation]
+ :param key_attributes: The attributes of a key managed by the key vault service.
+ :type key_attributes: ~azure.keyvault.v7_1.models.KeyAttributes
+ :param tags: A set of tags. Application specific metadata in the form of key-value pairs.
+ :type tags: dict[str, str]
+ """
+
+ _attribute_map = {
+ 'key_ops': {'key': 'key_ops', 'type': '[str]'},
+ 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ }
+
+ def __init__(
+ self,
+ *,
+ key_ops: Optional[List[Union[str, "JsonWebKeyOperation"]]] = None,
+ key_attributes: Optional["KeyAttributes"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
+ super(KeyUpdateParameters, self).__init__(**kwargs)
+ self.key_ops = key_ops
+ self.key_attributes = key_attributes
+ self.tags = tags
+
+
+class KeyVaultError(msrest.serialization.Model):
+ """The key vault error exception.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar error: The key vault server error.
+ :vartype error: ~azure.keyvault.v7_1.models.Error
+ """
+
+ _validation = {
+ 'error': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'error': {'key': 'error', 'type': 'Error'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyVaultError, self).__init__(**kwargs)
+ self.error = None
+
+
+class KeyVerifyParameters(msrest.serialization.Model):
+ """The key verify parameters.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param algorithm: Required. The signing/verification algorithm. For more information on
+ possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: "PS256",
+ "PS384", "PS512", "RS256", "RS384", "RS512", "RSNULL", "ES256", "ES384", "ES512", "ES256K".
+ :type algorithm: str or ~azure.keyvault.v7_1.models.JsonWebKeySignatureAlgorithm
+ :param digest: Required. The digest used for signing.
+ :type digest: bytes
+ :param signature: Required. The signature to be verified.
+ :type signature: bytes
+ """
+
+ _validation = {
+ 'algorithm': {'required': True},
+ 'digest': {'required': True},
+ 'signature': {'required': True},
+ }
+
+ _attribute_map = {
+ 'algorithm': {'key': 'alg', 'type': 'str'},
+ 'digest': {'key': 'digest', 'type': 'base64'},
+ 'signature': {'key': 'value', 'type': 'base64'},
+ }
+
+ def __init__(
+ self,
+ *,
+ algorithm: Union[str, "JsonWebKeySignatureAlgorithm"],
+ digest: bytes,
+ signature: bytes,
+ **kwargs
+ ):
+ super(KeyVerifyParameters, self).__init__(**kwargs)
+ self.algorithm = algorithm
+ self.digest = digest
+ self.signature = signature
+
+
+class KeyVerifyResult(msrest.serialization.Model):
+ """The key verify result.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: True if the signature is verified, otherwise false.
+ :vartype value: bool
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': 'bool'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(KeyVerifyResult, self).__init__(**kwargs)
+ self.value = None
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/operations/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/operations/__init__.py
similarity index 90%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/operations/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/operations/__init__.py
index 603e37d3ee07..44bfc9d07bb1 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_1_preview/operations/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/operations/__init__.py
@@ -1,12 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
+# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._key_vault_client_operations import KeyVaultClientOperationsMixin
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/operations/_key_vault_client_operations.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/operations/_key_vault_client_operations.py
new file mode 100644
index 000000000000..09ca13c5f586
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/operations/_key_vault_client_operations.py
@@ -0,0 +1,1384 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class KeyVaultClientOperationsMixin(object):
+
+ def create_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ parameters, # type: "models.KeyCreateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Creates a new key, stores it, then returns key parameters and attributes to the client.
+
+ The create key operation can be used to create any key type in Azure Key Vault. If the named
+ key already exists, Azure Key Vault creates a new version of the key. It requires the
+ keys/create permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name for the new key. The system will generate the version name for the
+ new key.
+ :type key_name: str
+ :param parameters: The parameters to create a key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyCreateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.create_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyCreateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_key.metadata = {'url': '/keys/{key-name}/create'} # type: ignore
+
+ def import_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ parameters, # type: "models.KeyImportParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Imports an externally created key, stores it, and returns key parameters and attributes to the client.
+
+ The import key operation may be used to import any key type into an Azure Key Vault. If the
+ named key already exists, Azure Key Vault creates a new version of the key. This operation
+ requires the keys/import permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: Name for the imported key.
+ :type key_name: str
+ :param parameters: The parameters to import a key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyImportParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.import_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyImportParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ import_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ def delete_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedKeyBundle"
+ """Deletes a key of any type from storage in Azure Key Vault.
+
+ The delete key operation cannot be used to remove individual versions of a key. This operation
+ removes the cryptographic material associated with the key, which means the key is not usable
+ for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
+ keys/delete permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to delete.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.delete_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ delete_key.metadata = {'url': '/keys/{key-name}'} # type: ignore
+
+ def update_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyUpdateParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
+
+ In order to perform this operation, the key must already exist in the Key Vault. Note: The
+ cryptographic material of a key itself cannot be changed. This operation requires the
+ keys/update permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of key to update.
+ :type key_name: str
+ :param key_version: The version of the key to update.
+ :type key_version: str
+ :param parameters: The parameters of the key to update.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyUpdateParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.update_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Gets the public part of a stored key.
+
+ The get key operation is applicable to all key types. If the requested key is symmetric, then
+ no key material is released in the response. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key to get.
+ :type key_name: str
+ :param key_version: Adding the version parameter retrieves a specific version of a key. This
+ URI fragment is optional. If not specified, the latest version of the key is returned.
+ :type key_version: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.get_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_key.metadata = {'url': '/keys/{key-name}/{key-version}'} # type: ignore
+
+ def get_key_versions(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.KeyListResult"]
+ """Retrieves a list of individual key versions with the same key name.
+
+ The full key identifier, attributes, and tags are provided in the response. This operation
+ requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_key_versions.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_key_versions.metadata = {'url': '/keys/{key-name}/versions'} # type: ignore
+
+ def get_keys(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.KeyListResult"]
+ """List keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a stored key. The LIST operation is applicable to all key types, however only
+ the base key identifier, attributes, and tags are provided in the response. Individual versions
+ of a key are not listed in the response. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either KeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.KeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('KeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_keys.metadata = {'url': '/keys'} # type: ignore
+
+ def backup_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.BackupKeyResult"
+ """Requests that a backup of the specified key be downloaded to the client.
+
+ The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this
+ operation does NOT return key material in a form that can be used outside the Azure Key Vault
+ system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key
+ Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
+ Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance.
+ The BACKUP operation may be used to export, in protected form, any key type from Azure Key
+ Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed
+ within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be
+ restored to another geographical area. For example, a backup from the US geographical area
+ cannot be restored in an EU geographical area. This operation requires the key/backup
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: BackupKeyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.BackupKeyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.BackupKeyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.backup_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('BackupKeyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ backup_key.metadata = {'url': '/keys/{key-name}/backup'} # type: ignore
+
+ def restore_key(
+ self,
+ vault_base_url, # type: str
+ parameters, # type: "models.KeyRestoreParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Restores a backed up key to a vault.
+
+ Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
+ attributes and access control policies. The RESTORE operation may be used to import a
+ previously backed up key. Individual versions of a key cannot be restored. The key is restored
+ in its entirety with the same key name as it had when it was backed up. If the key name is not
+ available in the target Key Vault, the RESTORE operation will be rejected. While the key name
+ is retained during restore, the final key identifier will change if the key is restored to a
+ different vault. Restore will restore all versions and preserve version identifiers. The
+ RESTORE operation is subject to security constraints: The target Key Vault must be owned by the
+ same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission
+ in the target Key Vault. This operation requires the keys/restore permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param parameters: The parameters to restore the key.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyRestoreParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.restore_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ restore_key.metadata = {'url': '/keys/restore'} # type: ignore
+
+ def encrypt(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
+
+ The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
+ stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of
+ data, the size of which is dependent on the target key and the encryption algorithm to be used.
+ The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
+ since protection with an asymmetric key can be performed using public portion of the key. This
+ operation is supported for asymmetric keys as a convenience for callers that have a key-
+ reference but do not have access to the public key material. This operation requires the
+ keys/encrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the encryption operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.encrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'} # type: ignore
+
+ def decrypt(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Decrypts a single block of encrypted data.
+
+ The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption
+ key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a
+ single block of data may be decrypted, the size of this block is dependent on the target key
+ and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys
+ stored in Azure Key Vault since it uses the private portion of the key. This operation requires
+ the keys/decrypt permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the decryption operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.decrypt.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'} # type: ignore
+
+ def sign(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeySignParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Creates a signature from a digest using the specified key.
+
+ The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault
+ since this operation uses the private portion of the key. This operation requires the keys/sign
+ permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the signing operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeySignParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.sign.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeySignParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'} # type: ignore
+
+ def verify(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyVerifyParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyVerifyResult"
+ """Verifies a signature using a specified key.
+
+ The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not
+ strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification
+ can be performed using the public portion of the key but this operation is supported as a
+ convenience for callers that only have a key-reference and not the public portion of the key.
+ This operation requires the keys/verify permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for verify operations.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyVerifyParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyVerifyResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyVerifyResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyVerifyResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.verify.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyVerifyResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'} # type: ignore
+
+ def wrap_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Wraps a symmetric key using a specified key.
+
+ The WRAP operation supports encryption of a symmetric key using a key encryption key that has
+ previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for
+ symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be
+ performed using the public portion of the key. This operation is supported for asymmetric keys
+ as a convenience for callers that have a key-reference but do not have access to the public key
+ material. This operation requires the keys/wrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for wrap operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.wrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'} # type: ignore
+
+ def unwrap_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ key_version, # type: str
+ parameters, # type: "models.KeyOperationsParameters"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyOperationResult"
+ """Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
+
+ The UNWRAP operation supports decryption of a symmetric key using the target key encryption
+ key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to
+ asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of
+ the key. This operation requires the keys/unwrapKey permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :param key_version: The version of the key.
+ :type key_version: str
+ :param parameters: The parameters for the key operation.
+ :type parameters: ~azure.keyvault.v7_1.models.KeyOperationsParameters
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyOperationResult, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyOperationResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyOperationResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+ content_type = kwargs.pop("content_type", "application/json")
+
+ # Construct URL
+ url = self.unwrap_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ 'key-version': self._serialize.url("key_version", key_version, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = 'application/json'
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyOperationResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'} # type: ignore
+
+ def get_deleted_keys(
+ self,
+ vault_base_url, # type: str
+ maxresults=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DeletedKeyListResult"]
+ """Lists the deleted keys in the specified vault.
+
+ Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the
+ public part of a deleted key. This operation includes deletion-specific information. The Get
+ Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/list permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param maxresults: Maximum number of results to return in a page. If not specified the service
+ will return up to 25 results.
+ :type maxresults: int
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DeletedKeyListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.v7_1.models.DeletedKeyListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyListResult"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ if not next_link:
+ # Construct URL
+ url = self.get_deleted_keys.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ if maxresults is not None:
+ query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DeletedKeyListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.KeyVaultError, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_deleted_keys.metadata = {'url': '/deletedkeys'} # type: ignore
+
+ def get_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.DeletedKeyBundle"
+ """Gets the public part of a deleted key.
+
+ The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
+ can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled
+ vault. This operation requires the keys/get permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: DeletedKeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.DeletedKeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DeletedKeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.get_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('DeletedKeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ def purge_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Permanently deletes the specified key.
+
+ The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the
+ operation can be invoked on any vault, it will return an error if invoked on a non soft-delete
+ enabled vault. This operation requires the keys/purge permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.purge_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} # type: ignore
+
+ def recover_deleted_key(
+ self,
+ vault_base_url, # type: str
+ key_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.KeyBundle"
+ """Recovers the deleted key to its latest version.
+
+ The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults.
+ It recovers the deleted key back to its latest version under /keys. An attempt to recover an
+ non-deleted key will return an error. Consider this the inverse of the delete operation on
+ soft-delete enabled vaults. This operation requires the keys/recover permission.
+
+ :param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
+ :type vault_base_url: str
+ :param key_name: The name of the deleted key.
+ :type key_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: KeyBundle, or the result of cls(response)
+ :rtype: ~azure.keyvault.v7_1.models.KeyBundle
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.KeyBundle"]
+ error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "7.1"
+
+ # Construct URL
+ url = self.recover_deleted_key.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
+ 'key-name': self._serialize.url("key_name", key_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = 'application/json'
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.KeyVaultError, response)
+ raise HttpResponseError(response=response, model=error)
+
+ deserialized = self._deserialize('KeyBundle', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'} # type: ignore
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/py.typed b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/py.typed
new file mode 100644
index 000000000000..e5aff4f83af8
--- /dev/null
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v7_1/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py
index 03b8015ee428..5b5319f8b9e2 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py
@@ -4,7 +4,7 @@
# -------------------------------------
from collections import namedtuple
from ._shared import parse_vault_id
-from ._shared._generated.v7_0.models import JsonWebKey as _JsonWebKey
+from ._generated.v7_1.models import JsonWebKey as _JsonWebKey
try:
from typing import TYPE_CHECKING
@@ -15,7 +15,7 @@
# pylint:disable=unused-import
from typing import Any, Dict, Optional
from datetime import datetime
- from ._shared._generated.v7_0 import models as _models
+ from ._generated.v7_0 import models as _models
from ._enums import KeyOperation
KeyOperationResult = namedtuple("KeyOperationResult", ["id", "value"])
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_sdk_moniker.py
similarity index 65%
rename from sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/__init__.py
rename to sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_sdk_moniker.py
index b74cfa3b899c..5f8c8b9d9b5b 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_sdk_moniker.py
@@ -2,3 +2,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
+from ._version import VERSION
+
+SDK_MONIKER = "keyvault-keys/{}".format(VERSION)
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/__init__.py
index a8fd2a41d71f..e13f15a61c71 100644
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/__init__.py
+++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/__init__.py
@@ -15,6 +15,7 @@
from .http_challenge import HttpChallenge
from . import http_challenge_cache as HttpChallengeCache
+
__all__ = [
"ChallengeAuthPolicy",
"ChallengeAuthPolicyBase",
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/operations_async/_key_vault_client_operations_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/operations_async/_key_vault_client_operations_async.py
deleted file mode 100644
index 2e34320ea0fe..000000000000
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/aio/operations_async/_key_vault_client_operations_async.py
+++ /dev/null
@@ -1,4475 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-from azure.core.exceptions import map_error
-from azure.core.async_paging import AsyncItemPaged, AsyncList
-from ... import models
-import uuid
-
-
-class KeyVaultClientOperationsMixin:
-
- async def create_key(self, vault_base_url, key_name, kty, key_size=None, key_ops=None, key_attributes=None, tags=None, curve=None, *, cls=None, **kwargs):
- """Creates a new key, stores it, then returns key parameters and
- attributes to the client.
-
- The create key operation can be used to create any key type in Azure
- Key Vault. If the named key already exists, Azure Key Vault creates a
- new version of the key. It requires the keys/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name for the new key. The system will generate
- the version name for the new key.
- :type key_name: str
- :param kty: The type of key to create. For valid values, see
- JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA',
- 'RSA-HSM', 'oct'
- :type kty: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or
- 4096 for RSA.
- :type key_size: int
- :param key_ops:
- :type key_ops: list[str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
- :param key_attributes:
- :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384',
- 'P-521', 'SECP256K1'
- :type curve: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyCurveName
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyCreateParameters(kty=kty, key_size=key_size, key_ops=key_ops, key_attributes=key_attributes, tags=tags, curve=curve)
-
- # Construct URL
- url = self.create_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyCreateParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- create_key.metadata = {'url': '/keys/{key-name}/create'}
-
- async def import_key(self, vault_base_url, key_name, key, hsm=None, key_attributes=None, tags=None, *, cls=None, **kwargs):
- """Imports an externally created key, stores it, and returns key
- parameters and attributes to the client.
-
- The import key operation may be used to import any key type into an
- Azure Key Vault. If the named key already exists, Azure Key Vault
- creates a new version of the key. This operation requires the
- keys/import permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: Name for the imported key.
- :type key_name: str
- :param key: The Json web key
- :type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
- :param hsm: Whether to import as a hardware key (HSM) or software key.
- :type hsm: bool
- :param key_attributes: The key management attributes.
- :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyImportParameters(hsm=hsm, key=key, key_attributes=key_attributes, tags=tags)
-
- # Construct URL
- url = self.import_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyImportParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- import_key.metadata = {'url': '/keys/{key-name}'}
-
- async def delete_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Deletes a key of any type from storage in Azure Key Vault.
-
- The delete key operation cannot be used to remove individual versions
- of a key. This operation removes the cryptographic material associated
- with the key, which means the key is not usable for Sign/Verify,
- Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
- keys/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key to delete.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedKeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedKeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_key.metadata = {'url': '/keys/{key-name}'}
-
- async def update_key(self, vault_base_url, key_name, key_version, key_ops=None, key_attributes=None, tags=None, *, cls=None, **kwargs):
- """The update key operation changes specified attributes of a stored key
- and can be applied to any key type and key version stored in Azure Key
- Vault.
-
- In order to perform this operation, the key must already exist in the
- Key Vault. Note: The cryptographic material of a key itself cannot be
- changed. This operation requires the keys/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of key to update.
- :type key_name: str
- :param key_version: The version of the key to update.
- :type key_version: str
- :param key_ops: Json web key operations. For more information on
- possible key operations, see JsonWebKeyOperation.
- :type key_ops: list[str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
- :param key_attributes:
- :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyUpdateParameters(key_ops=key_ops, key_attributes=key_attributes, tags=tags)
-
- # Construct URL
- url = self.update_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_key.metadata = {'url': '/keys/{key-name}/{key-version}'}
-
- async def get_key(self, vault_base_url, key_name, key_version, *, cls=None, **kwargs):
- """Gets the public part of a stored key.
-
- The get key operation is applicable to all key types. If the requested
- key is symmetric, then no key material is released in the response.
- This operation requires the keys/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key to get.
- :type key_name: str
- :param key_version: Adding the version parameter retrieves a specific
- version of a key.
- :type key_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_key.metadata = {'url': '/keys/{key-name}/{key-version}'}
-
- def get_key_versions(
- self, vault_base_url, key_name, maxresults=None, *, cls=None, **kwargs):
- """Retrieves a list of individual key versions with the same key name.
-
- The full key identifier, attributes, and tags are provided in the
- response. This operation requires the keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of KeyItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.KeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_key_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('KeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_key_versions.metadata = {'url': '/keys/{key-name}/versions'}
-
- def get_keys(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List keys in the specified vault.
-
- Retrieves a list of the keys in the Key Vault as JSON Web Key
- structures that contain the public part of a stored key. The LIST
- operation is applicable to all key types, however only the base key
- identifier, attributes, and tags are provided in the response.
- Individual versions of a key are not listed in the response. This
- operation requires the keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of KeyItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.KeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_keys.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('KeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_keys.metadata = {'url': '/keys'}
-
- async def backup_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Requests that a backup of the specified key be downloaded to the
- client.
-
- The Key Backup operation exports a key from Azure Key Vault in a
- protected form. Note that this operation does NOT return key material
- in a form that can be used outside the Azure Key Vault system, the
- returned key material is either protected to a Azure Key Vault HSM or
- to Azure Key Vault itself. The intent of this operation is to allow a
- client to GENERATE a key in one Azure Key Vault instance, BACKUP the
- key, and then RESTORE it into another Azure Key Vault instance. The
- BACKUP operation may be used to export, in protected form, any key type
- from Azure Key Vault. Individual versions of a key cannot be backed up.
- BACKUP / RESTORE can be performed within geographical boundaries only;
- meaning that a BACKUP from one geographical area cannot be restored to
- another geographical area. For example, a backup from the US
- geographical area cannot be restored in an EU geographical area. This
- operation requires the key/backup permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: BackupKeyResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.BackupKeyResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.backup_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('BackupKeyResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- backup_key.metadata = {'url': '/keys/{key-name}/backup'}
-
- async def restore_key(self, vault_base_url, key_bundle_backup, *, cls=None, **kwargs):
- """Restores a backed up key to a vault.
-
- Imports a previously backed up key into Azure Key Vault, restoring the
- key, its key identifier, attributes and access control policies. The
- RESTORE operation may be used to import a previously backed up key.
- Individual versions of a key cannot be restored. The key is restored in
- its entirety with the same key name as it had when it was backed up. If
- the key name is not available in the target Key Vault, the RESTORE
- operation will be rejected. While the key name is retained during
- restore, the final key identifier will change if the key is restored to
- a different vault. Restore will restore all versions and preserve
- version identifiers. The RESTORE operation is subject to security
- constraints: The target Key Vault must be owned by the same Microsoft
- Azure Subscription as the source Key Vault The user must have RESTORE
- permission in the target Key Vault. This operation requires the
- keys/restore permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_bundle_backup: The backup blob associated with a key
- bundle.
- :type key_bundle_backup: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyRestoreParameters(key_bundle_backup=key_bundle_backup)
-
- # Construct URL
- url = self.restore_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- restore_key.metadata = {'url': '/keys/restore'}
-
- async def encrypt(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Encrypts an arbitrary sequence of bytes using an encryption key that is
- stored in a key vault.
-
- The ENCRYPT operation encrypts an arbitrary sequence of bytes using an
- encryption key that is stored in Azure Key Vault. Note that the ENCRYPT
- operation only supports a single block of data, the size of which is
- dependent on the target key and the encryption algorithm to be used.
- The ENCRYPT operation is only strictly necessary for symmetric keys
- stored in Azure Key Vault since protection with an asymmetric key can
- be performed using public portion of the key. This operation is
- supported for asymmetric keys as a convenience for callers that have a
- key-reference but do not have access to the public key material. This
- operation requires the keys/encrypt permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.encrypt.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'}
-
- async def decrypt(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Decrypts a single block of encrypted data.
-
- The DECRYPT operation decrypts a well-formed block of ciphertext using
- the target encryption key and specified algorithm. This operation is
- the reverse of the ENCRYPT operation; only a single block of data may
- be decrypted, the size of this block is dependent on the target key and
- the algorithm to be used. The DECRYPT operation applies to asymmetric
- and symmetric keys stored in Azure Key Vault since it uses the private
- portion of the key. This operation requires the keys/decrypt
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.decrypt.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'}
-
- async def sign(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Creates a signature from a digest using the specified key.
-
- The SIGN operation is applicable to asymmetric and symmetric keys
- stored in Azure Key Vault since this operation uses the private portion
- of the key. This operation requires the keys/sign permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: The signing/verification algorithm identifier. For
- more information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256',
- 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256',
- 'ES384', 'ES512', 'ECDSA256'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeySignParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.sign.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeySignParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'}
-
- async def verify(self, vault_base_url, key_name, key_version, algorithm, digest, signature, *, cls=None, **kwargs):
- """Verifies a signature using a specified key.
-
- The VERIFY operation is applicable to symmetric keys stored in Azure
- Key Vault. VERIFY is not strictly necessary for asymmetric keys stored
- in Azure Key Vault since signature verification can be performed using
- the public portion of the key but this operation is supported as a
- convenience for callers that only have a key-reference and not the
- public portion of the key. This operation requires the keys/verify
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: The signing/verification algorithm. For more
- information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256',
- 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256',
- 'ES384', 'ES512', 'ECDSA256'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
- :param digest: The digest used for signing.
- :type digest: bytes
- :param signature: The signature to be verified.
- :type signature: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyVerifyResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyVerifyResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyVerifyParameters(algorithm=algorithm, digest=digest, signature=signature)
-
- # Construct URL
- url = self.verify.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyVerifyResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'}
-
- async def wrap_key(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Wraps a symmetric key using a specified key.
-
- The WRAP operation supports encryption of a symmetric key using a key
- encryption key that has previously been stored in an Azure Key Vault.
- The WRAP operation is only strictly necessary for symmetric keys stored
- in Azure Key Vault since protection with an asymmetric key can be
- performed using the public portion of the key. This operation is
- supported for asymmetric keys as a convenience for callers that have a
- key-reference but do not have access to the public key material. This
- operation requires the keys/wrapKey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.wrap_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'}
-
- async def unwrap_key(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Unwraps a symmetric key using the specified key that was initially used
- for wrapping that key.
-
- The UNWRAP operation supports decryption of a symmetric key using the
- target key encryption key. This operation is the reverse of the WRAP
- operation. The UNWRAP operation applies to asymmetric and symmetric
- keys stored in Azure Key Vault since it uses the private portion of the
- key. This operation requires the keys/unwrapKey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.unwrap_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'}
-
- def get_deleted_keys(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """Lists the deleted keys in the specified vault.
-
- Retrieves a list of the keys in the Key Vault as JSON Web Key
- structures that contain the public part of a deleted key. This
- operation includes deletion-specific information. The Get Deleted Keys
- operation is applicable for vaults enabled for soft-delete. While the
- operation can be invoked on any vault, it will return an error if
- invoked on a non soft-delete enabled vault. This operation requires the
- keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedKeyItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedKeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_keys.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('DeletedKeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_deleted_keys.metadata = {'url': '/deletedkeys'}
-
- async def get_deleted_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Gets the public part of a deleted key.
-
- The Get Deleted Key operation is applicable for soft-delete enabled
- vaults. While the operation can be invoked on any vault, it will return
- an error if invoked on a non soft-delete enabled vault. This operation
- requires the keys/get permission. .
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedKeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedKeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'}
-
- async def purge_deleted_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Permanently deletes the specified key.
-
- The Purge Deleted Key operation is applicable for soft-delete enabled
- vaults. While the operation can be invoked on any vault, it will return
- an error if invoked on a non soft-delete enabled vault. This operation
- requires the keys/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'}
-
- async def recover_deleted_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Recovers the deleted key to its latest version.
-
- The Recover Deleted Key operation is applicable for deleted keys in
- soft-delete enabled vaults. It recovers the deleted key back to its
- latest version under /keys. An attempt to recover an non-deleted key
- will return an error. Consider this the inverse of the delete operation
- on soft-delete enabled vaults. This operation requires the keys/recover
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the deleted key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'}
-
- async def set_secret(self, vault_base_url, secret_name, value, tags=None, content_type=None, secret_attributes=None, *, cls=None, **kwargs):
- """Sets a secret in a specified key vault.
-
- The SET operation adds a secret to the Azure Key Vault. If the named
- secret already exists, Azure Key Vault creates a new version of that
- secret. This operation requires the secrets/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param value: The value of the secret.
- :type value: str
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param content_type: Type of the secret value such as a password.
- :type content_type: str
- :param secret_attributes: The secret management attributes.
- :type secret_attributes:
- ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretSetParameters(value=value, tags=tags, content_type=content_type, secret_attributes=secret_attributes)
-
- # Construct URL
- url = self.set_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretSetParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_secret.metadata = {'url': '/secrets/{secret-name}'}
-
- async def delete_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Deletes a secret from a specified key vault.
-
- The DELETE operation applies to any secret stored in Azure Key Vault.
- DELETE cannot be applied to an individual version of a secret. This
- operation requires the secrets/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedSecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedSecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_secret.metadata = {'url': '/secrets/{secret-name}'}
-
- async def update_secret(self, vault_base_url, secret_name, secret_version, content_type=None, secret_attributes=None, tags=None, *, cls=None, **kwargs):
- """Updates the attributes associated with a specified secret in a given
- key vault.
-
- The UPDATE operation changes specified attributes of an existing stored
- secret. Attributes that are not specified in the request are left
- unchanged. The value of a secret itself cannot be changed. This
- operation requires the secrets/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param secret_version: The version of the secret.
- :type secret_version: str
- :param content_type: Type of the secret value such as a password.
- :type content_type: str
- :param secret_attributes: The secret management attributes.
- :type secret_attributes:
- ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretUpdateParameters(content_type=content_type, secret_attributes=secret_attributes, tags=tags)
-
- # Construct URL
- url = self.update_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
- 'secret-version': self._serialize.url("secret_version", secret_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'}
-
- async def get_secret(self, vault_base_url, secret_name, secret_version, *, cls=None, **kwargs):
- """Get a specified secret from a given key vault.
-
- The GET operation is applicable to any secret stored in Azure Key
- Vault. This operation requires the secrets/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param secret_version: The version of the secret.
- :type secret_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
- 'secret-version': self._serialize.url("secret_version", secret_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'}
-
- def get_secrets(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List secrets in a specified key vault.
-
- The Get Secrets operation is applicable to the entire vault. However,
- only the base secret identifier and its attributes are provided in the
- response. Individual secret versions are not listed in the response.
- This operation requires the secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified, the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SecretItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_secrets.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('SecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_secrets.metadata = {'url': '/secrets'}
-
- def get_secret_versions(
- self, vault_base_url, secret_name, maxresults=None, *, cls=None, **kwargs):
- """List all versions of the specified secret.
-
- The full secret identifier and attributes are provided in the response.
- No values are returned for the secrets. This operations requires the
- secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified, the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SecretItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_secret_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('SecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_secret_versions.metadata = {'url': '/secrets/{secret-name}/versions'}
-
- def get_deleted_secrets(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """Lists deleted secrets for the specified vault.
-
- The Get Deleted Secrets operation returns the secrets that have been
- deleted for a vault enabled for soft-delete. This operation requires
- the secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedSecretItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedSecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_secrets.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('DeletedSecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_deleted_secrets.metadata = {'url': '/deletedsecrets'}
-
- async def get_deleted_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Gets the specified deleted secret.
-
- The Get Deleted Secret operation returns the specified deleted secret
- along with its attributes. This operation requires the secrets/get
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedSecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedSecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'}
-
- async def purge_deleted_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Permanently deletes the specified secret.
-
- The purge deleted secret operation removes the secret permanently,
- without the possibility of recovery. This operation can only be enabled
- on a soft-delete enabled vault. This operation requires the
- secrets/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'}
-
- async def recover_deleted_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Recovers the deleted secret to the latest version.
-
- Recovers the deleted secret in the specified vault. This operation can
- only be performed on a soft-delete enabled vault. This operation
- requires the secrets/recover permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the deleted secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}/recover'}
-
- async def backup_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Backs up the specified secret.
-
- Requests that a backup of the specified secret be downloaded to the
- client. All versions of the secret will be downloaded. This operation
- requires the secrets/backup permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: BackupSecretResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.BackupSecretResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.backup_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('BackupSecretResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- backup_secret.metadata = {'url': '/secrets/{secret-name}/backup'}
-
- async def restore_secret(self, vault_base_url, secret_bundle_backup, *, cls=None, **kwargs):
- """Restores a backed up secret to a vault.
-
- Restores a backed up secret, and all its versions, to a vault. This
- operation requires the secrets/restore permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_bundle_backup: The backup blob associated with a secret
- bundle.
- :type secret_bundle_backup: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretRestoreParameters(secret_bundle_backup=secret_bundle_backup)
-
- # Construct URL
- url = self.restore_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretRestoreParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- restore_secret.metadata = {'url': '/secrets/restore'}
-
- def get_certificates(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List certificates in a specified key vault.
-
- The GetCertificates operation returns the set of certificates resources
- in the specified key vault. This operation requires the
- certificates/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of CertificateItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificates.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('CertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_certificates.metadata = {'url': '/certificates'}
-
- async def delete_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Deletes a certificate from a specified key vault.
-
- Deletes all versions of a certificate object along with its associated
- policy. Delete certificate cannot be used to remove individual versions
- of a certificate object. This operation requires the
- certificates/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedCertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedCertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate.metadata = {'url': '/certificates/{certificate-name}'}
-
- async def set_certificate_contacts(self, vault_base_url, contact_list=None, *, cls=None, **kwargs):
- """Sets the certificate contacts for the specified key vault.
-
- Sets the certificate contacts for the specified key vault. This
- operation requires the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param contact_list: The contact list for the vault certificates.
- :type contact_list: list[~azure.keyvault.v2016_10_01.models.Contact]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- contacts = models.Contacts(contact_list=contact_list)
-
- # Construct URL
- url = self.set_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(contacts, 'Contacts')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- async def get_certificate_contacts(self, vault_base_url, *, cls=None, **kwargs):
- """Lists the certificate contacts for a specified key vault.
-
- The GetCertificateContacts operation returns the set of certificate
- contact resources in the specified key vault. This operation requires
- the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- async def delete_certificate_contacts(self, vault_base_url, *, cls=None, **kwargs):
- """Deletes the certificate contacts for a specified key vault.
-
- Deletes the certificate contacts for a specified key vault certificate.
- This operation requires the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- def get_certificate_issuers(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List certificate issuers for a specified key vault.
-
- The GetCertificateIssuers operation returns the set of certificate
- issuer resources in the specified key vault. This operation requires
- the certificates/manageissuers/getissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of CertificateIssuerItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateIssuerItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificate_issuers.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('CertificateIssuerListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_certificate_issuers.metadata = {'url': '/certificates/issuers'}
-
- async def set_certificate_issuer(self, vault_base_url, issuer_name, provider, credentials=None, organization_details=None, attributes=None, *, cls=None, **kwargs):
- """Sets the specified certificate issuer.
-
- The SetCertificateIssuer operation adds or updates the specified
- certificate issuer. This operation requires the certificates/setissuers
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param provider: The issuer provider.
- :type provider: str
- :param credentials: The credentials to be used for the issuer.
- :type credentials:
- ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided
- to the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
- :param attributes: Attributes of the issuer object.
- :type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameter = models.CertificateIssuerSetParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes)
-
- # Construct URL
- url = self.set_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameter, 'CertificateIssuerSetParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- async def update_certificate_issuer(self, vault_base_url, issuer_name, provider=None, credentials=None, organization_details=None, attributes=None, *, cls=None, **kwargs):
- """Updates the specified certificate issuer.
-
- The UpdateCertificateIssuer operation performs an update on the
- specified certificate issuer entity. This operation requires the
- certificates/setissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param provider: The issuer provider.
- :type provider: str
- :param credentials: The credentials to be used for the issuer.
- :type credentials:
- ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided
- to the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
- :param attributes: Attributes of the issuer object.
- :type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameter = models.CertificateIssuerUpdateParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes)
-
- # Construct URL
- url = self.update_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameter, 'CertificateIssuerUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- async def get_certificate_issuer(self, vault_base_url, issuer_name, *, cls=None, **kwargs):
- """Lists the specified certificate issuer.
-
- The GetCertificateIssuer operation returns the specified certificate
- issuer resources in the specified key vault. This operation requires
- the certificates/manageissuers/getissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- async def delete_certificate_issuer(self, vault_base_url, issuer_name, *, cls=None, **kwargs):
- """Deletes the specified certificate issuer.
-
- The DeleteCertificateIssuer operation permanently removes the specified
- certificate issuer from the vault. This operation requires the
- certificates/manageissuers/deleteissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- async def create_certificate(self, vault_base_url, certificate_name, certificate_policy=None, certificate_attributes=None, tags=None, *, cls=None, **kwargs):
- """Creates a new certificate.
-
- If this is the first version, the certificate resource is created. This
- operation requires the certificates/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateCreateParameters(certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.create_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateCreateParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [202]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 202:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- create_certificate.metadata = {'url': '/certificates/{certificate-name}/create'}
-
- async def import_certificate(self, vault_base_url, certificate_name, base64_encoded_certificate, password=None, certificate_policy=None, certificate_attributes=None, tags=None, *, cls=None, **kwargs):
- """Imports a certificate into a specified key vault.
-
- Imports an existing valid certificate, containing a private key, into
- Azure Key Vault. The certificate to be imported can be in either PFX or
- PEM format. If the certificate is in PEM format the PEM file must
- contain the key as well as x509 certificates. This operation requires
- the certificates/import permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param base64_encoded_certificate: Base64 encoded representation of
- the certificate object to import. This certificate needs to contain
- the private key.
- :type base64_encoded_certificate: str
- :param password: If the private key in base64EncodedCertificate is
- encrypted, the password used for encryption.
- :type password: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateImportParameters(base64_encoded_certificate=base64_encoded_certificate, password=password, certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.import_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateImportParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- import_certificate.metadata = {'url': '/certificates/{certificate-name}/import'}
-
- def get_certificate_versions(
- self, vault_base_url, certificate_name, maxresults=None, *, cls=None, **kwargs):
- """List the versions of a certificate.
-
- The GetCertificateVersions operation returns the versions of a
- certificate in the specified key vault. This operation requires the
- certificates/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of CertificateItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.CertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificate_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('CertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_certificate_versions.metadata = {'url': '/certificates/{certificate-name}/versions'}
-
- async def get_certificate_policy(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Lists the policy for a certificate.
-
- The GetCertificatePolicy operation returns the specified certificate
- policy resources in the specified key vault. This operation requires
- the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in a given key
- vault.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificatePolicy or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_policy.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificatePolicy', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'}
-
- async def update_certificate_policy(self, vault_base_url, certificate_name, certificate_policy, *, cls=None, **kwargs):
- """Updates the policy for a certificate.
-
- Set specified members in the certificate policy. Leave others as null.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given
- vault.
- :type certificate_name: str
- :param certificate_policy: The policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificatePolicy or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.update_certificate_policy.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(certificate_policy, 'CertificatePolicy')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificatePolicy', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'}
-
- async def update_certificate(self, vault_base_url, certificate_name, certificate_version, certificate_policy=None, certificate_attributes=None, tags=None, *, cls=None, **kwargs):
- """Updates the specified attributes associated with the given certificate.
-
- The UpdateCertificate operation applies the specified update on the
- given certificate; the only elements updated are the certificate's
- attributes. This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given key
- vault.
- :type certificate_name: str
- :param certificate_version: The version of the certificate.
- :type certificate_version: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateUpdateParameters(certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.update_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
- 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'}
-
- async def get_certificate(self, vault_base_url, certificate_name, certificate_version, *, cls=None, **kwargs):
- """Gets information about a certificate.
-
- Gets information about a specific certificate. This operation requires
- the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given
- vault.
- :type certificate_name: str
- :param certificate_version: The version of the certificate.
- :type certificate_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
- 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'}
-
- async def update_certificate_operation(self, vault_base_url, certificate_name, cancellation_requested, *, cls=None, **kwargs):
- """Updates a certificate operation.
-
- Updates a certificate creation operation that is already in progress.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param cancellation_requested: Indicates if cancellation was requested
- on the certificate operation.
- :type cancellation_requested: bool
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- certificate_operation = models.CertificateOperationUpdateParameter(cancellation_requested=cancellation_requested)
-
- # Construct URL
- url = self.update_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(certificate_operation, 'CertificateOperationUpdateParameter')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- async def get_certificate_operation(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Gets the creation operation of a certificate.
-
- Gets the creation operation associated with a specified certificate.
- This operation requires the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- async def delete_certificate_operation(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Deletes the creation operation for a specific certificate.
-
- Deletes the creation operation for a specified certificate that is in
- the process of being created. The certificate is no longer created.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- async def merge_certificate(self, vault_base_url, certificate_name, x509_certificates, certificate_attributes=None, tags=None, *, cls=None, **kwargs):
- """Merges a certificate or a certificate chain with a key pair existing on
- the server.
-
- The MergeCertificate operation performs the merging of a certificate or
- certificate chain with a key pair currently available in the service.
- This operation requires the certificates/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param x509_certificates: The certificate or the certificate chain to
- merge.
- :type x509_certificates: list[bytearray]
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateMergeParameters(x509_certificates=x509_certificates, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.merge_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateMergeParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 201:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'}
-
- def get_deleted_certificates(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """Lists the deleted certificates in the specified vault currently
- available for recovery.
-
- The GetDeletedCertificates operation retrieves the certificates in the
- current vault which are in a deleted state and ready for recovery or
- purging. This operation includes deletion-specific information. This
- operation requires the certificates/get/list permission. This operation
- can only be enabled on soft-delete enabled vaults.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedCertificateItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.DeletedCertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_certificates.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('DeletedCertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_deleted_certificates.metadata = {'url': '/deletedcertificates'}
-
- async def get_deleted_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Retrieves information about the specified deleted certificate.
-
- The GetDeletedCertificate operation retrieves the deleted certificate
- information plus its attributes, such as retention interval, scheduled
- permanent deletion and the current deletion recovery level. This
- operation requires the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedCertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedCertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'}
-
- async def purge_deleted_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Permanently deletes the specified deleted certificate.
-
- The PurgeDeletedCertificate operation performs an irreversible deletion
- of the specified certificate, without possibility for recovery. The
- operation is not available if the recovery level does not specify
- 'Purgeable'. This operation requires the certificate/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'}
-
- async def recover_deleted_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Recovers the deleted certificate back to its current version under
- /certificates.
-
- The RecoverDeletedCertificate operation performs the reversal of the
- Delete operation. The operation is applicable in vaults enabled for
- soft-delete, and must be issued during the retention interval
- (available in the deleted certificate's attributes). This operation
- requires the certificates/recover permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the deleted certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}/recover'}
-
- def get_storage_accounts(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List storage accounts managed by the specified key vault. This
- operation requires the storage/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of StorageAccountItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.StorageAccountItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_storage_accounts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('StorageListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_storage_accounts.metadata = {'url': '/storage'}
-
- async def delete_storage_account(self, vault_base_url, storage_account_name, *, cls=None, **kwargs):
- """Deletes a storage account. This operation requires the storage/delete
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- async def get_storage_account(self, vault_base_url, storage_account_name, *, cls=None, **kwargs):
- """Gets information about a specified storage account. This operation
- requires the storage/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- async def set_storage_account(self, vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period=None, storage_account_attributes=None, tags=None, *, cls=None, **kwargs):
- """Creates or updates a new storage account. This operation requires the
- storage/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param resource_id: Storage account resource id.
- :type resource_id: str
- :param active_key_name: Current active storage account key name.
- :type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
- :type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration
- specified in ISO-8601 format.
- :type regeneration_period: str
- :param storage_account_attributes: The attributes of the storage
- account.
- :type storage_account_attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountCreateParameters(resource_id=resource_id, active_key_name=active_key_name, auto_regenerate_key=auto_regenerate_key, regeneration_period=regeneration_period, storage_account_attributes=storage_account_attributes, tags=tags)
-
- # Construct URL
- url = self.set_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- async def update_storage_account(self, vault_base_url, storage_account_name, active_key_name=None, auto_regenerate_key=None, regeneration_period=None, storage_account_attributes=None, tags=None, *, cls=None, **kwargs):
- """Updates the specified attributes associated with the given storage
- account. This operation requires the storage/set/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param active_key_name: The current active storage account key name.
- :type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
- :type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration
- specified in ISO-8601 format.
- :type regeneration_period: str
- :param storage_account_attributes: The attributes of the storage
- account.
- :type storage_account_attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountUpdateParameters(active_key_name=active_key_name, auto_regenerate_key=auto_regenerate_key, regeneration_period=regeneration_period, storage_account_attributes=storage_account_attributes, tags=tags)
-
- # Construct URL
- url = self.update_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- async def regenerate_storage_account_key(self, vault_base_url, storage_account_name, key_name, *, cls=None, **kwargs):
- """Regenerates the specified key value for the given storage account. This
- operation requires the storage/regeneratekey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param key_name: The storage account key name.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountRegenerteKeyParameters(key_name=key_name)
-
- # Construct URL
- url = self.regenerate_storage_account_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountRegenerteKeyParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- regenerate_storage_account_key.metadata = {'url': '/storage/{storage-account-name}/regeneratekey'}
-
- def get_sas_definitions(
- self, vault_base_url, storage_account_name, maxresults=None, *, cls=None, **kwargs):
- """List storage SAS definitions for the given storage account. This
- operation requires the storage/listsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SasDefinitionItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v2016_10_01.models.SasDefinitionItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_sas_definitions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('SasDefinitionListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_sas_definitions.metadata = {'url': '/storage/{storage-account-name}/sas'}
-
- async def delete_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, *, cls=None, **kwargs):
- """Deletes a SAS definition from a specified storage account. This
- operation requires the storage/deletesas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- async def get_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, *, cls=None, **kwargs):
- """Gets information about a SAS definition for the specified storage
- account. This operation requires the storage/getsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- async def set_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, parameters, sas_definition_attributes=None, tags=None, *, cls=None, **kwargs):
- """Creates or updates a new SAS definition for the specified storage
- account. This operation requires the storage/setsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param parameters: Sas definition creation metadata in the form of
- key-value pairs.
- :type parameters: dict[str, str]
- :param sas_definition_attributes: The attributes of the SAS
- definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters1 = models.SasDefinitionCreateParameters(parameters=parameters, sas_definition_attributes=sas_definition_attributes, tags=tags)
-
- # Construct URL
- url = self.set_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters1, 'SasDefinitionCreateParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- async def update_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, parameters=None, sas_definition_attributes=None, tags=None, *, cls=None, **kwargs):
- """Updates the specified attributes associated with the given SAS
- definition. This operation requires the storage/setsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param parameters: Sas definition update metadata in the form of
- key-value pairs.
- :type parameters: dict[str, str]
- :param sas_definition_attributes: The attributes of the SAS
- definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters1 = models.SasDefinitionUpdateParameters(parameters=parameters, sas_definition_attributes=sas_definition_attributes, tags=tags)
-
- # Construct URL
- url = self.update_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters1, 'SasDefinitionUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_key_vault_client_enums.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_key_vault_client_enums.py
deleted file mode 100644
index c9bb22cda150..000000000000
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/models/_key_vault_client_enums.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-from enum import Enum
-
-
-class JsonWebKeyType(str, Enum):
-
- ec = "EC"
- ec_hsm = "EC-HSM"
- rsa = "RSA"
- rsa_hsm = "RSA-HSM"
- oct = "oct"
-
-
-class JsonWebKeyCurveName(str, Enum):
-
- p_256 = "P-256" #: The NIST P-256 elliptic curve, AKA SECG curve SECP256R1.
- p_384 = "P-384" #: The NIST P-384 elliptic curve, AKA SECG curve SECP384R1.
- p_521 = "P-521" #: The NIST P-521 elliptic curve, AKA SECG curve SECP521R1.
- secp256_k1 = "SECP256K1" #: The SECG SECP256K1 elliptic curve.
-
-
-class DeletionRecoveryLevel(str, Enum):
-
- purgeable = "Purgeable" #: Soft-delete is not enabled for this vault. A DELETE operation results in immediate and irreversible data loss.
- recoverable_purgeable = "Recoverable+Purgeable" #: Soft-delete is enabled for this vault; A privileged user may trigger an immediate, irreversible deletion(purge) of a deleted entity.
- recoverable = "Recoverable" #: Soft-delete is enabled for this vault and purge has been disabled. A deleted entity will remain in this state until recovered, or the end of the retention interval.
- recoverable_protected_subscription = "Recoverable+ProtectedSubscription" #: Soft-delete is enabled for this vault, and the subscription is protected against immediate deletion.
-
-
-class KeyUsageType(str, Enum):
-
- digital_signature = "digitalSignature"
- non_repudiation = "nonRepudiation"
- key_encipherment = "keyEncipherment"
- data_encipherment = "dataEncipherment"
- key_agreement = "keyAgreement"
- key_cert_sign = "keyCertSign"
- c_rl_sign = "cRLSign"
- encipher_only = "encipherOnly"
- decipher_only = "decipherOnly"
-
-
-class ActionType(str, Enum):
-
- email_contacts = "EmailContacts"
- auto_renew = "AutoRenew"
-
-
-class JsonWebKeyOperation(str, Enum):
-
- encrypt = "encrypt"
- decrypt = "decrypt"
- sign = "sign"
- verify = "verify"
- wrap_key = "wrapKey"
- unwrap_key = "unwrapKey"
-
-
-class JsonWebKeyEncryptionAlgorithm(str, Enum):
-
- rsa_oaep = "RSA-OAEP"
- rsa_oaep_256 = "RSA-OAEP-256"
- rsa1_5 = "RSA1_5"
-
-
-class JsonWebKeySignatureAlgorithm(str, Enum):
-
- ps256 = "PS256"
- ps384 = "PS384"
- ps512 = "PS512"
- rs256 = "RS256"
- rs384 = "RS384"
- rs512 = "RS512"
- rsnull = "RSNULL"
- es256 = "ES256"
- es384 = "ES384"
- es512 = "ES512"
- ecdsa256 = "ECDSA256"
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/operations/_key_vault_client_operations.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/operations/_key_vault_client_operations.py
deleted file mode 100644
index a84f1ad1ee7d..000000000000
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v2016_10_01/operations/_key_vault_client_operations.py
+++ /dev/null
@@ -1,4475 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-from azure.core.exceptions import map_error
-from azure.core.paging import ItemPaged
-from .. import models
-import uuid
-
-
-class KeyVaultClientOperationsMixin(object):
-
- def create_key(self, vault_base_url, key_name, kty, key_size=None, key_ops=None, key_attributes=None, tags=None, curve=None, cls=None, **kwargs):
- """Creates a new key, stores it, then returns key parameters and
- attributes to the client.
-
- The create key operation can be used to create any key type in Azure
- Key Vault. If the named key already exists, Azure Key Vault creates a
- new version of the key. It requires the keys/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name for the new key. The system will generate
- the version name for the new key.
- :type key_name: str
- :param kty: The type of key to create. For valid values, see
- JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA',
- 'RSA-HSM', 'oct'
- :type kty: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or
- 4096 for RSA.
- :type key_size: int
- :param key_ops:
- :type key_ops: list[str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
- :param key_attributes:
- :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384',
- 'P-521', 'SECP256K1'
- :type curve: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyCurveName
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyCreateParameters(kty=kty, key_size=key_size, key_ops=key_ops, key_attributes=key_attributes, tags=tags, curve=curve)
-
- # Construct URL
- url = self.create_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyCreateParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- create_key.metadata = {'url': '/keys/{key-name}/create'}
-
- def import_key(self, vault_base_url, key_name, key, hsm=None, key_attributes=None, tags=None, cls=None, **kwargs):
- """Imports an externally created key, stores it, and returns key
- parameters and attributes to the client.
-
- The import key operation may be used to import any key type into an
- Azure Key Vault. If the named key already exists, Azure Key Vault
- creates a new version of the key. This operation requires the
- keys/import permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: Name for the imported key.
- :type key_name: str
- :param key: The Json web key
- :type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
- :param hsm: Whether to import as a hardware key (HSM) or software key.
- :type hsm: bool
- :param key_attributes: The key management attributes.
- :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyImportParameters(hsm=hsm, key=key, key_attributes=key_attributes, tags=tags)
-
- # Construct URL
- url = self.import_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyImportParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- import_key.metadata = {'url': '/keys/{key-name}'}
-
- def delete_key(self, vault_base_url, key_name, cls=None, **kwargs):
- """Deletes a key of any type from storage in Azure Key Vault.
-
- The delete key operation cannot be used to remove individual versions
- of a key. This operation removes the cryptographic material associated
- with the key, which means the key is not usable for Sign/Verify,
- Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
- keys/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key to delete.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedKeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedKeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_key.metadata = {'url': '/keys/{key-name}'}
-
- def update_key(self, vault_base_url, key_name, key_version, key_ops=None, key_attributes=None, tags=None, cls=None, **kwargs):
- """The update key operation changes specified attributes of a stored key
- and can be applied to any key type and key version stored in Azure Key
- Vault.
-
- In order to perform this operation, the key must already exist in the
- Key Vault. Note: The cryptographic material of a key itself cannot be
- changed. This operation requires the keys/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of key to update.
- :type key_name: str
- :param key_version: The version of the key to update.
- :type key_version: str
- :param key_ops: Json web key operations. For more information on
- possible key operations, see JsonWebKeyOperation.
- :type key_ops: list[str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
- :param key_attributes:
- :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyUpdateParameters(key_ops=key_ops, key_attributes=key_attributes, tags=tags)
-
- # Construct URL
- url = self.update_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_key.metadata = {'url': '/keys/{key-name}/{key-version}'}
-
- def get_key(self, vault_base_url, key_name, key_version, cls=None, **kwargs):
- """Gets the public part of a stored key.
-
- The get key operation is applicable to all key types. If the requested
- key is symmetric, then no key material is released in the response.
- This operation requires the keys/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key to get.
- :type key_name: str
- :param key_version: Adding the version parameter retrieves a specific
- version of a key.
- :type key_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_key.metadata = {'url': '/keys/{key-name}/{key-version}'}
-
- def get_key_versions(
- self, vault_base_url, key_name, maxresults=None, cls=None, **kwargs):
- """Retrieves a list of individual key versions with the same key name.
-
- The full key identifier, attributes, and tags are provided in the
- response. This operation requires the keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of KeyItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.KeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_key_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('KeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_key_versions.metadata = {'url': '/keys/{key-name}/versions'}
-
- def get_keys(
- self, vault_base_url, maxresults=None, cls=None, **kwargs):
- """List keys in the specified vault.
-
- Retrieves a list of the keys in the Key Vault as JSON Web Key
- structures that contain the public part of a stored key. The LIST
- operation is applicable to all key types, however only the base key
- identifier, attributes, and tags are provided in the response.
- Individual versions of a key are not listed in the response. This
- operation requires the keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of KeyItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.KeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_keys.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('KeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_keys.metadata = {'url': '/keys'}
-
- def backup_key(self, vault_base_url, key_name, cls=None, **kwargs):
- """Requests that a backup of the specified key be downloaded to the
- client.
-
- The Key Backup operation exports a key from Azure Key Vault in a
- protected form. Note that this operation does NOT return key material
- in a form that can be used outside the Azure Key Vault system, the
- returned key material is either protected to a Azure Key Vault HSM or
- to Azure Key Vault itself. The intent of this operation is to allow a
- client to GENERATE a key in one Azure Key Vault instance, BACKUP the
- key, and then RESTORE it into another Azure Key Vault instance. The
- BACKUP operation may be used to export, in protected form, any key type
- from Azure Key Vault. Individual versions of a key cannot be backed up.
- BACKUP / RESTORE can be performed within geographical boundaries only;
- meaning that a BACKUP from one geographical area cannot be restored to
- another geographical area. For example, a backup from the US
- geographical area cannot be restored in an EU geographical area. This
- operation requires the key/backup permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: BackupKeyResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.BackupKeyResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.backup_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('BackupKeyResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- backup_key.metadata = {'url': '/keys/{key-name}/backup'}
-
- def restore_key(self, vault_base_url, key_bundle_backup, cls=None, **kwargs):
- """Restores a backed up key to a vault.
-
- Imports a previously backed up key into Azure Key Vault, restoring the
- key, its key identifier, attributes and access control policies. The
- RESTORE operation may be used to import a previously backed up key.
- Individual versions of a key cannot be restored. The key is restored in
- its entirety with the same key name as it had when it was backed up. If
- the key name is not available in the target Key Vault, the RESTORE
- operation will be rejected. While the key name is retained during
- restore, the final key identifier will change if the key is restored to
- a different vault. Restore will restore all versions and preserve
- version identifiers. The RESTORE operation is subject to security
- constraints: The target Key Vault must be owned by the same Microsoft
- Azure Subscription as the source Key Vault The user must have RESTORE
- permission in the target Key Vault. This operation requires the
- keys/restore permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_bundle_backup: The backup blob associated with a key
- bundle.
- :type key_bundle_backup: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyRestoreParameters(key_bundle_backup=key_bundle_backup)
-
- # Construct URL
- url = self.restore_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- restore_key.metadata = {'url': '/keys/restore'}
-
- def encrypt(self, vault_base_url, key_name, key_version, algorithm, value, cls=None, **kwargs):
- """Encrypts an arbitrary sequence of bytes using an encryption key that is
- stored in a key vault.
-
- The ENCRYPT operation encrypts an arbitrary sequence of bytes using an
- encryption key that is stored in Azure Key Vault. Note that the ENCRYPT
- operation only supports a single block of data, the size of which is
- dependent on the target key and the encryption algorithm to be used.
- The ENCRYPT operation is only strictly necessary for symmetric keys
- stored in Azure Key Vault since protection with an asymmetric key can
- be performed using public portion of the key. This operation is
- supported for asymmetric keys as a convenience for callers that have a
- key-reference but do not have access to the public key material. This
- operation requires the keys/encrypt permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.encrypt.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'}
-
- def decrypt(self, vault_base_url, key_name, key_version, algorithm, value, cls=None, **kwargs):
- """Decrypts a single block of encrypted data.
-
- The DECRYPT operation decrypts a well-formed block of ciphertext using
- the target encryption key and specified algorithm. This operation is
- the reverse of the ENCRYPT operation; only a single block of data may
- be decrypted, the size of this block is dependent on the target key and
- the algorithm to be used. The DECRYPT operation applies to asymmetric
- and symmetric keys stored in Azure Key Vault since it uses the private
- portion of the key. This operation requires the keys/decrypt
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.decrypt.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'}
-
- def sign(self, vault_base_url, key_name, key_version, algorithm, value, cls=None, **kwargs):
- """Creates a signature from a digest using the specified key.
-
- The SIGN operation is applicable to asymmetric and symmetric keys
- stored in Azure Key Vault since this operation uses the private portion
- of the key. This operation requires the keys/sign permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: The signing/verification algorithm identifier. For
- more information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256',
- 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256',
- 'ES384', 'ES512', 'ECDSA256'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeySignParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.sign.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeySignParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'}
-
- def verify(self, vault_base_url, key_name, key_version, algorithm, digest, signature, cls=None, **kwargs):
- """Verifies a signature using a specified key.
-
- The VERIFY operation is applicable to symmetric keys stored in Azure
- Key Vault. VERIFY is not strictly necessary for asymmetric keys stored
- in Azure Key Vault since signature verification can be performed using
- the public portion of the key but this operation is supported as a
- convenience for callers that only have a key-reference and not the
- public portion of the key. This operation requires the keys/verify
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: The signing/verification algorithm. For more
- information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256',
- 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256',
- 'ES384', 'ES512', 'ECDSA256'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeySignatureAlgorithm
- :param digest: The digest used for signing.
- :type digest: bytes
- :param signature: The signature to be verified.
- :type signature: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyVerifyResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyVerifyResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyVerifyParameters(algorithm=algorithm, digest=digest, signature=signature)
-
- # Construct URL
- url = self.verify.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyVerifyResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'}
-
- def wrap_key(self, vault_base_url, key_name, key_version, algorithm, value, cls=None, **kwargs):
- """Wraps a symmetric key using a specified key.
-
- The WRAP operation supports encryption of a symmetric key using a key
- encryption key that has previously been stored in an Azure Key Vault.
- The WRAP operation is only strictly necessary for symmetric keys stored
- in Azure Key Vault since protection with an asymmetric key can be
- performed using the public portion of the key. This operation is
- supported for asymmetric keys as a convenience for callers that have a
- key-reference but do not have access to the public key material. This
- operation requires the keys/wrapKey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.wrap_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'}
-
- def unwrap_key(self, vault_base_url, key_name, key_version, algorithm, value, cls=None, **kwargs):
- """Unwraps a symmetric key using the specified key that was initially used
- for wrapping that key.
-
- The UNWRAP operation supports decryption of a symmetric key using the
- target key encryption key. This operation is the reverse of the WRAP
- operation. The UNWRAP operation applies to asymmetric and symmetric
- keys stored in Azure Key Vault since it uses the private portion of the
- key. This operation requires the keys/unwrapKey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v2016_10_01.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.unwrap_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'}
-
- def get_deleted_keys(
- self, vault_base_url, maxresults=None, cls=None, **kwargs):
- """Lists the deleted keys in the specified vault.
-
- Retrieves a list of the keys in the Key Vault as JSON Web Key
- structures that contain the public part of a deleted key. This
- operation includes deletion-specific information. The Get Deleted Keys
- operation is applicable for vaults enabled for soft-delete. While the
- operation can be invoked on any vault, it will return an error if
- invoked on a non soft-delete enabled vault. This operation requires the
- keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedKeyItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedKeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_keys.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('DeletedKeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_deleted_keys.metadata = {'url': '/deletedkeys'}
-
- def get_deleted_key(self, vault_base_url, key_name, cls=None, **kwargs):
- """Gets the public part of a deleted key.
-
- The Get Deleted Key operation is applicable for soft-delete enabled
- vaults. While the operation can be invoked on any vault, it will return
- an error if invoked on a non soft-delete enabled vault. This operation
- requires the keys/get permission. .
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedKeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedKeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedKeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'}
-
- def purge_deleted_key(self, vault_base_url, key_name, cls=None, **kwargs):
- """Permanently deletes the specified key.
-
- The Purge Deleted Key operation is applicable for soft-delete enabled
- vaults. While the operation can be invoked on any vault, it will return
- an error if invoked on a non soft-delete enabled vault. This operation
- requires the keys/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'}
-
- def recover_deleted_key(self, vault_base_url, key_name, cls=None, **kwargs):
- """Recovers the deleted key to its latest version.
-
- The Recover Deleted Key operation is applicable for deleted keys in
- soft-delete enabled vaults. It recovers the deleted key back to its
- latest version under /keys. An attempt to recover an non-deleted key
- will return an error. Consider this the inverse of the delete operation
- on soft-delete enabled vaults. This operation requires the keys/recover
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the deleted key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'}
-
- def set_secret(self, vault_base_url, secret_name, value, tags=None, content_type=None, secret_attributes=None, cls=None, **kwargs):
- """Sets a secret in a specified key vault.
-
- The SET operation adds a secret to the Azure Key Vault. If the named
- secret already exists, Azure Key Vault creates a new version of that
- secret. This operation requires the secrets/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param value: The value of the secret.
- :type value: str
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param content_type: Type of the secret value such as a password.
- :type content_type: str
- :param secret_attributes: The secret management attributes.
- :type secret_attributes:
- ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretSetParameters(value=value, tags=tags, content_type=content_type, secret_attributes=secret_attributes)
-
- # Construct URL
- url = self.set_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretSetParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_secret.metadata = {'url': '/secrets/{secret-name}'}
-
- def delete_secret(self, vault_base_url, secret_name, cls=None, **kwargs):
- """Deletes a secret from a specified key vault.
-
- The DELETE operation applies to any secret stored in Azure Key Vault.
- DELETE cannot be applied to an individual version of a secret. This
- operation requires the secrets/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedSecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedSecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_secret.metadata = {'url': '/secrets/{secret-name}'}
-
- def update_secret(self, vault_base_url, secret_name, secret_version, content_type=None, secret_attributes=None, tags=None, cls=None, **kwargs):
- """Updates the attributes associated with a specified secret in a given
- key vault.
-
- The UPDATE operation changes specified attributes of an existing stored
- secret. Attributes that are not specified in the request are left
- unchanged. The value of a secret itself cannot be changed. This
- operation requires the secrets/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param secret_version: The version of the secret.
- :type secret_version: str
- :param content_type: Type of the secret value such as a password.
- :type content_type: str
- :param secret_attributes: The secret management attributes.
- :type secret_attributes:
- ~azure.keyvault.v2016_10_01.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretUpdateParameters(content_type=content_type, secret_attributes=secret_attributes, tags=tags)
-
- # Construct URL
- url = self.update_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
- 'secret-version': self._serialize.url("secret_version", secret_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'}
-
- def get_secret(self, vault_base_url, secret_name, secret_version, cls=None, **kwargs):
- """Get a specified secret from a given key vault.
-
- The GET operation is applicable to any secret stored in Azure Key
- Vault. This operation requires the secrets/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param secret_version: The version of the secret.
- :type secret_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
- 'secret-version': self._serialize.url("secret_version", secret_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'}
-
- def get_secrets(
- self, vault_base_url, maxresults=None, cls=None, **kwargs):
- """List secrets in a specified key vault.
-
- The Get Secrets operation is applicable to the entire vault. However,
- only the base secret identifier and its attributes are provided in the
- response. Individual secret versions are not listed in the response.
- This operation requires the secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified, the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SecretItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_secrets.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('SecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_secrets.metadata = {'url': '/secrets'}
-
- def get_secret_versions(
- self, vault_base_url, secret_name, maxresults=None, cls=None, **kwargs):
- """List all versions of the specified secret.
-
- The full secret identifier and attributes are provided in the response.
- No values are returned for the secrets. This operations requires the
- secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified, the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SecretItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_secret_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('SecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_secret_versions.metadata = {'url': '/secrets/{secret-name}/versions'}
-
- def get_deleted_secrets(
- self, vault_base_url, maxresults=None, cls=None, **kwargs):
- """Lists deleted secrets for the specified vault.
-
- The Get Deleted Secrets operation returns the secrets that have been
- deleted for a vault enabled for soft-delete. This operation requires
- the secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedSecretItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedSecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_secrets.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('DeletedSecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_deleted_secrets.metadata = {'url': '/deletedsecrets'}
-
- def get_deleted_secret(self, vault_base_url, secret_name, cls=None, **kwargs):
- """Gets the specified deleted secret.
-
- The Get Deleted Secret operation returns the specified deleted secret
- along with its attributes. This operation requires the secrets/get
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedSecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedSecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedSecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'}
-
- def purge_deleted_secret(self, vault_base_url, secret_name, cls=None, **kwargs):
- """Permanently deletes the specified secret.
-
- The purge deleted secret operation removes the secret permanently,
- without the possibility of recovery. This operation can only be enabled
- on a soft-delete enabled vault. This operation requires the
- secrets/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'}
-
- def recover_deleted_secret(self, vault_base_url, secret_name, cls=None, **kwargs):
- """Recovers the deleted secret to the latest version.
-
- Recovers the deleted secret in the specified vault. This operation can
- only be performed on a soft-delete enabled vault. This operation
- requires the secrets/recover permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the deleted secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}/recover'}
-
- def backup_secret(self, vault_base_url, secret_name, cls=None, **kwargs):
- """Backs up the specified secret.
-
- Requests that a backup of the specified secret be downloaded to the
- client. All versions of the secret will be downloaded. This operation
- requires the secrets/backup permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: BackupSecretResult or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.BackupSecretResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.backup_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('BackupSecretResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- backup_secret.metadata = {'url': '/secrets/{secret-name}/backup'}
-
- def restore_secret(self, vault_base_url, secret_bundle_backup, cls=None, **kwargs):
- """Restores a backed up secret to a vault.
-
- Restores a backed up secret, and all its versions, to a vault. This
- operation requires the secrets/restore permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_bundle_backup: The backup blob associated with a secret
- bundle.
- :type secret_bundle_backup: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretRestoreParameters(secret_bundle_backup=secret_bundle_backup)
-
- # Construct URL
- url = self.restore_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretRestoreParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- restore_secret.metadata = {'url': '/secrets/restore'}
-
- def get_certificates(
- self, vault_base_url, maxresults=None, cls=None, **kwargs):
- """List certificates in a specified key vault.
-
- The GetCertificates operation returns the set of certificates resources
- in the specified key vault. This operation requires the
- certificates/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of CertificateItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificates.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('CertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_certificates.metadata = {'url': '/certificates'}
-
- def delete_certificate(self, vault_base_url, certificate_name, cls=None, **kwargs):
- """Deletes a certificate from a specified key vault.
-
- Deletes all versions of a certificate object along with its associated
- policy. Delete certificate cannot be used to remove individual versions
- of a certificate object. This operation requires the
- certificates/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedCertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedCertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate.metadata = {'url': '/certificates/{certificate-name}'}
-
- def set_certificate_contacts(self, vault_base_url, contact_list=None, cls=None, **kwargs):
- """Sets the certificate contacts for the specified key vault.
-
- Sets the certificate contacts for the specified key vault. This
- operation requires the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param contact_list: The contact list for the vault certificates.
- :type contact_list: list[~azure.keyvault.v2016_10_01.models.Contact]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- contacts = models.Contacts(contact_list=contact_list)
-
- # Construct URL
- url = self.set_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(contacts, 'Contacts')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- def get_certificate_contacts(self, vault_base_url, cls=None, **kwargs):
- """Lists the certificate contacts for a specified key vault.
-
- The GetCertificateContacts operation returns the set of certificate
- contact resources in the specified key vault. This operation requires
- the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- def delete_certificate_contacts(self, vault_base_url, cls=None, **kwargs):
- """Deletes the certificate contacts for a specified key vault.
-
- Deletes the certificate contacts for a specified key vault certificate.
- This operation requires the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- def get_certificate_issuers(
- self, vault_base_url, maxresults=None, cls=None, **kwargs):
- """List certificate issuers for a specified key vault.
-
- The GetCertificateIssuers operation returns the set of certificate
- issuer resources in the specified key vault. This operation requires
- the certificates/manageissuers/getissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of CertificateIssuerItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateIssuerItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificate_issuers.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('CertificateIssuerListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_certificate_issuers.metadata = {'url': '/certificates/issuers'}
-
- def set_certificate_issuer(self, vault_base_url, issuer_name, provider, credentials=None, organization_details=None, attributes=None, cls=None, **kwargs):
- """Sets the specified certificate issuer.
-
- The SetCertificateIssuer operation adds or updates the specified
- certificate issuer. This operation requires the certificates/setissuers
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param provider: The issuer provider.
- :type provider: str
- :param credentials: The credentials to be used for the issuer.
- :type credentials:
- ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided
- to the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
- :param attributes: Attributes of the issuer object.
- :type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameter = models.CertificateIssuerSetParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes)
-
- # Construct URL
- url = self.set_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameter, 'CertificateIssuerSetParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- def update_certificate_issuer(self, vault_base_url, issuer_name, provider=None, credentials=None, organization_details=None, attributes=None, cls=None, **kwargs):
- """Updates the specified certificate issuer.
-
- The UpdateCertificateIssuer operation performs an update on the
- specified certificate issuer entity. This operation requires the
- certificates/setissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param provider: The issuer provider.
- :type provider: str
- :param credentials: The credentials to be used for the issuer.
- :type credentials:
- ~azure.keyvault.v2016_10_01.models.IssuerCredentials
- :param organization_details: Details of the organization as provided
- to the issuer.
- :type organization_details:
- ~azure.keyvault.v2016_10_01.models.OrganizationDetails
- :param attributes: Attributes of the issuer object.
- :type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameter = models.CertificateIssuerUpdateParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes)
-
- # Construct URL
- url = self.update_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameter, 'CertificateIssuerUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- def get_certificate_issuer(self, vault_base_url, issuer_name, cls=None, **kwargs):
- """Lists the specified certificate issuer.
-
- The GetCertificateIssuer operation returns the specified certificate
- issuer resources in the specified key vault. This operation requires
- the certificates/manageissuers/getissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- def delete_certificate_issuer(self, vault_base_url, issuer_name, cls=None, **kwargs):
- """Deletes the specified certificate issuer.
-
- The DeleteCertificateIssuer operation permanently removes the specified
- certificate issuer from the vault. This operation requires the
- certificates/manageissuers/deleteissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- def create_certificate(self, vault_base_url, certificate_name, certificate_policy=None, certificate_attributes=None, tags=None, cls=None, **kwargs):
- """Creates a new certificate.
-
- If this is the first version, the certificate resource is created. This
- operation requires the certificates/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateCreateParameters(certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.create_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateCreateParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [202]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 202:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- create_certificate.metadata = {'url': '/certificates/{certificate-name}/create'}
-
- def import_certificate(self, vault_base_url, certificate_name, base64_encoded_certificate, password=None, certificate_policy=None, certificate_attributes=None, tags=None, cls=None, **kwargs):
- """Imports a certificate into a specified key vault.
-
- Imports an existing valid certificate, containing a private key, into
- Azure Key Vault. The certificate to be imported can be in either PFX or
- PEM format. If the certificate is in PEM format the PEM file must
- contain the key as well as x509 certificates. This operation requires
- the certificates/import permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param base64_encoded_certificate: Base64 encoded representation of
- the certificate object to import. This certificate needs to contain
- the private key.
- :type base64_encoded_certificate: str
- :param password: If the private key in base64EncodedCertificate is
- encrypted, the password used for encryption.
- :type password: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateImportParameters(base64_encoded_certificate=base64_encoded_certificate, password=password, certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.import_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateImportParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- import_certificate.metadata = {'url': '/certificates/{certificate-name}/import'}
-
- def get_certificate_versions(
- self, vault_base_url, certificate_name, maxresults=None, cls=None, **kwargs):
- """List the versions of a certificate.
-
- The GetCertificateVersions operation returns the versions of a
- certificate in the specified key vault. This operation requires the
- certificates/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of CertificateItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.CertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificate_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('CertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_certificate_versions.metadata = {'url': '/certificates/{certificate-name}/versions'}
-
- def get_certificate_policy(self, vault_base_url, certificate_name, cls=None, **kwargs):
- """Lists the policy for a certificate.
-
- The GetCertificatePolicy operation returns the specified certificate
- policy resources in the specified key vault. This operation requires
- the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in a given key
- vault.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificatePolicy or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_policy.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificatePolicy', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'}
-
- def update_certificate_policy(self, vault_base_url, certificate_name, certificate_policy, cls=None, **kwargs):
- """Updates the policy for a certificate.
-
- Set specified members in the certificate policy. Leave others as null.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given
- vault.
- :type certificate_name: str
- :param certificate_policy: The policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificatePolicy or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.update_certificate_policy.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(certificate_policy, 'CertificatePolicy')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificatePolicy', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'}
-
- def update_certificate(self, vault_base_url, certificate_name, certificate_version, certificate_policy=None, certificate_attributes=None, tags=None, cls=None, **kwargs):
- """Updates the specified attributes associated with the given certificate.
-
- The UpdateCertificate operation applies the specified update on the
- given certificate; the only elements updated are the certificate's
- attributes. This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given key
- vault.
- :type certificate_name: str
- :param certificate_version: The version of the certificate.
- :type certificate_version: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v2016_10_01.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateUpdateParameters(certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.update_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
- 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'}
-
- def get_certificate(self, vault_base_url, certificate_name, certificate_version, cls=None, **kwargs):
- """Gets information about a certificate.
-
- Gets information about a specific certificate. This operation requires
- the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given
- vault.
- :type certificate_name: str
- :param certificate_version: The version of the certificate.
- :type certificate_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
- 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'}
-
- def update_certificate_operation(self, vault_base_url, certificate_name, cancellation_requested, cls=None, **kwargs):
- """Updates a certificate operation.
-
- Updates a certificate creation operation that is already in progress.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param cancellation_requested: Indicates if cancellation was requested
- on the certificate operation.
- :type cancellation_requested: bool
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- certificate_operation = models.CertificateOperationUpdateParameter(cancellation_requested=cancellation_requested)
-
- # Construct URL
- url = self.update_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(certificate_operation, 'CertificateOperationUpdateParameter')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- def get_certificate_operation(self, vault_base_url, certificate_name, cls=None, **kwargs):
- """Gets the creation operation of a certificate.
-
- Gets the creation operation associated with a specified certificate.
- This operation requires the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- def delete_certificate_operation(self, vault_base_url, certificate_name, cls=None, **kwargs):
- """Deletes the creation operation for a specific certificate.
-
- Deletes the creation operation for a specified certificate that is in
- the process of being created. The certificate is no longer created.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- def merge_certificate(self, vault_base_url, certificate_name, x509_certificates, certificate_attributes=None, tags=None, cls=None, **kwargs):
- """Merges a certificate or a certificate chain with a key pair existing on
- the server.
-
- The MergeCertificate operation performs the merging of a certificate or
- certificate chain with a key pair currently available in the service.
- This operation requires the certificates/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param x509_certificates: The certificate or the certificate chain to
- merge.
- :type x509_certificates: list[bytearray]
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v2016_10_01.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateMergeParameters(x509_certificates=x509_certificates, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.merge_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateMergeParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 201:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'}
-
- def get_deleted_certificates(
- self, vault_base_url, maxresults=None, cls=None, **kwargs):
- """Lists the deleted certificates in the specified vault currently
- available for recovery.
-
- The GetDeletedCertificates operation retrieves the certificates in the
- current vault which are in a deleted state and ready for recovery or
- purging. This operation includes deletion-specific information. This
- operation requires the certificates/get/list permission. This operation
- can only be enabled on soft-delete enabled vaults.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedCertificateItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.DeletedCertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_certificates.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('DeletedCertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_deleted_certificates.metadata = {'url': '/deletedcertificates'}
-
- def get_deleted_certificate(self, vault_base_url, certificate_name, cls=None, **kwargs):
- """Retrieves information about the specified deleted certificate.
-
- The GetDeletedCertificate operation retrieves the deleted certificate
- information plus its attributes, such as retention interval, scheduled
- permanent deletion and the current deletion recovery level. This
- operation requires the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedCertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.DeletedCertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedCertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'}
-
- def purge_deleted_certificate(self, vault_base_url, certificate_name, cls=None, **kwargs):
- """Permanently deletes the specified deleted certificate.
-
- The PurgeDeletedCertificate operation performs an irreversible deletion
- of the specified certificate, without possibility for recovery. The
- operation is not available if the recovery level does not specify
- 'Purgeable'. This operation requires the certificate/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'}
-
- def recover_deleted_certificate(self, vault_base_url, certificate_name, cls=None, **kwargs):
- """Recovers the deleted certificate back to its current version under
- /certificates.
-
- The RecoverDeletedCertificate operation performs the reversal of the
- Delete operation. The operation is applicable in vaults enabled for
- soft-delete, and must be issued during the retention interval
- (available in the deleted certificate's attributes). This operation
- requires the certificates/recover permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the deleted certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}/recover'}
-
- def get_storage_accounts(
- self, vault_base_url, maxresults=None, cls=None, **kwargs):
- """List storage accounts managed by the specified key vault. This
- operation requires the storage/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of StorageAccountItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.StorageAccountItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_storage_accounts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('StorageListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_storage_accounts.metadata = {'url': '/storage'}
-
- def delete_storage_account(self, vault_base_url, storage_account_name, cls=None, **kwargs):
- """Deletes a storage account. This operation requires the storage/delete
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- def get_storage_account(self, vault_base_url, storage_account_name, cls=None, **kwargs):
- """Gets information about a specified storage account. This operation
- requires the storage/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- def set_storage_account(self, vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period=None, storage_account_attributes=None, tags=None, cls=None, **kwargs):
- """Creates or updates a new storage account. This operation requires the
- storage/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param resource_id: Storage account resource id.
- :type resource_id: str
- :param active_key_name: Current active storage account key name.
- :type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
- :type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration
- specified in ISO-8601 format.
- :type regeneration_period: str
- :param storage_account_attributes: The attributes of the storage
- account.
- :type storage_account_attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountCreateParameters(resource_id=resource_id, active_key_name=active_key_name, auto_regenerate_key=auto_regenerate_key, regeneration_period=regeneration_period, storage_account_attributes=storage_account_attributes, tags=tags)
-
- # Construct URL
- url = self.set_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- def update_storage_account(self, vault_base_url, storage_account_name, active_key_name=None, auto_regenerate_key=None, regeneration_period=None, storage_account_attributes=None, tags=None, cls=None, **kwargs):
- """Updates the specified attributes associated with the given storage
- account. This operation requires the storage/set/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param active_key_name: The current active storage account key name.
- :type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
- :type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration
- specified in ISO-8601 format.
- :type regeneration_period: str
- :param storage_account_attributes: The attributes of the storage
- account.
- :type storage_account_attributes:
- ~azure.keyvault.v2016_10_01.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountUpdateParameters(active_key_name=active_key_name, auto_regenerate_key=auto_regenerate_key, regeneration_period=regeneration_period, storage_account_attributes=storage_account_attributes, tags=tags)
-
- # Construct URL
- url = self.update_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- def regenerate_storage_account_key(self, vault_base_url, storage_account_name, key_name, cls=None, **kwargs):
- """Regenerates the specified key value for the given storage account. This
- operation requires the storage/regeneratekey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param key_name: The storage account key name.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountRegenerteKeyParameters(key_name=key_name)
-
- # Construct URL
- url = self.regenerate_storage_account_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountRegenerteKeyParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- regenerate_storage_account_key.metadata = {'url': '/storage/{storage-account-name}/regeneratekey'}
-
- def get_sas_definitions(
- self, vault_base_url, storage_account_name, maxresults=None, cls=None, **kwargs):
- """List storage SAS definitions for the given storage account. This
- operation requires the storage/listsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SasDefinitionItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v2016_10_01.models.SasDefinitionItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_sas_definitions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- def extract_data(response):
- deserialized = self._deserialize('SasDefinitionListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return ItemPaged(
- get_next, extract_data
- )
- get_sas_definitions.metadata = {'url': '/storage/{storage-account-name}/sas'}
-
- def delete_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, cls=None, **kwargs):
- """Deletes a SAS definition from a specified storage account. This
- operation requires the storage/deletesas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- def get_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, cls=None, **kwargs):
- """Gets information about a SAS definition for the specified storage
- account. This operation requires the storage/getsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- def set_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, parameters, sas_definition_attributes=None, tags=None, cls=None, **kwargs):
- """Creates or updates a new SAS definition for the specified storage
- account. This operation requires the storage/setsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param parameters: Sas definition creation metadata in the form of
- key-value pairs.
- :type parameters: dict[str, str]
- :param sas_definition_attributes: The attributes of the SAS
- definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters1 = models.SasDefinitionCreateParameters(parameters=parameters, sas_definition_attributes=sas_definition_attributes, tags=tags)
-
- # Construct URL
- url = self.set_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters1, 'SasDefinitionCreateParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- def update_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, parameters=None, sas_definition_attributes=None, tags=None, cls=None, **kwargs):
- """Updates the specified attributes associated with the given SAS
- definition. This operation requires the storage/setsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param parameters: Sas definition update metadata in the form of
- key-value pairs.
- :type parameters: dict[str, str]
- :param sas_definition_attributes: The attributes of the SAS
- definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v2016_10_01.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v2016_10_01.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters1 = models.SasDefinitionUpdateParameters(parameters=parameters, sas_definition_attributes=sas_definition_attributes, tags=tags)
-
- # Construct URL
- url = self.update_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters1, 'SasDefinitionUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/operations_async/_key_vault_client_operations_async.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/operations_async/_key_vault_client_operations_async.py
deleted file mode 100644
index 1675be60f93a..000000000000
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/aio/operations_async/_key_vault_client_operations_async.py
+++ /dev/null
@@ -1,5163 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-from azure.core.exceptions import map_error
-from azure.core.async_paging import AsyncItemPaged, AsyncList
-from ... import models
-import uuid
-
-
-class KeyVaultClientOperationsMixin:
-
- async def create_key(self, vault_base_url, key_name, kty, key_size=None, key_ops=None, key_attributes=None, tags=None, curve=None, *, cls=None, **kwargs):
- """Creates a new key, stores it, then returns key parameters and
- attributes to the client.
-
- The create key operation can be used to create any key type in Azure
- Key Vault. If the named key already exists, Azure Key Vault creates a
- new version of the key. It requires the keys/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name for the new key. The system will generate
- the version name for the new key.
- :type key_name: str
- :param kty: The type of key to create. For valid values, see
- JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA',
- 'RSA-HSM', 'oct'
- :type kty: str or ~azure.keyvault.v7_0.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or
- 4096 for RSA.
- :type key_size: int
- :param key_ops:
- :type key_ops: list[str or
- ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
- :param key_attributes:
- :type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384',
- 'P-521', 'P-256K'
- :type curve: str or ~azure.keyvault.v7_0.models.JsonWebKeyCurveName
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyCreateParameters(kty=kty, key_size=key_size, key_ops=key_ops, key_attributes=key_attributes, tags=tags, curve=curve)
-
- # Construct URL
- url = self.create_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyCreateParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- create_key.metadata = {'url': '/keys/{key-name}/create'}
-
- async def import_key(self, vault_base_url, key_name, key, hsm=None, key_attributes=None, tags=None, *, cls=None, **kwargs):
- """Imports an externally created key, stores it, and returns key
- parameters and attributes to the client.
-
- The import key operation may be used to import any key type into an
- Azure Key Vault. If the named key already exists, Azure Key Vault
- creates a new version of the key. This operation requires the
- keys/import permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: Name for the imported key.
- :type key_name: str
- :param key: The Json web key
- :type key: ~azure.keyvault.v7_0.models.JsonWebKey
- :param hsm: Whether to import as a hardware key (HSM) or software key.
- :type hsm: bool
- :param key_attributes: The key management attributes.
- :type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyImportParameters(hsm=hsm, key=key, key_attributes=key_attributes, tags=tags)
-
- # Construct URL
- url = self.import_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyImportParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- import_key.metadata = {'url': '/keys/{key-name}'}
-
- async def delete_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Deletes a key of any type from storage in Azure Key Vault.
-
- The delete key operation cannot be used to remove individual versions
- of a key. This operation removes the cryptographic material associated
- with the key, which means the key is not usable for Sign/Verify,
- Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
- keys/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key to delete.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedKeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedKeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_key.metadata = {'url': '/keys/{key-name}'}
-
- async def update_key(self, vault_base_url, key_name, key_version, key_ops=None, key_attributes=None, tags=None, *, cls=None, **kwargs):
- """The update key operation changes specified attributes of a stored key
- and can be applied to any key type and key version stored in Azure Key
- Vault.
-
- In order to perform this operation, the key must already exist in the
- Key Vault. Note: The cryptographic material of a key itself cannot be
- changed. This operation requires the keys/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of key to update.
- :type key_name: str
- :param key_version: The version of the key to update.
- :type key_version: str
- :param key_ops: Json web key operations. For more information on
- possible key operations, see JsonWebKeyOperation.
- :type key_ops: list[str or
- ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
- :param key_attributes:
- :type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyUpdateParameters(key_ops=key_ops, key_attributes=key_attributes, tags=tags)
-
- # Construct URL
- url = self.update_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_key.metadata = {'url': '/keys/{key-name}/{key-version}'}
-
- async def get_key(self, vault_base_url, key_name, key_version, *, cls=None, **kwargs):
- """Gets the public part of a stored key.
-
- The get key operation is applicable to all key types. If the requested
- key is symmetric, then no key material is released in the response.
- This operation requires the keys/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key to get.
- :type key_name: str
- :param key_version: Adding the version parameter retrieves a specific
- version of a key.
- :type key_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_key.metadata = {'url': '/keys/{key-name}/{key-version}'}
-
- def get_key_versions(
- self, vault_base_url, key_name, maxresults=None, *, cls=None, **kwargs):
- """Retrieves a list of individual key versions with the same key name.
-
- The full key identifier, attributes, and tags are provided in the
- response. This operation requires the keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of KeyItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.KeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_key_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('KeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_key_versions.metadata = {'url': '/keys/{key-name}/versions'}
-
- def get_keys(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List keys in the specified vault.
-
- Retrieves a list of the keys in the Key Vault as JSON Web Key
- structures that contain the public part of a stored key. The LIST
- operation is applicable to all key types, however only the base key
- identifier, attributes, and tags are provided in the response.
- Individual versions of a key are not listed in the response. This
- operation requires the keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of KeyItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.KeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_keys.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('KeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_keys.metadata = {'url': '/keys'}
-
- async def backup_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Requests that a backup of the specified key be downloaded to the
- client.
-
- The Key Backup operation exports a key from Azure Key Vault in a
- protected form. Note that this operation does NOT return key material
- in a form that can be used outside the Azure Key Vault system, the
- returned key material is either protected to a Azure Key Vault HSM or
- to Azure Key Vault itself. The intent of this operation is to allow a
- client to GENERATE a key in one Azure Key Vault instance, BACKUP the
- key, and then RESTORE it into another Azure Key Vault instance. The
- BACKUP operation may be used to export, in protected form, any key type
- from Azure Key Vault. Individual versions of a key cannot be backed up.
- BACKUP / RESTORE can be performed within geographical boundaries only;
- meaning that a BACKUP from one geographical area cannot be restored to
- another geographical area. For example, a backup from the US
- geographical area cannot be restored in an EU geographical area. This
- operation requires the key/backup permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: BackupKeyResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.BackupKeyResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.backup_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('BackupKeyResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- backup_key.metadata = {'url': '/keys/{key-name}/backup'}
-
- async def restore_key(self, vault_base_url, key_bundle_backup, *, cls=None, **kwargs):
- """Restores a backed up key to a vault.
-
- Imports a previously backed up key into Azure Key Vault, restoring the
- key, its key identifier, attributes and access control policies. The
- RESTORE operation may be used to import a previously backed up key.
- Individual versions of a key cannot be restored. The key is restored in
- its entirety with the same key name as it had when it was backed up. If
- the key name is not available in the target Key Vault, the RESTORE
- operation will be rejected. While the key name is retained during
- restore, the final key identifier will change if the key is restored to
- a different vault. Restore will restore all versions and preserve
- version identifiers. The RESTORE operation is subject to security
- constraints: The target Key Vault must be owned by the same Microsoft
- Azure Subscription as the source Key Vault The user must have RESTORE
- permission in the target Key Vault. This operation requires the
- keys/restore permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_bundle_backup: The backup blob associated with a key
- bundle.
- :type key_bundle_backup: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyRestoreParameters(key_bundle_backup=key_bundle_backup)
-
- # Construct URL
- url = self.restore_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyRestoreParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- restore_key.metadata = {'url': '/keys/restore'}
-
- async def encrypt(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Encrypts an arbitrary sequence of bytes using an encryption key that is
- stored in a key vault.
-
- The ENCRYPT operation encrypts an arbitrary sequence of bytes using an
- encryption key that is stored in Azure Key Vault. Note that the ENCRYPT
- operation only supports a single block of data, the size of which is
- dependent on the target key and the encryption algorithm to be used.
- The ENCRYPT operation is only strictly necessary for symmetric keys
- stored in Azure Key Vault since protection with an asymmetric key can
- be performed using public portion of the key. This operation is
- supported for asymmetric keys as a convenience for callers that have a
- key-reference but do not have access to the public key material. This
- operation requires the keys/encrypt permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.encrypt.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'}
-
- async def decrypt(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Decrypts a single block of encrypted data.
-
- The DECRYPT operation decrypts a well-formed block of ciphertext using
- the target encryption key and specified algorithm. This operation is
- the reverse of the ENCRYPT operation; only a single block of data may
- be decrypted, the size of this block is dependent on the target key and
- the algorithm to be used. The DECRYPT operation applies to asymmetric
- and symmetric keys stored in Azure Key Vault since it uses the private
- portion of the key. This operation requires the keys/decrypt
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.decrypt.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'}
-
- async def sign(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Creates a signature from a digest using the specified key.
-
- The SIGN operation is applicable to asymmetric and symmetric keys
- stored in Azure Key Vault since this operation uses the private portion
- of the key. This operation requires the keys/sign permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: The signing/verification algorithm identifier. For
- more information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256',
- 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256',
- 'ES384', 'ES512', 'ES256K'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeySignParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.sign.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeySignParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'}
-
- async def verify(self, vault_base_url, key_name, key_version, algorithm, digest, signature, *, cls=None, **kwargs):
- """Verifies a signature using a specified key.
-
- The VERIFY operation is applicable to symmetric keys stored in Azure
- Key Vault. VERIFY is not strictly necessary for asymmetric keys stored
- in Azure Key Vault since signature verification can be performed using
- the public portion of the key but this operation is supported as a
- convenience for callers that only have a key-reference and not the
- public portion of the key. This operation requires the keys/verify
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: The signing/verification algorithm. For more
- information on possible algorithm types, see
- JsonWebKeySignatureAlgorithm. Possible values include: 'PS256',
- 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256',
- 'ES384', 'ES512', 'ES256K'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeySignatureAlgorithm
- :param digest: The digest used for signing.
- :type digest: bytes
- :param signature: The signature to be verified.
- :type signature: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyVerifyResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyVerifyResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyVerifyParameters(algorithm=algorithm, digest=digest, signature=signature)
-
- # Construct URL
- url = self.verify.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyVerifyParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyVerifyResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'}
-
- async def wrap_key(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Wraps a symmetric key using a specified key.
-
- The WRAP operation supports encryption of a symmetric key using a key
- encryption key that has previously been stored in an Azure Key Vault.
- The WRAP operation is only strictly necessary for symmetric keys stored
- in Azure Key Vault since protection with an asymmetric key can be
- performed using the public portion of the key. This operation is
- supported for asymmetric keys as a convenience for callers that have a
- key-reference but do not have access to the public key material. This
- operation requires the keys/wrapKey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.wrap_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'}
-
- async def unwrap_key(self, vault_base_url, key_name, key_version, algorithm, value, *, cls=None, **kwargs):
- """Unwraps a symmetric key using the specified key that was initially used
- for wrapping that key.
-
- The UNWRAP operation supports decryption of a symmetric key using the
- target key encryption key. This operation is the reverse of the WRAP
- operation. The UNWRAP operation applies to asymmetric and symmetric
- keys stored in Azure Key Vault since it uses the private portion of the
- key. This operation requires the keys/unwrapKey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param key_version: The version of the key.
- :type key_version: str
- :param algorithm: algorithm identifier. Possible values include:
- 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- :type algorithm: str or
- ~azure.keyvault.v7_0.models.JsonWebKeyEncryptionAlgorithm
- :param value:
- :type value: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyOperationResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyOperationResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value)
-
- # Construct URL
- url = self.unwrap_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyOperationsParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyOperationResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'}
-
- def get_deleted_keys(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """Lists the deleted keys in the specified vault.
-
- Retrieves a list of the keys in the Key Vault as JSON Web Key
- structures that contain the public part of a deleted key. This
- operation includes deletion-specific information. The Get Deleted Keys
- operation is applicable for vaults enabled for soft-delete. While the
- operation can be invoked on any vault, it will return an error if
- invoked on a non soft-delete enabled vault. This operation requires the
- keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedKeyItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedKeyItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_keys.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('DeletedKeyListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_deleted_keys.metadata = {'url': '/deletedkeys'}
-
- async def get_deleted_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Gets the public part of a deleted key.
-
- The Get Deleted Key operation is applicable for soft-delete enabled
- vaults. While the operation can be invoked on any vault, it will return
- an error if invoked on a non soft-delete enabled vault. This operation
- requires the keys/get permission. .
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedKeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedKeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'}
-
- async def purge_deleted_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Permanently deletes the specified key.
-
- The Purge Deleted Key operation is applicable for soft-delete enabled
- vaults. While the operation can be invoked on any vault, it will return
- an error if invoked on a non soft-delete enabled vault. This operation
- requires the keys/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'}
-
- async def recover_deleted_key(self, vault_base_url, key_name, *, cls=None, **kwargs):
- """Recovers the deleted key to its latest version.
-
- The Recover Deleted Key operation is applicable for deleted keys in
- soft-delete enabled vaults. It recovers the deleted key back to its
- latest version under /keys. An attempt to recover an non-deleted key
- will return an error. Consider this the inverse of the delete operation
- on soft-delete enabled vaults. This operation requires the keys/recover
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the deleted key.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'}
-
- async def set_secret(self, vault_base_url, secret_name, value, tags=None, content_type=None, secret_attributes=None, *, cls=None, **kwargs):
- """Sets a secret in a specified key vault.
-
- The SET operation adds a secret to the Azure Key Vault. If the named
- secret already exists, Azure Key Vault creates a new version of that
- secret. This operation requires the secrets/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param value: The value of the secret.
- :type value: str
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param content_type: Type of the secret value such as a password.
- :type content_type: str
- :param secret_attributes: The secret management attributes.
- :type secret_attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretSetParameters(value=value, tags=tags, content_type=content_type, secret_attributes=secret_attributes)
-
- # Construct URL
- url = self.set_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretSetParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_secret.metadata = {'url': '/secrets/{secret-name}'}
-
- async def delete_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Deletes a secret from a specified key vault.
-
- The DELETE operation applies to any secret stored in Azure Key Vault.
- DELETE cannot be applied to an individual version of a secret. This
- operation requires the secrets/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedSecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedSecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_secret.metadata = {'url': '/secrets/{secret-name}'}
-
- async def update_secret(self, vault_base_url, secret_name, secret_version, content_type=None, secret_attributes=None, tags=None, *, cls=None, **kwargs):
- """Updates the attributes associated with a specified secret in a given
- key vault.
-
- The UPDATE operation changes specified attributes of an existing stored
- secret. Attributes that are not specified in the request are left
- unchanged. The value of a secret itself cannot be changed. This
- operation requires the secrets/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param secret_version: The version of the secret.
- :type secret_version: str
- :param content_type: Type of the secret value such as a password.
- :type content_type: str
- :param secret_attributes: The secret management attributes.
- :type secret_attributes: ~azure.keyvault.v7_0.models.SecretAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretUpdateParameters(content_type=content_type, secret_attributes=secret_attributes, tags=tags)
-
- # Construct URL
- url = self.update_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
- 'secret-version': self._serialize.url("secret_version", secret_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'}
-
- async def get_secret(self, vault_base_url, secret_name, secret_version, *, cls=None, **kwargs):
- """Get a specified secret from a given key vault.
-
- The GET operation is applicable to any secret stored in Azure Key
- Vault. This operation requires the secrets/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param secret_version: The version of the secret.
- :type secret_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str'),
- 'secret-version': self._serialize.url("secret_version", secret_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'}
-
- def get_secrets(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List secrets in a specified key vault.
-
- The Get Secrets operation is applicable to the entire vault. However,
- only the base secret identifier and its attributes are provided in the
- response. Individual secret versions are not listed in the response.
- This operation requires the secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified, the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SecretItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_secrets.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('SecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_secrets.metadata = {'url': '/secrets'}
-
- def get_secret_versions(
- self, vault_base_url, secret_name, maxresults=None, *, cls=None, **kwargs):
- """List all versions of the specified secret.
-
- The full secret identifier and attributes are provided in the response.
- No values are returned for the secrets. This operations requires the
- secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified, the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SecretItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_secret_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('SecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_secret_versions.metadata = {'url': '/secrets/{secret-name}/versions'}
-
- def get_deleted_secrets(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """Lists deleted secrets for the specified vault.
-
- The Get Deleted Secrets operation returns the secrets that have been
- deleted for a vault enabled for soft-delete. This operation requires
- the secrets/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedSecretItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedSecretItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_secrets.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('DeletedSecretListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_deleted_secrets.metadata = {'url': '/deletedsecrets'}
-
- async def get_deleted_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Gets the specified deleted secret.
-
- The Get Deleted Secret operation returns the specified deleted secret
- along with its attributes. This operation requires the secrets/get
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedSecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedSecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedSecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'}
-
- async def purge_deleted_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Permanently deletes the specified secret.
-
- The purge deleted secret operation removes the secret permanently,
- without the possibility of recovery. This operation can only be enabled
- on a soft-delete enabled vault. This operation requires the
- secrets/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'}
-
- async def recover_deleted_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Recovers the deleted secret to the latest version.
-
- Recovers the deleted secret in the specified vault. This operation can
- only be performed on a soft-delete enabled vault. This operation
- requires the secrets/recover permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the deleted secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}/recover'}
-
- async def backup_secret(self, vault_base_url, secret_name, *, cls=None, **kwargs):
- """Backs up the specified secret.
-
- Requests that a backup of the specified secret be downloaded to the
- client. All versions of the secret will be downloaded. This operation
- requires the secrets/backup permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_name: The name of the secret.
- :type secret_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: BackupSecretResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.BackupSecretResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.backup_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'secret-name': self._serialize.url("secret_name", secret_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('BackupSecretResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- backup_secret.metadata = {'url': '/secrets/{secret-name}/backup'}
-
- async def restore_secret(self, vault_base_url, secret_bundle_backup, *, cls=None, **kwargs):
- """Restores a backed up secret to a vault.
-
- Restores a backed up secret, and all its versions, to a vault. This
- operation requires the secrets/restore permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param secret_bundle_backup: The backup blob associated with a secret
- bundle.
- :type secret_bundle_backup: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SecretBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SecretBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SecretRestoreParameters(secret_bundle_backup=secret_bundle_backup)
-
- # Construct URL
- url = self.restore_secret.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SecretRestoreParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SecretBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- restore_secret.metadata = {'url': '/secrets/restore'}
-
- def get_certificates(
- self, vault_base_url, maxresults=None, include_pending=None, *, cls=None, **kwargs):
- """List certificates in a specified key vault.
-
- The GetCertificates operation returns the set of certificates resources
- in the specified key vault. This operation requires the
- certificates/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :param include_pending: Specifies whether to include certificates
- which are not completely provisioned.
- :type include_pending: bool
- :return: An iterator like instance of CertificateItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificates.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- if include_pending is not None:
- query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool')
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('CertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_certificates.metadata = {'url': '/certificates'}
-
- async def delete_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Deletes a certificate from a specified key vault.
-
- Deletes all versions of a certificate object along with its associated
- policy. Delete certificate cannot be used to remove individual versions
- of a certificate object. This operation requires the
- certificates/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedCertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedCertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate.metadata = {'url': '/certificates/{certificate-name}'}
-
- async def set_certificate_contacts(self, vault_base_url, contact_list=None, *, cls=None, **kwargs):
- """Sets the certificate contacts for the specified key vault.
-
- Sets the certificate contacts for the specified key vault. This
- operation requires the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param contact_list: The contact list for the vault certificates.
- :type contact_list: list[~azure.keyvault.v7_0.models.Contact]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- contacts = models.Contacts(contact_list=contact_list)
-
- # Construct URL
- url = self.set_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(contacts, 'Contacts')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- async def get_certificate_contacts(self, vault_base_url, *, cls=None, **kwargs):
- """Lists the certificate contacts for a specified key vault.
-
- The GetCertificateContacts operation returns the set of certificate
- contact resources in the specified key vault. This operation requires
- the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- async def delete_certificate_contacts(self, vault_base_url, *, cls=None, **kwargs):
- """Deletes the certificate contacts for a specified key vault.
-
- Deletes the certificate contacts for a specified key vault certificate.
- This operation requires the certificates/managecontacts permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: Contacts or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.Contacts
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_contacts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('Contacts', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_contacts.metadata = {'url': '/certificates/contacts'}
-
- def get_certificate_issuers(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List certificate issuers for a specified key vault.
-
- The GetCertificateIssuers operation returns the set of certificate
- issuer resources in the specified key vault. This operation requires
- the certificates/manageissuers/getissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of CertificateIssuerItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateIssuerItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificate_issuers.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('CertificateIssuerListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_certificate_issuers.metadata = {'url': '/certificates/issuers'}
-
- async def set_certificate_issuer(self, vault_base_url, issuer_name, provider, credentials=None, organization_details=None, attributes=None, *, cls=None, **kwargs):
- """Sets the specified certificate issuer.
-
- The SetCertificateIssuer operation adds or updates the specified
- certificate issuer. This operation requires the certificates/setissuers
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param provider: The issuer provider.
- :type provider: str
- :param credentials: The credentials to be used for the issuer.
- :type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials
- :param organization_details: Details of the organization as provided
- to the issuer.
- :type organization_details:
- ~azure.keyvault.v7_0.models.OrganizationDetails
- :param attributes: Attributes of the issuer object.
- :type attributes: ~azure.keyvault.v7_0.models.IssuerAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameter = models.CertificateIssuerSetParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes)
-
- # Construct URL
- url = self.set_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameter, 'CertificateIssuerSetParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- async def update_certificate_issuer(self, vault_base_url, issuer_name, provider=None, credentials=None, organization_details=None, attributes=None, *, cls=None, **kwargs):
- """Updates the specified certificate issuer.
-
- The UpdateCertificateIssuer operation performs an update on the
- specified certificate issuer entity. This operation requires the
- certificates/setissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param provider: The issuer provider.
- :type provider: str
- :param credentials: The credentials to be used for the issuer.
- :type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials
- :param organization_details: Details of the organization as provided
- to the issuer.
- :type organization_details:
- ~azure.keyvault.v7_0.models.OrganizationDetails
- :param attributes: Attributes of the issuer object.
- :type attributes: ~azure.keyvault.v7_0.models.IssuerAttributes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameter = models.CertificateIssuerUpdateParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes)
-
- # Construct URL
- url = self.update_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameter, 'CertificateIssuerUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- async def get_certificate_issuer(self, vault_base_url, issuer_name, *, cls=None, **kwargs):
- """Lists the specified certificate issuer.
-
- The GetCertificateIssuer operation returns the specified certificate
- issuer resources in the specified key vault. This operation requires
- the certificates/manageissuers/getissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- async def delete_certificate_issuer(self, vault_base_url, issuer_name, *, cls=None, **kwargs):
- """Deletes the specified certificate issuer.
-
- The DeleteCertificateIssuer operation permanently removes the specified
- certificate issuer from the vault. This operation requires the
- certificates/manageissuers/deleteissuers permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param issuer_name: The name of the issuer.
- :type issuer_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: IssuerBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.IssuerBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_issuer.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('IssuerBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'}
-
- async def create_certificate(self, vault_base_url, certificate_name, certificate_policy=None, certificate_attributes=None, tags=None, *, cls=None, **kwargs):
- """Creates a new certificate.
-
- If this is the first version, the certificate resource is created. This
- operation requires the certificates/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateCreateParameters(certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.create_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateCreateParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [202]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 202:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- create_certificate.metadata = {'url': '/certificates/{certificate-name}/create'}
-
- async def import_certificate(self, vault_base_url, certificate_name, base64_encoded_certificate, password=None, certificate_policy=None, certificate_attributes=None, tags=None, *, cls=None, **kwargs):
- """Imports a certificate into a specified key vault.
-
- Imports an existing valid certificate, containing a private key, into
- Azure Key Vault. The certificate to be imported can be in either PFX or
- PEM format. If the certificate is in PEM format the PEM file must
- contain the key as well as x509 certificates. This operation requires
- the certificates/import permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param base64_encoded_certificate: Base64 encoded representation of
- the certificate object to import. This certificate needs to contain
- the private key.
- :type base64_encoded_certificate: str
- :param password: If the private key in base64EncodedCertificate is
- encrypted, the password used for encryption.
- :type password: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateImportParameters(base64_encoded_certificate=base64_encoded_certificate, password=password, certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.import_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateImportParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- import_certificate.metadata = {'url': '/certificates/{certificate-name}/import'}
-
- def get_certificate_versions(
- self, vault_base_url, certificate_name, maxresults=None, *, cls=None, **kwargs):
- """List the versions of a certificate.
-
- The GetCertificateVersions operation returns the versions of a
- certificate in the specified key vault. This operation requires the
- certificates/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of CertificateItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.CertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_certificate_versions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('CertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_certificate_versions.metadata = {'url': '/certificates/{certificate-name}/versions'}
-
- async def get_certificate_policy(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Lists the policy for a certificate.
-
- The GetCertificatePolicy operation returns the specified certificate
- policy resources in the specified key vault. This operation requires
- the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in a given key
- vault.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificatePolicy or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_policy.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificatePolicy', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'}
-
- async def update_certificate_policy(self, vault_base_url, certificate_name, certificate_policy, *, cls=None, **kwargs):
- """Updates the policy for a certificate.
-
- Set specified members in the certificate policy. Leave others as null.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given
- vault.
- :type certificate_name: str
- :param certificate_policy: The policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v7_0.models.CertificatePolicy
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificatePolicy or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificatePolicy
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.update_certificate_policy.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(certificate_policy, 'CertificatePolicy')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificatePolicy', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'}
-
- async def update_certificate(self, vault_base_url, certificate_name, certificate_version, certificate_policy=None, certificate_attributes=None, tags=None, *, cls=None, **kwargs):
- """Updates the specified attributes associated with the given certificate.
-
- The UpdateCertificate operation applies the specified update on the
- given certificate; the only elements updated are the certificate's
- attributes. This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given key
- vault.
- :type certificate_name: str
- :param certificate_version: The version of the certificate.
- :type certificate_version: str
- :param certificate_policy: The management policy for the certificate.
- :type certificate_policy:
- ~azure.keyvault.v7_0.models.CertificatePolicy
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateUpdateParameters(certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.update_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
- 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'}
-
- async def get_certificate(self, vault_base_url, certificate_name, certificate_version, *, cls=None, **kwargs):
- """Gets information about a certificate.
-
- Gets information about a specific certificate. This operation requires
- the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate in the given
- vault.
- :type certificate_name: str
- :param certificate_version: The version of the certificate.
- :type certificate_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'),
- 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'}
-
- async def update_certificate_operation(self, vault_base_url, certificate_name, cancellation_requested, *, cls=None, **kwargs):
- """Updates a certificate operation.
-
- Updates a certificate creation operation that is already in progress.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param cancellation_requested: Indicates if cancellation was requested
- on the certificate operation.
- :type cancellation_requested: bool
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- certificate_operation = models.CertificateOperationUpdateParameter(cancellation_requested=cancellation_requested)
-
- # Construct URL
- url = self.update_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(certificate_operation, 'CertificateOperationUpdateParameter')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- async def get_certificate_operation(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Gets the creation operation of a certificate.
-
- Gets the creation operation associated with a specified certificate.
- This operation requires the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- async def delete_certificate_operation(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Deletes the creation operation for a specific certificate.
-
- Deletes the creation operation for a specified certificate that is in
- the process of being created. The certificate is no longer created.
- This operation requires the certificates/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateOperation or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateOperation
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_certificate_operation.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateOperation', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'}
-
- async def merge_certificate(self, vault_base_url, certificate_name, x509_certificates, certificate_attributes=None, tags=None, *, cls=None, **kwargs):
- """Merges a certificate or a certificate chain with a key pair existing on
- the server.
-
- The MergeCertificate operation performs the merging of a certificate or
- certificate chain with a key pair currently available in the service.
- This operation requires the certificates/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param x509_certificates: The certificate or the certificate chain to
- merge.
- :type x509_certificates: list[bytearray]
- :param certificate_attributes: The attributes of the certificate
- (optional).
- :type certificate_attributes:
- ~azure.keyvault.v7_0.models.CertificateAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateMergeParameters(x509_certificates=x509_certificates, certificate_attributes=certificate_attributes, tags=tags)
-
- # Construct URL
- url = self.merge_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateMergeParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 201:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'}
-
- async def backup_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Backs up the specified certificate.
-
- Requests that a backup of the specified certificate be downloaded to
- the client. All versions of the certificate will be downloaded. This
- operation requires the certificates/backup permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate.
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: BackupCertificateResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.BackupCertificateResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.backup_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('BackupCertificateResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- backup_certificate.metadata = {'url': '/certificates/{certificate-name}/backup'}
-
- async def restore_certificate(self, vault_base_url, certificate_bundle_backup, *, cls=None, **kwargs):
- """Restores a backed up certificate to a vault.
-
- Restores a backed up certificate, and all its versions, to a vault.
- This operation requires the certificates/restore permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_bundle_backup: The backup blob associated with a
- certificate bundle.
- :type certificate_bundle_backup: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.CertificateRestoreParameters(certificate_bundle_backup=certificate_bundle_backup)
-
- # Construct URL
- url = self.restore_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'CertificateRestoreParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- restore_certificate.metadata = {'url': '/certificates/restore'}
-
- def get_deleted_certificates(
- self, vault_base_url, maxresults=None, include_pending=None, *, cls=None, **kwargs):
- """Lists the deleted certificates in the specified vault currently
- available for recovery.
-
- The GetDeletedCertificates operation retrieves the certificates in the
- current vault which are in a deleted state and ready for recovery or
- purging. This operation includes deletion-specific information. This
- operation requires the certificates/get/list permission. This operation
- can only be enabled on soft-delete enabled vaults.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :param include_pending: Specifies whether to include certificates
- which are not completely provisioned.
- :type include_pending: bool
- :return: An iterator like instance of DeletedCertificateItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedCertificateItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_certificates.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- if include_pending is not None:
- query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool')
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('DeletedCertificateListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_deleted_certificates.metadata = {'url': '/deletedcertificates'}
-
- async def get_deleted_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Retrieves information about the specified deleted certificate.
-
- The GetDeletedCertificate operation retrieves the deleted certificate
- information plus its attributes, such as retention interval, scheduled
- permanent deletion and the current deletion recovery level. This
- operation requires the certificates/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedCertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedCertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedCertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'}
-
- async def purge_deleted_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Permanently deletes the specified deleted certificate.
-
- The PurgeDeletedCertificate operation performs an irreversible deletion
- of the specified certificate, without possibility for recovery. The
- operation is not available if the recovery level does not specify
- 'Purgeable'. This operation requires the certificate/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'}
-
- async def recover_deleted_certificate(self, vault_base_url, certificate_name, *, cls=None, **kwargs):
- """Recovers the deleted certificate back to its current version under
- /certificates.
-
- The RecoverDeletedCertificate operation performs the reversal of the
- Delete operation. The operation is applicable in vaults enabled for
- soft-delete, and must be issued during the retention interval
- (available in the deleted certificate's attributes). This operation
- requires the certificates/recover permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param certificate_name: The name of the deleted certificate
- :type certificate_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: CertificateBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.CertificateBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_certificate.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('CertificateBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}/recover'}
-
- def get_storage_accounts(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """List storage accounts managed by the specified key vault. This
- operation requires the storage/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of StorageAccountItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.StorageAccountItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_storage_accounts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('StorageListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_storage_accounts.metadata = {'url': '/storage'}
-
- def get_deleted_storage_accounts(
- self, vault_base_url, maxresults=None, *, cls=None, **kwargs):
- """Lists deleted storage accounts for the specified vault.
-
- The Get Deleted Storage Accounts operation returns the storage accounts
- that have been deleted for a vault enabled for soft-delete. This
- operation requires the storage/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedStorageAccountItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedStorageAccountItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_storage_accounts.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('DeletedStorageListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_deleted_storage_accounts.metadata = {'url': '/deletedstorage'}
-
- async def get_deleted_storage_account(self, vault_base_url, storage_account_name, *, cls=None, **kwargs):
- """Gets the specified deleted storage account.
-
- The Get Deleted Storage Account operation returns the specified deleted
- storage account along with its attributes. This operation requires the
- storage/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedStorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedStorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'}
-
- async def purge_deleted_storage_account(self, vault_base_url, storage_account_name, *, cls=None, **kwargs):
- """Permanently deletes the specified storage account.
-
- The purge deleted storage account operation removes the secret
- permanently, without the possibility of recovery. This operation can
- only be performed on a soft-delete enabled vault. This operation
- requires the storage/purge permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.purge_deleted_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- if cls:
- response_headers = {}
- return cls(response, None, response_headers)
- purge_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'}
-
- async def recover_deleted_storage_account(self, vault_base_url, storage_account_name, *, cls=None, **kwargs):
- """Recovers the deleted storage account.
-
- Recovers the deleted storage account in the specified vault. This
- operation can only be performed on a soft-delete enabled vault. This
- operation requires the storage/recover permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}/recover'}
-
- async def backup_storage_account(self, vault_base_url, storage_account_name, *, cls=None, **kwargs):
- """Backs up the specified storage account.
-
- Requests that a backup of the specified storage account be downloaded
- to the client. This operation requires the storage/backup permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: BackupStorageResult or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.BackupStorageResult
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.backup_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('BackupStorageResult', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- backup_storage_account.metadata = {'url': '/storage/{storage-account-name}/backup'}
-
- async def restore_storage_account(self, vault_base_url, storage_bundle_backup, *, cls=None, **kwargs):
- """Restores a backed up storage account to a vault.
-
- Restores a backed up storage account to a vault. This operation
- requires the storage/restore permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_bundle_backup: The backup blob associated with a
- storage account.
- :type storage_bundle_backup: bytes
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageRestoreParameters(storage_bundle_backup=storage_bundle_backup)
-
- # Construct URL
- url = self.restore_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageRestoreParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- restore_storage_account.metadata = {'url': '/storage/restore'}
-
- async def delete_storage_account(self, vault_base_url, storage_account_name, *, cls=None, **kwargs):
- """Deletes a storage account. This operation requires the storage/delete
- permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedStorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedStorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedStorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- async def get_storage_account(self, vault_base_url, storage_account_name, *, cls=None, **kwargs):
- """Gets information about a specified storage account. This operation
- requires the storage/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- async def set_storage_account(self, vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period=None, storage_account_attributes=None, tags=None, *, cls=None, **kwargs):
- """Creates or updates a new storage account. This operation requires the
- storage/set permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param resource_id: Storage account resource id.
- :type resource_id: str
- :param active_key_name: Current active storage account key name.
- :type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
- :type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration
- specified in ISO-8601 format.
- :type regeneration_period: str
- :param storage_account_attributes: The attributes of the storage
- account.
- :type storage_account_attributes:
- ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountCreateParameters(resource_id=resource_id, active_key_name=active_key_name, auto_regenerate_key=auto_regenerate_key, regeneration_period=regeneration_period, storage_account_attributes=storage_account_attributes, tags=tags)
-
- # Construct URL
- url = self.set_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- async def update_storage_account(self, vault_base_url, storage_account_name, active_key_name=None, auto_regenerate_key=None, regeneration_period=None, storage_account_attributes=None, tags=None, *, cls=None, **kwargs):
- """Updates the specified attributes associated with the given storage
- account. This operation requires the storage/set/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param active_key_name: The current active storage account key name.
- :type active_key_name: str
- :param auto_regenerate_key: whether keyvault should manage the storage
- account for the user.
- :type auto_regenerate_key: bool
- :param regeneration_period: The key regeneration time duration
- specified in ISO-8601 format.
- :type regeneration_period: str
- :param storage_account_attributes: The attributes of the storage
- account.
- :type storage_account_attributes:
- ~azure.keyvault.v7_0.models.StorageAccountAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountUpdateParameters(active_key_name=active_key_name, auto_regenerate_key=auto_regenerate_key, regeneration_period=regeneration_period, storage_account_attributes=storage_account_attributes, tags=tags)
-
- # Construct URL
- url = self.update_storage_account.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_storage_account.metadata = {'url': '/storage/{storage-account-name}'}
-
- async def regenerate_storage_account_key(self, vault_base_url, storage_account_name, key_name, *, cls=None, **kwargs):
- """Regenerates the specified key value for the given storage account. This
- operation requires the storage/regeneratekey permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param key_name: The storage account key name.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: StorageBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.StorageBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.StorageAccountRegenerteKeyParameters(key_name=key_name)
-
- # Construct URL
- url = self.regenerate_storage_account_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'StorageAccountRegenerteKeyParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('StorageBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- regenerate_storage_account_key.metadata = {'url': '/storage/{storage-account-name}/regeneratekey'}
-
- def get_sas_definitions(
- self, vault_base_url, storage_account_name, maxresults=None, *, cls=None, **kwargs):
- """List storage SAS definitions for the given storage account. This
- operation requires the storage/listsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of SasDefinitionItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.SasDefinitionItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_sas_definitions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('SasDefinitionListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_sas_definitions.metadata = {'url': '/storage/{storage-account-name}/sas'}
-
- def get_deleted_sas_definitions(
- self, vault_base_url, storage_account_name, maxresults=None, *, cls=None, **kwargs):
- """Lists deleted SAS definitions for the specified vault and storage
- account.
-
- The Get Deleted Sas Definitions operation returns the SAS definitions
- that have been deleted for a vault enabled for soft-delete. This
- operation requires the storage/listsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of DeletedSasDefinitionItem
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.v7_0.models.DeletedSasDefinitionItem]
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- def prepare_request(next_link=None):
- query_parameters = {}
- if not next_link:
- # Construct URL
- url = self.get_deleted_sas_definitions.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
- if maxresults is not None:
- query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- else:
- url = next_link
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- return request
-
- async def extract_data_async(response):
- deserialized = self._deserialize('DeletedSasDefinitionListResult', response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem)
- return deserialized.next_link, AsyncList(list_of_elem)
-
- async def get_next_async(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response = await self._client._pipeline.run(request, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
- return response
-
- # Deserialize response
- return AsyncItemPaged(
- get_next_async, extract_data_async
- )
- get_deleted_sas_definitions.metadata = {'url': '/deletedstorage/{storage-account-name}/sas'}
-
- async def get_deleted_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, *, cls=None, **kwargs):
- """Gets the specified deleted sas definition.
-
- The Get Deleted SAS Definition operation returns the specified deleted
- SAS definition along with its attributes. This operation requires the
- storage/getsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedSasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_deleted_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedSasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_deleted_sas_definition.metadata = {'url': '/deletedstorage/{storage-account-name}/sas/{sas-definition-name}'}
-
- async def recover_deleted_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, *, cls=None, **kwargs):
- """Recovers the deleted SAS definition.
-
- Recovers the deleted SAS definition for the specified storage account.
- This operation can only be performed on a soft-delete enabled vault.
- This operation requires the storage/recover permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.recover_deleted_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- recover_deleted_sas_definition.metadata = {'url': '/deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover'}
-
- async def delete_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, *, cls=None, **kwargs):
- """Deletes a SAS definition from a specified storage account. This
- operation requires the storage/deletesas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedSasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedSasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedSasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- async def get_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, *, cls=None, **kwargs):
- """Gets information about a SAS definition for the specified storage
- account. This operation requires the storage/getsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- async def set_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes=None, tags=None, *, cls=None, **kwargs):
- """Creates or updates a new SAS definition for the specified storage
- account. This operation requires the storage/setsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param template_uri: The SAS definition token template signed with an
- arbitrary key. Tokens created according to the SAS definition will
- have the same properties as the template.
- :type template_uri: str
- :param sas_type: The type of SAS token the SAS definition will create.
- Possible values include: 'account', 'service'
- :type sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :param validity_period: The validity period of SAS tokens created
- according to the SAS definition.
- :type validity_period: str
- :param sas_definition_attributes: The attributes of the SAS
- definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SasDefinitionCreateParameters(template_uri=template_uri, sas_type=sas_type, validity_period=validity_period, sas_definition_attributes=sas_definition_attributes, tags=tags)
-
- # Construct URL
- url = self.set_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SasDefinitionCreateParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- set_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
-
- async def update_sas_definition(self, vault_base_url, storage_account_name, sas_definition_name, template_uri=None, sas_type=None, validity_period=None, sas_definition_attributes=None, tags=None, *, cls=None, **kwargs):
- """Updates the specified attributes associated with the given SAS
- definition. This operation requires the storage/setsas permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param storage_account_name: The name of the storage account.
- :type storage_account_name: str
- :param sas_definition_name: The name of the SAS definition.
- :type sas_definition_name: str
- :param template_uri: The SAS definition token template signed with an
- arbitrary key. Tokens created according to the SAS definition will
- have the same properties as the template.
- :type template_uri: str
- :param sas_type: The type of SAS token the SAS definition will create.
- Possible values include: 'account', 'service'
- :type sas_type: str or ~azure.keyvault.v7_0.models.SasTokenType
- :param validity_period: The validity period of SAS tokens created
- according to the SAS definition.
- :type validity_period: str
- :param sas_definition_attributes: The attributes of the SAS
- definition.
- :type sas_definition_attributes:
- ~azure.keyvault.v7_0.models.SasDefinitionAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: SasDefinitionBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.SasDefinitionBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.SasDefinitionUpdateParameters(template_uri=template_uri, sas_type=sas_type, validity_period=validity_period, sas_definition_attributes=sas_definition_attributes, tags=tags)
-
- # Construct URL
- url = self.update_sas_definition.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'),
- 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'SasDefinitionUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('SasDefinitionBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'}
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_key_vault_client_enums.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_key_vault_client_enums.py
deleted file mode 100644
index 046a304e990a..000000000000
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/models/_key_vault_client_enums.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-from enum import Enum
-
-
-class JsonWebKeyType(str, Enum):
-
- ec = "EC" #: Elliptic Curve.
- ec_hsm = "EC-HSM" #: Elliptic Curve with a private key which is not exportable from the HSM.
- rsa = "RSA" #: RSA (https://tools.ietf.org/html/rfc3447)
- rsa_hsm = "RSA-HSM" #: RSA with a private key which is not exportable from the HSM.
- oct = "oct" #: Octet sequence (used to represent symmetric keys)
-
-
-class JsonWebKeyCurveName(str, Enum):
-
- p_256 = "P-256" #: The NIST P-256 elliptic curve, AKA SECG curve SECP256R1.
- p_384 = "P-384" #: The NIST P-384 elliptic curve, AKA SECG curve SECP384R1.
- p_521 = "P-521" #: The NIST P-521 elliptic curve, AKA SECG curve SECP521R1.
- p_256_k = "P-256K" #: The SECG SECP256K1 elliptic curve.
-
-
-class DeletionRecoveryLevel(str, Enum):
-
- purgeable = "Purgeable"
- recoverable_purgeable = "Recoverable+Purgeable"
- recoverable = "Recoverable"
- recoverable_protected_subscription = "Recoverable+ProtectedSubscription"
-
-
-class KeyUsageType(str, Enum):
-
- digital_signature = "digitalSignature"
- non_repudiation = "nonRepudiation"
- key_encipherment = "keyEncipherment"
- data_encipherment = "dataEncipherment"
- key_agreement = "keyAgreement"
- key_cert_sign = "keyCertSign"
- c_rl_sign = "cRLSign"
- encipher_only = "encipherOnly"
- decipher_only = "decipherOnly"
-
-
-class ActionType(str, Enum):
-
- email_contacts = "EmailContacts"
- auto_renew = "AutoRenew"
-
-
-class JsonWebKeyOperation(str, Enum):
-
- encrypt = "encrypt"
- decrypt = "decrypt"
- sign = "sign"
- verify = "verify"
- wrap_key = "wrapKey"
- unwrap_key = "unwrapKey"
-
-
-class JsonWebKeyEncryptionAlgorithm(str, Enum):
-
- rsa_oaep = "RSA-OAEP"
- rsa_oaep_256 = "RSA-OAEP-256"
- rsa1_5 = "RSA1_5"
-
-
-class JsonWebKeySignatureAlgorithm(str, Enum):
-
- ps256 = "PS256" #: RSASSA-PSS using SHA-256 and MGF1 with SHA-256, as described in https://tools.ietf.org/html/rfc7518
- ps384 = "PS384" #: RSASSA-PSS using SHA-384 and MGF1 with SHA-384, as described in https://tools.ietf.org/html/rfc7518
- ps512 = "PS512" #: RSASSA-PSS using SHA-512 and MGF1 with SHA-512, as described in https://tools.ietf.org/html/rfc7518
- rs256 = "RS256" #: RSASSA-PKCS1-v1_5 using SHA-256, as described in https://tools.ietf.org/html/rfc7518
- rs384 = "RS384" #: RSASSA-PKCS1-v1_5 using SHA-384, as described in https://tools.ietf.org/html/rfc7518
- rs512 = "RS512" #: RSASSA-PKCS1-v1_5 using SHA-512, as described in https://tools.ietf.org/html/rfc7518
- rsnull = "RSNULL" #: Reserved
- es256 = "ES256" #: ECDSA using P-256 and SHA-256, as described in https://tools.ietf.org/html/rfc7518.
- es384 = "ES384" #: ECDSA using P-384 and SHA-384, as described in https://tools.ietf.org/html/rfc7518
- es512 = "ES512" #: ECDSA using P-521 and SHA-512, as described in https://tools.ietf.org/html/rfc7518
- es256_k = "ES256K" #: ECDSA using P-256K and SHA-256, as described in https://tools.ietf.org/html/rfc7518
-
-
-class SasTokenType(str, Enum):
-
- account = "account"
- service = "service"
diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/operations/_key_vault_client_operations.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/operations/_key_vault_client_operations.py
deleted file mode 100644
index da216d1db657..000000000000
--- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_generated/v7_0/operations/_key_vault_client_operations.py
+++ /dev/null
@@ -1,5163 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-from azure.core.exceptions import map_error
-from azure.core.paging import ItemPaged
-from .. import models
-import uuid
-
-
-class KeyVaultClientOperationsMixin(object):
-
- def create_key(self, vault_base_url, key_name, kty, key_size=None, key_ops=None, key_attributes=None, tags=None, curve=None, cls=None, **kwargs):
- """Creates a new key, stores it, then returns key parameters and
- attributes to the client.
-
- The create key operation can be used to create any key type in Azure
- Key Vault. If the named key already exists, Azure Key Vault creates a
- new version of the key. It requires the keys/create permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name for the new key. The system will generate
- the version name for the new key.
- :type key_name: str
- :param kty: The type of key to create. For valid values, see
- JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA',
- 'RSA-HSM', 'oct'
- :type kty: str or ~azure.keyvault.v7_0.models.JsonWebKeyType
- :param key_size: The key size in bits. For example: 2048, 3072, or
- 4096 for RSA.
- :type key_size: int
- :param key_ops:
- :type key_ops: list[str or
- ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
- :param key_attributes:
- :type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param curve: Elliptic curve name. For valid values, see
- JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384',
- 'P-521', 'P-256K'
- :type curve: str or ~azure.keyvault.v7_0.models.JsonWebKeyCurveName
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyCreateParameters(kty=kty, key_size=key_size, key_ops=key_ops, key_attributes=key_attributes, tags=tags, curve=curve)
-
- # Construct URL
- url = self.create_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyCreateParameters')
-
- # Construct and send request
- request = self._client.post(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- create_key.metadata = {'url': '/keys/{key-name}/create'}
-
- def import_key(self, vault_base_url, key_name, key, hsm=None, key_attributes=None, tags=None, cls=None, **kwargs):
- """Imports an externally created key, stores it, and returns key
- parameters and attributes to the client.
-
- The import key operation may be used to import any key type into an
- Azure Key Vault. If the named key already exists, Azure Key Vault
- creates a new version of the key. This operation requires the
- keys/import permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: Name for the imported key.
- :type key_name: str
- :param key: The Json web key
- :type key: ~azure.keyvault.v7_0.models.JsonWebKey
- :param hsm: Whether to import as a hardware key (HSM) or software key.
- :type hsm: bool
- :param key_attributes: The key management attributes.
- :type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyImportParameters(hsm=hsm, key=key, key_attributes=key_attributes, tags=tags)
-
- # Construct URL
- url = self.import_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyImportParameters')
-
- # Construct and send request
- request = self._client.put(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- import_key.metadata = {'url': '/keys/{key-name}'}
-
- def delete_key(self, vault_base_url, key_name, cls=None, **kwargs):
- """Deletes a key of any type from storage in Azure Key Vault.
-
- The delete key operation cannot be used to remove individual versions
- of a key. This operation removes the cryptographic material associated
- with the key, which means the key is not usable for Sign/Verify,
- Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the
- keys/delete permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key to delete.
- :type key_name: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: DeletedKeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.DeletedKeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.delete_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.delete(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('DeletedKeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- delete_key.metadata = {'url': '/keys/{key-name}'}
-
- def update_key(self, vault_base_url, key_name, key_version, key_ops=None, key_attributes=None, tags=None, cls=None, **kwargs):
- """The update key operation changes specified attributes of a stored key
- and can be applied to any key type and key version stored in Azure Key
- Vault.
-
- In order to perform this operation, the key must already exist in the
- Key Vault. Note: The cryptographic material of a key itself cannot be
- changed. This operation requires the keys/update permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of key to update.
- :type key_name: str
- :param key_version: The version of the key to update.
- :type key_version: str
- :param key_ops: Json web key operations. For more information on
- possible key operations, see JsonWebKeyOperation.
- :type key_ops: list[str or
- ~azure.keyvault.v7_0.models.JsonWebKeyOperation]
- :param key_attributes:
- :type key_attributes: ~azure.keyvault.v7_0.models.KeyAttributes
- :param tags: Application specific metadata in the form of key-value
- pairs.
- :type tags: dict[str, str]
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- parameters = models.KeyUpdateParameters(key_ops=key_ops, key_attributes=key_attributes, tags=tags)
-
- # Construct URL
- url = self.update_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- header_parameters['Content-Type'] = 'application/json; charset=utf-8'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct body
- body_content = self._serialize.body(parameters, 'KeyUpdateParameters')
-
- # Construct and send request
- request = self._client.patch(url, query_parameters, header_parameters, body_content)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- update_key.metadata = {'url': '/keys/{key-name}/{key-version}'}
-
- def get_key(self, vault_base_url, key_name, key_version, cls=None, **kwargs):
- """Gets the public part of a stored key.
-
- The get key operation is applicable to all key types. If the requested
- key is symmetric, then no key material is released in the response.
- This operation requires the keys/get permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key to get.
- :type key_name: str
- :param key_version: Adding the version parameter retrieves a specific
- version of a key.
- :type key_version: str
- :param callable cls: A custom type or function that will be passed the
- direct response
- :return: KeyBundle or the result of cls(response)
- :rtype: ~azure.keyvault.v7_0.models.KeyBundle
- :raises:
- :class:`KeyVaultErrorException`
- """
- error_map = kwargs.pop('error_map', None)
- # Construct URL
- url = self.get_key.metadata['url']
- path_format_arguments = {
- 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
- 'key-name': self._serialize.url("key_name", key_name, 'str'),
- 'key-version': self._serialize.url("key_version", key_version, 'str')
- }
- url = self._client.format_url(url, **path_format_arguments)
-
- # Construct parameters
- query_parameters = {}
- query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
-
- # Construct headers
- header_parameters = {}
- header_parameters['Accept'] = 'application/json'
- if self._config.generate_client_request_id:
- header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
-
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
- pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise models.KeyVaultErrorException(response, self._deserialize)
-
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize('KeyBundle', response)
-
- if cls:
- return cls(response, deserialized, None)
-
- return deserialized
- get_key.metadata = {'url': '/keys/{key-name}/{key-version}'}
-
- def get_key_versions(
- self, vault_base_url, key_name, maxresults=None, cls=None, **kwargs):
- """Retrieves a list of individual key versions with the same key name.
-
- The full key identifier, attributes, and tags are provided in the
- response. This operation requires the keys/list permission.
-
- :param vault_base_url: The vault name, for example
- https://myvault.vault.azure.net.
- :type vault_base_url: str
- :param key_name: The name of the key.
- :type key_name: str
- :param maxresults: Maximum number of results to return in a page. If
- not specified the service will return up to 25 results.
- :type maxresults: int
- :return: An iterator like instance of KeyItem
- :rtype:
- ~azure.core.paging.ItemPaged[~azure.keyvault.v7_0.models.KeyItem]
- :raises:
- :class:`KeyVaultErrorException